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

icons from block_list do not show up next to text

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Blocks
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Icons for block_list blocks do not show up next to the items when using the items and icons array

              $this->content->items = array();
              $this->content->icons = array();

      It seems that the core blocks all simpy appened their icon to the text of the item
      rather than using the icon array. Which is why it looks fine for any block that doesn't
      use the icons array.

      Example the course_list block leaves the icon field empty

              $this->content = new stdClass;
              $this->content->items = array();
              $this->content->icons = array();
              $this->content->footer = '';

      The icon array is left empty and the icon is appeneded to the item itself.

                              $this->content->items[]="<a $linkcss title=\""
                                         . format_string($course->shortname)."\" ".
                                         "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">"
                                         .$icon. format_string($course->fullname) . "</a>";

      So although course_list shows up normally any block that seperates out the
      icons from the items will have it's icons above the items and not next to.

      block_activity_modules does this as well

                      $icon = '<img src="'.$OUTPUT->pix_url('icon', $modname) . '" class="icon" alt="" />&nbsp;';
                      $this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$course->id.'">'.$icon.$modfullname.'</a>';

        Attachments

          Activity

            People

            • Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              chrisstones Chris B Stones
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10