Moodle
  1. Moodle
  2. MDL-35042

Allow HTML block instances advanced setting to be toggled

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Blocks
    • Labels:
    • Testing Instructions:
      Hide

      Create a new course.
      Add multiple HTML blocks with titles and content. Note that there is no config for specifying CSS classes.
      Inspect each of the block's CSS class values in their outer divs (should be something like "block_html block")
      Go to Admin -> Plugins -> Blocks -> HTML, and enable "Allow additional CSS classes"
      Go back to course and in each block add some values to the "Additional CSS classes" fields and save.
      Inspect each of the block's CSS class values again and the classes specified in the previous step should be appended to the original classes.
      Go to Admin -> Plugins -> Blocks -> HTML, and disable "Allow additional CSS classes"
      Inspect each of the block's CSS class values in their outer divs (additional configured classes should no longer be added)
      Each block's settings form should no longer have the "Additional CSS classes" field.

      Show
      Create a new course. Add multiple HTML blocks with titles and content. Note that there is no config for specifying CSS classes. Inspect each of the block's CSS class values in their outer divs (should be something like "block_html block") Go to Admin -> Plugins -> Blocks -> HTML, and enable "Allow additional CSS classes" Go back to course and in each block add some values to the "Additional CSS classes" fields and save. Inspect each of the block's CSS class values again and the classes specified in the previous step should be appended to the original classes. Go to Admin -> Plugins -> Blocks -> HTML, and disable "Allow additional CSS classes" Inspect each of the block's CSS class values in their outer divs (additional configured classes should no longer be added) Each block's settings form should no longer have the "Additional CSS classes" field.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:
    • Rank:
      43655

      Description

      MDL-34899 introduced a new setting for HTML block instances allowing them to set custom additional CSS classes. This could be confusing to administrators so I have created a site-wide setting to enable/disable their use (and defaulted them to be off).

      When the setting is disabled, the form setting ceases to appear and any previously set values are no longer honoured (however they are saved in the database and will be honoured again if the setting is re-enabled).

        Issue Links

          Activity

          Hide
          Frédéric Massart added a comment -

          Hi Aaron, thanks for providing this patch.

          Now that you have added settings to the HTML block, could you override the method block_html::has_config() so that it returns true and shows a Settings link in the "Manage blocks" page.

          Push for integration whenever you like. Cheers!

          Show
          Frédéric Massart added a comment - Hi Aaron, thanks for providing this patch. Now that you have added settings to the HTML block, could you override the method block_html::has_config() so that it returns true and shows a Settings link in the "Manage blocks" page. Push for integration whenever you like. Cheers!
          Hide
          Aaron Barnes added a comment -

          Done, thanks Frédéric!

          Show
          Aaron Barnes added a comment - Done, thanks Frédéric!
          Hide
          Aparup Banerjee added a comment -

          Thanks Aaron, the mortals are happier

          integrated into master only.

          have tested: setting 'red' to css and turning off turns off red. \o/

          Show
          Aparup Banerjee added a comment - Thanks Aaron, the mortals are happier integrated into master only. have tested: setting 'red' to css and turning off turns off red. \o/
          Hide
          Ankit Agarwal added a comment -

          Works as described!
          Thanks

          Show
          Ankit Agarwal added a comment - Works as described! Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          I'm so proud...of you, many thanks!

          http://youtu.be/n64CdfDRnZY

          Closing as fixed, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - I'm so proud...of you, many thanks! http://youtu.be/n64CdfDRnZY Closing as fixed, ciao
          Hide
          Mary Cooch added a comment -

          Removing docs_required label as this is documented here http://docs.moodle.org/24/en/HTML_block

          Show
          Mary Cooch added a comment - Removing docs_required label as this is documented here http://docs.moodle.org/24/en/HTML_block

            People

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

              Dates

              • Created:
                Updated:
                Resolved: