/**
 * Print the drop down that allows the user to select how they want to have
 * the discussion displayed.
 *
 * @param int $id anonforum id if $anonforumtype is 'single',
 *              discussion id for any other anonforum type
 * @param mixed $mode anonforum layout mode
 * @param string $anonforumtype optional
 */
function anonforum_print_mode_form($id, $mode, $anonforumtype = '')
{
    global $OUTPUT;
    if ($anonforumtype == 'single') {
        $select = new single_select(new moodle_url("/mod/anonforum/view.php", array('f' => $id)), 'mode', anonforum_get_layout_modes(), $mode, null, "mode");
        $select->set_label(get_string('displaymode', 'anonforum'), array('class' => 'accesshide'));
        $select->class = "anonforummode";
    } else {
        $select = new single_select(new moodle_url("/mod/anonforum/discuss.php", array('d' => $id)), 'mode', anonforum_get_layout_modes(), $mode, null, "mode");
        $select->set_label(get_string('displaymode', 'anonforum'), array('class' => 'accesshide'));
    }
    echo $OUTPUT->render($select);
}
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * @package mod-anonforum
 * @copyright  2009 Petr Skoda (http://skodak.org)
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
    require_once $CFG->dirroot . '/mod/anonforum/lib.php';
    $settings->add(new admin_setting_configselect('anonforum_displaymode', get_string('displaymode', 'anonforum'), get_string('configdisplaymode', 'anonforum'), ANONFORUM_MODE_NESTED, anonforum_get_layout_modes()));
    $settings->add(new admin_setting_configcheckbox('anonforum_replytouser', get_string('replytouser', 'anonforum'), get_string('configreplytouser', 'anonforum'), 1));
    // Less non-HTML characters than this is short
    $settings->add(new admin_setting_configtext('anonforum_shortpost', get_string('shortpost', 'anonforum'), get_string('configshortpost', 'anonforum'), 300, PARAM_INT));
    // More non-HTML characters than this is long
    $settings->add(new admin_setting_configtext('anonforum_longpost', get_string('longpost', 'anonforum'), get_string('configlongpost', 'anonforum'), 600, PARAM_INT));
    // Number of discussions on a page
    $settings->add(new admin_setting_configtext('anonforum_manydiscussions', get_string('manydiscussions', 'anonforum'), get_string('configmanydiscussions', 'anonforum'), 100, PARAM_INT));
    if (isset($CFG->maxbytes)) {
        $maxbytes = 0;
        if (isset($CFG->anonforum_maxbytes)) {
            $maxbytes = $CFG->anonforum_maxbytes;
        }
        $settings->add(new admin_setting_configselect('anonforum_maxbytes', get_string('maxattachmentsize', 'anonforum'), get_string('configmaxbytes', 'anonforum'), 512000, get_max_upload_sizes($CFG->maxbytes, 0, 0, $maxbytes)));
    }
    // Default number of attachments allowed per post in all anonymous forums