Skip to content

Commit

Permalink
MDL-38590 data: Reformat settings form
Browse files Browse the repository at this point in the history
AMOS BEGIN
 CPY [allowcomments,mod_glossary],[allowcomments,mod_data]
AMOS END
  • Loading branch information
Frederic Massart committed Mar 28, 2013
1 parent 8963212 commit 8783e17
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
9 changes: 5 additions & 4 deletions mod/data/lang/en/data.php
Expand Up @@ -29,6 +29,7 @@
$string['addentries'] = 'Add entries';
$string['addtemplate'] = 'Add template';
$string['advancedsearch'] = 'Advanced search';
$string['allowcomments'] = 'Allow comments on entries';
$string['alttext'] = 'Alternative text';
$string['approve'] = 'Approve';
$string['approved'] = 'Approved';
Expand Down Expand Up @@ -204,7 +205,7 @@
$string['mapexistingfield'] = 'Map to {$a}';
$string['mapnewfield'] = 'Create a new field';
$string['mappingwarning'] = 'All old fields not mapped to a new field will be lost and all data in that field will be removed.';
$string['maxentries'] = 'Maximum entries';
$string['maxentries'] = 'Maximum number of entries';
$string['maxentries_help'] = 'The maximum number of entries a student is allowed to submit for this activity.';
$string['maxsize'] = 'Maximum size';
$string['menu'] = 'Menu';
Expand Down Expand Up @@ -262,7 +263,7 @@
$string['notinjectivemap'] = 'Not an injective map';
$string['notopenyet'] = 'Sorry, this activity is not available until {$a}';
$string['number'] = 'Number';
$string['numberrssarticles'] = 'RSS articles';
$string['numberrssarticles'] = 'Entries in the RSS feed';
$string['numnotapproved'] = 'Pending';
$string['numrecords'] = '{$a} entries';
$string['ods'] = '<acronym title="OpenDocument Spreadsheet">ODS</acronym> (OpenOffice)';
Expand All @@ -287,9 +288,9 @@
$string['recorddeleted'] = 'Entry deleted';
$string['recordsnotsaved'] = 'No entry was saved. Please check the format of the uploaded file.';
$string['recordssaved'] = 'entries saved';
$string['requireapproval'] = 'Require approval?';
$string['requireapproval'] = 'Approval required';
$string['requireapproval_help'] = 'If enabled, entries require approving by a teacher before they are viewable by everyone.';
$string['requiredentries'] = 'Required entries';
$string['requiredentries'] = 'Entries required for completion';
$string['requiredentries_help'] = 'The number of entries a student is required to submit before the activity can be considered complete.';
$string['requiredentriestoview'] = 'Entries required before viewing';
$string['requiredentriestoview_help'] = 'The number of entries a student is required to submit before they can view entries from other students.
Expand Down
32 changes: 19 additions & 13 deletions mod/data/mod_form.php
Expand Up @@ -25,18 +25,17 @@ function definition() {

$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('header', 'entrieshdr', get_string('entries', 'data'));

$mform->addElement('date_selector', 'timeviewto', get_string('viewtodate', 'data'), array('optional'=>true));
$mform->addElement('selectyesno', 'approval', get_string('requireapproval', 'data'));
$mform->addHelpButton('approval', 'requireapproval', 'data');

$mform->addElement('selectyesno', 'comments', get_string('allowcomments', 'data'));

$countoptions = array(0=>get_string('none'))+
(array_combine(range(1, DATA_MAX_ENTRIES),//keys
range(1, DATA_MAX_ENTRIES)));//values
(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');

Expand All @@ -46,13 +45,20 @@ function definition() {
$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->addElement('header', 'availibilityhdr', get_string('availability'));

$mform->addElement('select', 'approval', get_string('requireapproval', 'data'), $ynoptions);
$mform->addHelpButton('approval', 'requireapproval', '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));

if($CFG->enablerssfeeds && $CFG->data_enablerssfeeds){
// ----------------------------------------------------------------------
if ($CFG->enablerssfeeds && $CFG->data_enablerssfeeds) {
$mform->addElement('header', 'rsshdr', get_string('rss'));
$mform->addElement('select', 'rssarticles', get_string('numberrssarticles', 'data') , $countoptions);
}

Expand Down

0 comments on commit 8783e17

Please sign in to comment.