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

Add support into modinfo/cm_info to external URLs defining activity icons

XMLWordPrintable

    • MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • Hide

      IMPORTANT: Code modifications are needed to test this, because there isn't any core-activity yet using external activity icons.

      0) Install/upgrade/use moodle from integration.git
      1) Go to course with some forums and some other activities.
      2) TEST: Verify that icons are shown properly in the course page.
      3) Edit mod/forum/lib.php and create this function

      function forum_get_coursemodule_info($coursemodule) {
       
          $info = new cached_cm_info();
          $info->iconurl = new moodle_url('http://www.euroblind.org/skin/basic/design/braille/i/' . ($coursemodule->id % 10) . '.gif');
          return $info;
      }

      (that will enable the forum module to use the new feature, picking some "mod-based" images from outside)

      4) Reload the course page, you should not see any modification (because modinfo is cached).
      5) Edit any forum, and click "save and go to course page".
      6) TEST: VoilĂ , you should see the forum icons changed to some braille-icons.
      7) TEST: The rest of activities continue showing their default icons.
      8) Delete the code introduced by 3)
      9) Reload the course page, you should continue viewing the braille icons (because modinfo is cached).
      10) Edit any forum, and click "save and go to course page".
      11) TEST: Back to normal, forums showing their default icons again.

      That is, ciao

      Show
      IMPORTANT: Code modifications are needed to test this, because there isn't any core-activity yet using external activity icons. 0) Install/upgrade/use moodle from integration.git 1) Go to course with some forums and some other activities. 2) TEST: Verify that icons are shown properly in the course page. 3) Edit mod/forum/lib.php and create this function function forum_get_coursemodule_info($coursemodule) {   $info = new cached_cm_info(); $info->iconurl = new moodle_url('http://www.euroblind.org/skin/basic/design/braille/i/' . ($coursemodule->id % 10) . '.gif'); return $info; } (that will enable the forum module to use the new feature, picking some "mod-based" images from outside) 4) Reload the course page, you should not see any modification (because modinfo is cached). 5) Edit any forum, and click "save and go to course page". 6) TEST: VoilĂ , you should see the forum icons changed to some braille-icons. 7) TEST: The rest of activities continue showing their default icons. 8) Delete the code introduced by 3) 9) Reload the course page, you should continue viewing the braille icons (because modinfo is cached). 10) Edit any forum, and click "save and go to course page". 11) TEST: Back to normal, forums showing their default icons again. That is, ciao

      This is a new feature introduced to fulfill the need of some modules (usually calling to external stuff) to use activity icons stored out from moodle codebase.

      Its primary target is to be used in the new ims-lti module though could be extended, once available to other new modules (current core ones should not need it at all).

      So this can be considered related with MDL-20534 and aimed to solve the points A6/B3 @ http://docs.moodle.org/dev/IMS-LTI_consumer_module_review_2011-11

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Sam Hemelryk Sam Hemelryk
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.