Example #1
0
// 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_quora
 * @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/quora/lib.php';
    $settings->add(new admin_setting_configselect('quora_displaymode', get_string('displaymode', 'quora'), get_string('configdisplaymode', 'quora'), FORUM_MODE_NESTED, quora_get_layout_modes()));
    $settings->add(new admin_setting_configcheckbox('quora_replytouser', get_string('replytouser', 'quora'), get_string('configreplytouser', 'quora'), 1));
    // Less non-HTML characters than this is short
    $settings->add(new admin_setting_configtext('quora_shortpost', get_string('shortpost', 'quora'), get_string('configshortpost', 'quora'), 300, PARAM_INT));
    // More non-HTML characters than this is long
    $settings->add(new admin_setting_configtext('quora_longpost', get_string('longpost', 'quora'), get_string('configlongpost', 'quora'), 600, PARAM_INT));
    // Number of discussions on a page
    $settings->add(new admin_setting_configtext('quora_manydiscussions', get_string('manydiscussions', 'quora'), get_string('configmanydiscussions', 'quora'), 100, PARAM_INT));
    if (isset($CFG->maxbytes)) {
        $maxbytes = 0;
        if (isset($CFG->quora_maxbytes)) {
            $maxbytes = $CFG->quora_maxbytes;
        }
        $settings->add(new admin_setting_configselect('quora_maxbytes', get_string('maxattachmentsize', 'quora'), get_string('configmaxbytes', 'quora'), 512000, get_max_upload_sizes($CFG->maxbytes, 0, 0, $maxbytes)));
    }
    // Default number of attachments allowed per post in all quoras
Example #2
0
/**
 * Print the drop down that allows the user to select how they want to have
 * the discussion displayed.
 *
 * @param int $id quora id if $quoratype is 'single',
 *              discussion id for any other quora type
 * @param mixed $mode quora layout mode
 * @param string $quoratype optional
 */
function quora_print_mode_form($id, $mode, $quoratype = '')
{
    global $OUTPUT;
    if ($quoratype == 'single') {
        $select = new single_select(new moodle_url("/mod/quora/view.php", array('f' => $id)), 'mode', quora_get_layout_modes(), $mode, null, "mode");
        $select->set_label(get_string('displaymode', 'quora'), array('class' => 'accesshide'));
        $select->class = "quoramode";
    } else {
        $select = new single_select(new moodle_url("/mod/quora/discuss.php", array('d' => $id)), 'mode', quora_get_layout_modes(), $mode, null, "mode");
        $select->set_label(get_string('displaymode', 'quora'), array('class' => 'accesshide'));
    }
    echo $OUTPUT->render($select);
}