Permalink
Browse files

MDL-38005 form: Headers have a proper name

  • Loading branch information...
1 parent f160f97 commit 807cf3d0ae2becd428f298c65b610553325398e3 @FMCorz FMCorz committed Mar 12, 2013
View
2 course/completion_form.php
@@ -51,7 +51,7 @@ function definition() {
// Check if there is existing criteria completions
if ($completion->is_course_locked()) {
- $mform->addElement('header', '', get_string('completionsettingslocked', 'completion'));
+ $mform->addElement('header', 'completionsettingslocked', get_string('completionsettingslocked', 'completion'));
$mform->addElement('static', '', '', get_string('err_settingslocked', 'completion'));
$mform->addElement('submit', 'settingsunlock', get_string('unlockcompletiondelete', 'completion'));
}
View
10 course/edit_form.php
@@ -196,7 +196,7 @@ function definition() {
enrol_course_edit_form($mform, $course, $context);
//--------------------------------------------------------------------------------
- $mform->addElement('header','', get_string('groups', 'group'));
+ $mform->addElement('header','groups', get_string('groups', 'group'));
$choices = array();
$choices[NOGROUPS] = get_string('groupsnone', 'group');
@@ -219,7 +219,7 @@ function definition() {
$mform->addElement('select', 'defaultgroupingid', get_string('defaultgrouping', 'group'), $options);
//--------------------------------------------------------------------------------
- $mform->addElement('header','', get_string('availability'));
+ $mform->addElement('header','availability', get_string('availability'));
$choices = array();
$choices['0'] = get_string('courseavailablenot');
@@ -237,7 +237,7 @@ function definition() {
}
//--------------------------------------------------------------------------------
- $mform->addElement('header','', get_string('language'));
+ $mform->addElement('header','language', get_string('language'));
$languages=array();
$languages[''] = get_string('forceno');
@@ -247,7 +247,7 @@ function definition() {
//--------------------------------------------------------------------------------
if (completion_info::is_enabled_for_site()) {
- $mform->addElement('header','', get_string('progress','completion'));
+ $mform->addElement('header','progress', get_string('progress','completion'));
$mform->addElement('select', 'enablecompletion', get_string('completion','completion'),
array(0=>get_string('completiondisabled','completion'), 1=>get_string('completionenabled','completion')));
$mform->setDefault('enablecompletion', $courseconfig->enablecompletion);
@@ -314,7 +314,7 @@ function definition_after_data() {
$formatvalue = $mform->getElementValue('format');
if (is_array($formatvalue) && !empty($formatvalue)) {
$courseformat = course_get_format((object)array('format' => $formatvalue[0]));
- $newel = $mform->createElement('header', '', get_string('courseformatoptions', 'moodle',
+ $newel = $mform->createElement('header', 'courseformatoptions', get_string('courseformatoptions', 'moodle',
$courseformat->get_format_name()));
$mform->insertElementBefore($newel, 'addcourseformatoptionshere');
View
2 course/editsection_form.php
@@ -53,7 +53,7 @@ public function definition_after_data() {
$course = $this->_customdata['course'];
if (!empty($CFG->enableavailability)) {
- $mform->addElement('header', '', get_string('availabilityconditions', 'condition'));
+ $mform->addElement('header', 'availabilityconditions', get_string('availabilityconditions', 'condition'));
// String used by conditions more than once
$strcondnone = get_string('none', 'condition');
// Grouping conditions - only if grouping is enabled at site level
View
2 enrol/authorize/enrol_form.php
@@ -127,7 +127,7 @@ function definition() {
}
if ($plugin->get_config('an_avs')) {
- $mform->addElement('header', '', '  ' . get_string('address'), '');
+ $mform->addElement('header', 'addressheader', '  ' . get_string('address'), '');
$mform->addElement('text', 'ccaddress', get_string('address'), 'size="30"');
$mform->setType('ccaddress', PARAM_ALPHANUM);
View
3 lib/formslib.php
@@ -1374,6 +1374,9 @@ function setAdvanced($elementName, $advanced=true){
* @return void
*/
function setExpanded($headername, $expanded=true){
+ if (empty($headername)) {
+ return;
+ }
$element = $this->getElement($headername);
if ($element->getType() != 'header') {
debugging('Cannot use setExpanded on non-header elements', DEBUG_DEVELOPER);
View
3 login/change_password_form.php
@@ -34,8 +34,9 @@ function definition() {
global $USER, $CFG;
$mform = $this->_form;
+ $mform->setDisableShortforms(true);
- $mform->addElement('header', '', get_string('changepassword'), '');
+ $mform->addElement('header', 'changepassword', get_string('changepassword'), '');
// visible elements
$mform->addElement('static', 'username', get_string('username'), $USER->username);
View
5 login/forgot_password_form.php
@@ -32,16 +32,17 @@ class login_forgot_password_form extends moodleform {
function definition() {
$mform = $this->_form;
+ $mform->setDisableShortforms(true);
- $mform->addElement('header', '', get_string('searchbyusername'), '');
+ $mform->addElement('header', 'searchbyusername', get_string('searchbyusername'), '');
$mform->addElement('text', 'username', get_string('username'));
$mform->setType('username', PARAM_RAW);
$submitlabel = get_string('search');
$mform->addElement('submit', 'submitbuttonusername', $submitlabel);
- $mform->addElement('header', '', get_string('searchbyemail'), '');
+ $mform->addElement('header', 'searchbyemail', get_string('searchbyemail'), '');
$mform->addElement('text', 'email', get_string('email'));
$mform->setType('email', PARAM_RAW);
View
7 login/signup_form.php
@@ -35,7 +35,7 @@ function definition() {
$mform = $this->_form;
- $mform->addElement('header', '', get_string('createuserandpass'), '');
+ $mform->addElement('header', 'createuserandpass', get_string('createuserandpass'), '');
$mform->addElement('text', 'username', get_string('username'), 'maxlength="100" size="12"');
@@ -49,7 +49,7 @@ function definition() {
$mform->setType('password', PARAM_RAW);
$mform->addRule('password', get_string('missingpassword'), 'required', null, 'server');
- $mform->addElement('header', '', get_string('supplyinfo'),'');
+ $mform->addElement('header', 'supplyinfo', get_string('supplyinfo'),'');
$mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="25"');
$mform->setType('email', PARAM_NOTAGS);
@@ -103,7 +103,8 @@ function definition() {
profile_signup_fields($mform);
if (!empty($CFG->sitepolicy)) {
- $mform->addElement('header', '', get_string('policyagreement'), '');
+ $mform->addElement('header', 'policyagreement', get_string('policyagreement'), '');
+ $mform->setExpanded('policyagreement');
$mform->addElement('static', 'policylink', '', '<a href="'.$CFG->sitepolicy.'" onclick="this.target=\'_blank\'">'.get_String('policyagreementclick').'</a>');
$mform->addElement('checkbox', 'policyagreed', get_string('policyaccept'));
$mform->addRule('policyagreed', get_string('policyagree'), 'required', null, 'server');
View
3 mod/assign/feedback/file/batchuploadfilesform.php
@@ -44,7 +44,8 @@ public function definition() {
$mform = $this->_form;
$params = $this->_customdata;
- $mform->addElement('header', '', get_string('batchuploadfilesforusers', 'assignfeedback_file', count($params['users'])));
+ $mform->addElement('header', 'batchuploadfilesforusers', get_string('batchuploadfilesforusers', 'assignfeedback_file',
+ count($params['users'])));
$mform->addElement('static', 'userslist', get_string('selectedusers', 'assignfeedback_file'), $params['usershtml']);
$data = new stdClass();
View
2 mod/assign/feedback/file/uploadzipform.php
@@ -43,7 +43,7 @@ public function definition() {
$mform = $this->_form;
$params = $this->_customdata;
- $mform->addElement('header', '', get_string('uploadzip', 'assignfeedback_file'));
+ $mform->addElement('header', 'uploadzip', get_string('uploadzip', 'assignfeedback_file'));
$fileoptions = array('subdirs'=>0,
'maxbytes'=>$COURSE->maxbytes,
View
2 mod/assign/feedback/offline/uploadgradesform.php
@@ -43,7 +43,7 @@ public function definition() {
$mform = $this->_form;
$params = $this->_customdata;
- $mform->addElement('header', '', get_string('uploadgrades', 'assignfeedback_offline'));
+ $mform->addElement('header', 'uploadgrades', get_string('uploadgrades', 'assignfeedback_offline'));
$fileoptions = array('subdirs'=>0,
'maxbytes'=>$COURSE->maxbytes,
View
4 mod/feedback/edit_form.php
@@ -83,7 +83,7 @@ public function set_form_elements() {
$elementgroup = array();
//headline
- $mform->addElement('header', '', get_string('using_templates', 'feedback'));
+ $mform->addElement('header', 'using_templates', get_string('using_templates', 'feedback'));
// hidden elements
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
@@ -164,7 +164,7 @@ public function set_form_elements() {
$mform->setType('savetemplate', PARAM_INT);
//headline
- $mform->addElement('header', '', get_string('creating_templates', 'feedback'));
+ $mform->addElement('header', 'creating_templates', get_string('creating_templates', 'feedback'));
// visible elements
$elementgroup = array();
View
4 mod/forum/mod_form.php
@@ -88,7 +88,7 @@ function definition() {
if ($CFG->enablerssfeeds && isset($CFG->forum_enablerssfeeds) && $CFG->forum_enablerssfeeds) {
//-------------------------------------------------------------------------------
- $mform->addElement('header', '', get_string('rss'));
+ $mform->addElement('header', 'rssheader', get_string('rss'));
$choices = array();
$choices[0] = get_string('none');
$choices[1] = get_string('discussions', 'forum');
@@ -116,7 +116,7 @@ function definition() {
}
//-------------------------------------------------------------------------------
- $mform->addElement('header', '', get_string('blockafter', 'forum'));
+ $mform->addElement('header', 'blockafterheader', get_string('blockafter', 'forum'));
$options = array();
$options[0] = get_string('blockperioddisabled','forum');
$options[60*60*24] = '1 '.get_string('day');
View
2 mod/forum/post_form.php
@@ -119,7 +119,7 @@ function definition() {
}
if (!empty($CFG->forum_enabletimedposts) && !$post->parent && has_capability('mod/forum:viewhiddentimedposts', $coursecontext)) { // hack alert
- $mform->addElement('header', '', get_string('displayperiod', 'forum'));
+ $mform->addElement('header', 'displayperiod', get_string('displayperiod', 'forum'));
$mform->addElement('date_selector', 'timestart', get_string('displaystart', 'forum'), array('optional'=>true));
$mform->addHelpButton('timestart', 'displaystart', 'forum');
View
2 mod/glossary/mod_form.php
@@ -103,7 +103,7 @@ function definition() {
if ($CFG->enablerssfeeds && isset($CFG->glossary_enablerssfeeds) && $CFG->glossary_enablerssfeeds) {
//-------------------------------------------------------------------------------
- $mform->addElement('header', '', get_string('rss'));
+ $mform->addElement('header', 'rssheader', get_string('rss'));
$choices = array();
$choices[0] = get_string('none');
$choices[1] = get_string('withauthor', 'glossary');
View
2 question/type/calculated/datasetitems_form.php
@@ -272,7 +272,7 @@ protected function definition() {
$k = optional_param('selectshow', 1, PARAM_INT);
for ($i = $this->noofitems; $i >= 1; $i--) {
if ($k > 0) {
- $mform->addElement('header', '', "<b>" .
+ $mform->addElement('header', 'setnoheader', "<b>" .
get_string('setno', 'qtype_calculated', $i)."</b>&nbsp;&nbsp;");
}
foreach ($this->datasetdefs as $defkey => $datasetdef) {
View
5 repository/equella/lib.php
@@ -291,7 +291,7 @@ public static function instance_config_form($mform) {
);
$mform->addElement('select', 'equella_select_restriction', get_string('selectrestriction', 'repository_equella'), $choices);
- $mform->addElement('header', '',
+ $mform->addElement('header', 'groupheader',
get_string('group', 'repository_equella', get_string('groupdefault', 'repository_equella')));
$mform->addElement('text', 'equella_shareid', get_string('sharedid', 'repository_equella'));
$mform->setType('equella_shareid', PARAM_RAW);
@@ -302,7 +302,8 @@ public static function instance_config_form($mform) {
$mform->addRule('equella_sharedsecret', $strrequired, 'required', null, 'client');
foreach (self::get_all_editing_roles() as $role) {
- $mform->addElement('header', '', get_string('group', 'repository_equella', format_string($role->name)));
+ $mform->addElement('header', 'groupheader_'.$role->shortname, get_string('group', 'repository_equella',
+ format_string($role->name)));
$mform->addElement('text', "equella_{$role->shortname}_shareid", get_string('sharedid', 'repository_equella'));
$mform->setType("equella_{$role->shortname}_shareid", PARAM_RAW);
$mform->addElement('text', "equella_{$role->shortname}_sharedsecret",

0 comments on commit 807cf3d

Please sign in to comment.