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

add configurable setting to section_links block for the increment by and number of secitons that are hardcored

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.5
    • Fix Version/s: 1.9.8, 2.0
    • Component/s: Blocks
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      Added the 4 new settings for the section_links block to allow the site administrator to determine the number of sections that will be displayed before the sections are incremented by more than 1. At the moment this is hard coded at 22 by 2 and 40 by 5.

      This is a pretty quick patch, the descriptions could use some work, and it might be good to make this a block configuration as well as a site configuration to allow instructors to edit the section links on a course by course basis.

      Jason Hardin

        Gliffy Diagrams

        1. section_links_lang2.patch
          1 kB
          Jason Hardin
        2. section_links2.patch
          5 kB
          Jason Hardin
        3. section_links-dongsheng.patch
          7 kB
          Dongsheng Cai

          Activity

          Hide
          jrh18 Jason Hardin added a comment -

          I have made a lot of modifications and retested some of the functionality. I also added a block level configuration for these settings. Please see the attached files for the newest version.

          Show
          jrh18 Jason Hardin added a comment - I have made a lot of modifications and retested some of the functionality. I also added a block level configuration for these settings. Please see the attached files for the newest version.
          Hide
          dongsheng Dongsheng Cai added a comment -

          Hi, Jason, thanks for your patch
          I made a few changes to your patch, can you take a look, then I can commit it to moodle

          Show
          dongsheng Dongsheng Cai added a comment - Hi, Jason, thanks for your patch I made a few changes to your patch, can you take a look, then I can commit it to moodle
          Hide
          jrh18 Jason Hardin added a comment -

          the patch looks good to me. I was working on something else this weekend and I think that with the addition of the configuration options that there may need to be a clean up function to remove the configuration variables from mdl_config_plugins the core block delete doesn't seem to remove these records. Something like:
          function before_delete(){
          delete_records('config_plugins', 'plugin', 'blocks/section_links');
          }

          Show
          jrh18 Jason Hardin added a comment - the patch looks good to me. I was working on something else this weekend and I think that with the addition of the configuration options that there may need to be a clean up function to remove the configuration variables from mdl_config_plugins the core block delete doesn't seem to remove these records. Something like: function before_delete(){ delete_records('config_plugins', 'plugin', 'blocks/section_links'); }
          Hide
          dongsheng Dongsheng Cai added a comment -

          will apply this patch after 1.9.6 released

          Show
          dongsheng Dongsheng Cai added a comment - will apply this patch after 1.9.6 released
          Hide
          dongsheng Dongsheng Cai added a comment -

          Committed, thanks your contributions, Jason

          Show
          dongsheng Dongsheng Cai added a comment - Committed, thanks your contributions, Jason
          Hide
          jrh18 Jason Hardin added a comment -

          There are some issues with this code. Couple of minor mistakes attached is a new patch to fix the code.

          Show
          jrh18 Jason Hardin added a comment - There are some issues with this code. Couple of minor mistakes attached is a new patch to fix the code.
          Hide
          dongsheng Dongsheng Cai added a comment -

          Hi, Jason

          Can you explain further? What are the minor mistakes?

          Can you attach a new patch if it is possible.

          Show
          dongsheng Dongsheng Cai added a comment - Hi, Jason Can you explain further? What are the minor mistakes? Can you attach a new patch if it is possible.
          Hide
          jrh18 Jason Hardin added a comment -

          Rather than do it here i just opened a new ticket http://tracker.moodle.org/browse/MDL-21122 The patch is on this new ticket.

          Show
          jrh18 Jason Hardin added a comment - Rather than do it here i just opened a new ticket http://tracker.moodle.org/browse/MDL-21122 The patch is on this new ticket.
          Hide
          dougiamas Martin Dougiamas added a comment - - edited

          Please write some docs for this! http://docs.moodle.org/en/admin/setting/blocksettingsection_links and http://docs.moodle.org/en/blocks/section_links

          The new config strings do not really explain what the settings are.

          Show
          dougiamas Martin Dougiamas added a comment - - edited Please write some docs for this! http://docs.moodle.org/en/admin/setting/blocksettingsection_links and http://docs.moodle.org/en/blocks/section_links The new config strings do not really explain what the settings are.
          Hide
          dougiamas Martin Dougiamas added a comment -

          Also the new file blocks/section_links/config_instance.html needs boilerplates at the top

          Show
          dougiamas Martin Dougiamas added a comment - Also the new file blocks/section_links/config_instance.html needs boilerplates at the top
          Hide
          dongsheng Dongsheng Cai added a comment -

          Hi, Martin,

          I added boilerplates the block files and a few docs.

          Show
          dongsheng Dongsheng Cai added a comment - Hi, Martin, I added boilerplates the block files and a few docs.
          Hide
          dougiamas Martin Dougiamas added a comment -

          Great thanks!

          Show
          dougiamas Martin Dougiamas added a comment - Great thanks!
          Hide
          tsala Helen Foster added a comment -

          Hi Dongsheng,

          Please could you add a settings link for the Section Links block on the manage blocks page admin/blocks.php (the same as for other blocks with settings, such as the Courses block).

          Show
          tsala Helen Foster added a comment - Hi Dongsheng, Please could you add a settings link for the Section Links block on the manage blocks page admin/blocks.php (the same as for other blocks with settings, such as the Courses block).
          Hide
          tsala Helen Foster added a comment -

          Reopening, as a settings link for the Section Links block still needs adding to the manage blocks page admin/blocks.php.

          Show
          tsala Helen Foster added a comment - Reopening, as a settings link for the Section Links block still needs adding to the manage blocks page admin/blocks.php.
          Hide
          dongsheng Dongsheng Cai added a comment -

          Hi, Helen
          Sorry for delay, I added the missing link to admin/blocks.php

          Show
          dongsheng Dongsheng Cai added a comment - Hi, Helen Sorry for delay, I added the missing link to admin/blocks.php

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Mar/10