mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
7719b4db37
AMOS BEGIN HLP data/exportzip.html,[exportaszip_help,mod_data] HLP data/fields.html,[newfield_help,mod_data] HLP data/fieldmappings.html,[fieldmappings_help,mod_data] HLP data/importcsv.html,[csvimport_help,mod_data] HLP data/importfromfile.html,[fromfile_help,mod_data] HLP data/maxentries.html,[maxentries_help,mod_data] HLP data/requireapproval.html,[requireapproval_help,mod_data] HLP data/requiredentries.html,[requiredentries_help,mod_data] HLP data/requiredentriestoview.html,[requiredentriestoview_help,mod_data] HLP data/savepreset.html,[saveaspreset_help,mod_data] HLP data/tags.html,[availabletags_help,mod_data] HLP data/usepreset.html,[usestandard_help,mod_data] AMOS END
77 lines
3.2 KiB
PHP
77 lines
3.2 KiB
PHP
<?php
|
|
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
|
|
|
|
class mod_data_mod_form extends moodleform_mod {
|
|
|
|
function definition() {
|
|
global $CFG, $DB;
|
|
|
|
$mform =& $this->_form;
|
|
|
|
//-------------------------------------------------------------------------------
|
|
$mform->addElement('header', 'general', get_string('general', 'form'));
|
|
|
|
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
|
|
if (!empty($CFG->formatstringstriptags)) {
|
|
$mform->setType('name', PARAM_TEXT);
|
|
} else {
|
|
$mform->setType('name', PARAM_CLEAN);
|
|
}
|
|
$mform->addRule('name', null, 'required', null, 'client');
|
|
|
|
$this->add_intro_editor(true, get_string('intro', 'data'));
|
|
|
|
$mform->addElement('date_selector', 'timeavailablefrom', get_string('availablefromdate', 'data'), array('optional'=>true));
|
|
|
|
$mform->addElement('date_selector', 'timeavailableto', get_string('availabletodate', 'data'), array('optional'=>true));
|
|
|
|
$mform->addElement('date_selector', 'timeviewfrom', get_string('viewfromdate', 'data'), array('optional'=>true));
|
|
|
|
$mform->addElement('date_selector', 'timeviewto', get_string('viewtodate', 'data'), array('optional'=>true));
|
|
|
|
|
|
$countoptions = array(0=>get_string('none'))+
|
|
(array_combine(range(1, DATA_MAX_ENTRIES),//keys
|
|
range(1, DATA_MAX_ENTRIES)));//values
|
|
$mform->addElement('select', 'requiredentries', get_string('requiredentries', 'data'), $countoptions);
|
|
$mform->addHelpButton('requiredentries', 'requiredentries', 'data');
|
|
|
|
$mform->addElement('select', 'requiredentriestoview', get_string('requiredentriestoview', 'data'), $countoptions);
|
|
$mform->addHelpButton('requiredentriestoview', 'requiredentriestoview', 'data');
|
|
|
|
$mform->addElement('select', 'maxentries', get_string('maxentries', 'data'), $countoptions);
|
|
$mform->addHelpButton('maxentries', 'maxentries', 'data');
|
|
|
|
$ynoptions = array(0 => get_string('no'), 1 => get_string('yes'));
|
|
$mform->addElement('select', 'comments', get_string('comments', 'data'), $ynoptions);
|
|
$mform->setHelpButton('comments', array('comments', get_string('allowcomments', 'data'), 'data'));
|
|
|
|
$mform->addElement('select', 'approval', get_string('requireapproval', 'data'), $ynoptions);
|
|
$mform->addHelpButton('approval', 'requireapproval', 'data');
|
|
|
|
if($CFG->enablerssfeeds && $CFG->data_enablerssfeeds){
|
|
$mform->addElement('select', 'rssarticles', get_string('numberrssarticles', 'data') , $countoptions);
|
|
}
|
|
|
|
//$mform->addElement('checkbox', 'assessed', get_string('allowratings', 'data') , get_string('ratingsuse', 'data'));
|
|
|
|
//$mform->addElement('modgrade', 'scale', get_string('grade'), false);
|
|
//$mform->disabledIf('scale', 'assessed');
|
|
|
|
|
|
$this->standard_coursemodule_elements();
|
|
|
|
//-------------------------------------------------------------------------------
|
|
// buttons
|
|
$this->add_action_buttons();
|
|
}
|
|
|
|
function data_preprocessing(&$default_values){
|
|
if (empty($default_values['scale'])){
|
|
$default_values['assessed'] = 0;
|
|
}
|
|
}
|
|
|
|
}
|
|
|