Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-35615

"Use default section name" checkbox and "Section name" fields should be inline

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.2, 2.3.5, 2.4.2, 2.5
    • Fix Version/s: 2.3.6, 2.4.3
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      1. Turn editing on for a course
      2. Edit a course section

      On edit page, make sure the alignment for checkbox and label for 'use default section name' are inline with section name input text. Also make sure the functionality works as it should.

      Show
      Turn editing on for a course Edit a course section On edit page, make sure the alignment for checkbox and label for 'use default section name' are inline with section name input text. Also make sure the functionality works as it should.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Moodle usually make use of a single row for related forms elements like in the examples I displayed in the attachments: example 1 and 2.
      Why do the "Summary of section" is out of standards?
      My suggestion is to change what I reported in current.png into expected.png.

      The fix is trivial:
      in HEAD/course/editsection_form.php
      change

          function definition() {
      
              $mform  = $this->_form;
              $course = $this->_customdata['course'];
              $mform->addElement('checkbox', 'usedefaultname', get_string('sectionusedefaultname'));
              $mform->setDefault('usedefaultname', true);
      
              $mform->addElement('text', 'name', get_string('sectionname'), array('size'=>'30'));
              $mform->setType('name', PARAM_TEXT);
              $mform->disabledIf('name','usedefaultname','checked');
      
              /// Prepare course and the editor
      
              $mform->addElement('editor', 'summary_editor', get_string('summary'), null, $this->_customdata['editoroptions']);
              $mform->addHelpButton('summary_editor', 'summary');
              $mform->setType('summary_editor', PARAM_RAW);
      
              $mform->addElement('hidden', 'id');
              $mform->setType('id', PARAM_INT);
      
              $mform->_registerCancelButton('cancel');
          }
      

      to

          function definition() {
      
              $mform  = $this->_form;
      
              $course = $this->_customdata['course'];
      
              $elementgroup = array();
              $elementgroup[] = $mform->createElement('text', 'name', '', array('size'=>'30'));
              $elementgroup[] = $mform->createElement('checkbox', 'usedefaultname', '', get_string('sectionusedefaultname'));
              $mform->addGroup($elementgroup, 'name_group', get_string('sectionname'), ' ', false);
      
              $mform->setDefault('usedefaultname', true);
              $mform->setType('name', PARAM_TEXT);
              $mform->disabledIf('name','usedefaultname','checked');
      
              /// Prepare course and the editor
      
              $mform->addElement('editor', 'summary_editor', get_string('summary'), null, $this->_customdata['editoroptions']);
              $mform->addHelpButton('summary_editor', 'summary');
              $mform->setType('summary_editor', PARAM_RAW);
      
              $mform->addElement('hidden', 'id');
              $mform->setType('id', PARAM_INT);
      
              $mform->_registerCancelButton('cancel');
          }
      

        Gliffy Diagrams

          Attachments

          1. current.png
            current.png
            26 kB
          2. example1.png
            example1.png
            21 kB
          3. example2.png
            example2.png
            9 kB
          4. expected.png
            expected.png
            28 kB

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Mar/13