Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/data/mod_form.php
Go to the documentation of this file.
00001 <?php
00002 if (!defined('MOODLE_INTERNAL')) {
00003     die('Direct access to this script is forbidden.');    
00004 }
00005 
00006 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
00007 
00008 class mod_data_mod_form extends moodleform_mod {
00009 
00010     function definition() {
00011         global $CFG, $DB;
00012 
00013         $mform =& $this->_form;
00014 
00015 //-------------------------------------------------------------------------------
00016         $mform->addElement('header', 'general', get_string('general', 'form'));
00017 
00018         $mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
00019         if (!empty($CFG->formatstringstriptags)) {
00020             $mform->setType('name', PARAM_TEXT);
00021         } else {
00022             $mform->setType('name', PARAM_CLEANHTML);
00023         }
00024         $mform->addRule('name', null, 'required', null, 'client');
00025 
00026         $this->add_intro_editor(true, get_string('intro', 'data'));
00027 
00028         $mform->addElement('date_selector', 'timeavailablefrom', get_string('availablefromdate', 'data'), array('optional'=>true));
00029 
00030         $mform->addElement('date_selector', 'timeavailableto', get_string('availabletodate', 'data'), array('optional'=>true));
00031 
00032         $mform->addElement('date_selector', 'timeviewfrom', get_string('viewfromdate', 'data'), array('optional'=>true));
00033 
00034         $mform->addElement('date_selector', 'timeviewto', get_string('viewtodate', 'data'), array('optional'=>true));
00035 
00036 
00037         $countoptions = array(0=>get_string('none'))+
00038                         (array_combine(range(1, DATA_MAX_ENTRIES),//keys
00039                                         range(1, DATA_MAX_ENTRIES)));//values
00040         $mform->addElement('select', 'requiredentries', get_string('requiredentries', 'data'), $countoptions);
00041         $mform->addHelpButton('requiredentries', 'requiredentries', 'data');
00042 
00043         $mform->addElement('select', 'requiredentriestoview', get_string('requiredentriestoview', 'data'), $countoptions);
00044         $mform->addHelpButton('requiredentriestoview', 'requiredentriestoview', 'data');
00045 
00046         $mform->addElement('select', 'maxentries', get_string('maxentries', 'data'), $countoptions);
00047         $mform->addHelpButton('maxentries', 'maxentries', 'data');
00048 
00049         $ynoptions = array(0 => get_string('no'), 1 => get_string('yes'));
00050         $mform->addElement('select', 'comments', get_string('comments', 'data'), $ynoptions);
00051 
00052         $mform->addElement('select', 'approval', get_string('requireapproval', 'data'), $ynoptions);
00053         $mform->addHelpButton('approval', 'requireapproval', 'data');
00054 
00055         if($CFG->enablerssfeeds && $CFG->data_enablerssfeeds){
00056             $mform->addElement('select', 'rssarticles', get_string('numberrssarticles', 'data') , $countoptions);
00057         }
00058 
00059         $this->standard_grading_coursemodule_elements();
00060 
00061         $this->standard_coursemodule_elements();
00062 
00063 //-------------------------------------------------------------------------------
00064         // buttons
00065         $this->add_action_buttons();
00066     }
00067 
00068     function data_preprocessing(&$default_values){
00069         parent::data_preprocessing($default_values);
00070     }
00071 
00072 }
00073 
 All Data Structures Namespaces Files Functions Variables Enumerations