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 Improvement
    • Status: Closed
    • Priority: Major 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
          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
          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 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 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
          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
          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 Cai added a comment -

          will apply this patch after 1.9.6 released

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

          Committed, thanks your contributions, Jason

          Show
          Dongsheng Cai added a comment - Committed, thanks your contributions, Jason
          Hide
          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
          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 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 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
          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
          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
          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
          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
          Martin Dougiamas added a comment -

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

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

          Hi, Martin,

          I added boilerplates the block files and a few docs.

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

          Great thanks!

          Show
          Martin Dougiamas added a comment - Great thanks!
          Hide
          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
          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
          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
          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 Cai added a comment -

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

          Show
          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: