Skip to content
Snippets Groups Projects
Select Git revision
  • ede2ac032d4d1038c97a20a8276edc50127d62cb
  • main default protected
  • dev protected
  • Issue/3133-subProjectsChanges
  • Issue/2489-addNotificationManagement
  • Issue/3085-useNewApiClient
  • Issue/3043-DataStorageNrwResource
  • Issue/3011-maintenanceMode
  • Issue/2446-addingResponsibleOrganization
  • Issue/2900-removeInsituteField
  • Issue/2981-dataPubInDb
  • Issue/2881-messageController
  • Issue/2921-changesToDataPublicationFeature
  • Issue/2926-regAppLogin
  • Issue/2672-fixSfbPidPointing
  • Issue/2875-devcontainer
  • Issue/2401-advisoryServiceUI2
  • Issue/2445-extractedMetadata
  • Issue/2829-useHrefProperty
  • Issue/xxxx-configurableApiHostname
  • Issue/2627-addPidRecord
  • v3.17.0
  • v3.16.0
  • v3.15.0
  • v3.14.0
  • v3.13.0
  • v3.12.0
  • v3.11.0
  • v3.10.0
  • v3.9.0
  • v3.8.0
  • v3.7.0
  • v3.6.0
  • v3.5.0
  • v3.4.3
  • v3.4.2
  • v3.4.1
  • v3.4.0
  • v3.3.2-package.0
  • v3.3.1
  • v3.3.0
41 results

index.ts

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    mod_form.php 2.88 KiB
    <?php
    // This file is part of Moodle - http://moodle.org/
    //
    // Moodle is free software: you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.
    //
    // 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/>.
    
    /**
     * This file is used when adding/editing a cardbox module to a course.
     * It contains the elements that will be displayed on the form responsible
     * for creating/installing an instance of cardbox.
     *
     * @package   mod_cardbox
     * @copyright 2019 RWTH Aachen (see README.md)
     * @author    Anna Heynkes
     * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     */
    
    defined('MOODLE_INTERNAL') || die(); //  It must be included from a Moodle page.
    
    require_once($CFG->dirroot.'/course/moodleform_mod.php');
    require_once($CFG->dirroot.'/mod/cardbox/lib.php');
     
    class mod_cardbox_mod_form extends moodleform_mod {
     
        function definition() {
            global $CFG, $DB, $OUTPUT, $USER, $COURSE;
     
            $mform =& $this->_form;
            $config = get_config('mod_cardbox');
    
            $mform->addElement('hidden', 'idcreator', $USER->id);
            $mform->setType('idcreator', PARAM_INT);
    
            $mform->addElement('hidden', 'idCourse', $COURSE->id);
            $mform->setType('idCourse', PARAM_INT);
    
            $mform->addElement('text', 'name', get_string('cardboxname', 'cardbox'), array('size'=>'64'));
            $mform->setType('name', PARAM_TEXT);
            $mform->addRule('name', null, 'required', null, 'client');
            $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
    
            // Description.
            $this->standard_intro_elements();
    
            $element = $mform->getElement('introeditor');
            $attributes = $element->getAttributes();
            $attributes['rows'] = 5;
            $element->setAttributes($attributes);
    
            $mform->addElement('advcheckbox', 'autocorrection', get_string('setting_autocorrection', 'cardbox'), get_string('setting_autocorrection_label', 'cardbox'), null, array(0, 1));
            $mform->setType('autocorrection', PARAM_BOOL);
            $mform->setDefault('autocorrection', 1);
            $mform->addHelpButton('autocorrection', 'setting_autocorrection', 'cardbox');
    
            $this->standard_coursemodule_elements();
    
            $this->add_action_buttons();
    
            $mform->addElement('hidden', 'revision'); // Hard-coded as 1; should be changed if version becomes important.
            $mform->setType('revision', PARAM_INT);