Skip to content

Commit

Permalink
MDL-21619 - add label to activities and resources icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwijaya committed Jul 23, 2010
1 parent bd536f5 commit 3aa11c7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,

echo '<a '.$linkcss.' '.$extra.
' href="'.$CFG->wwwroot.'/mod/'.$mod->modname.'/view.php?id='.$mod->id.'">'.
'<img src="'.$icon.'" class="activityicon" alt="" /> '.
'<img src="'.$icon.'" class="activityicon" alt="'.get_string('modulename',$mod->modname).'" /> '.
$accesstext.'<span>'.$instancename.$altname.'</span></a>';

if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
Expand All @@ -1448,7 +1448,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
// Display greyed-out text of link
echo '<span class="dimmed_text" '.$extra.' ><span class="accesshide">'.
get_string('notavailableyet','condition').': </span>'.
'<img src="'.$icon.'" class="activityicon" alt="" /> <span>'.
'<img src="'.$icon.'" class="activityicon" alt="'.get_string('modulename', $mod->modname).'" /> <span>'.
$instancename.$altname.'</span></span>';
}
}
Expand Down
4 changes: 2 additions & 2 deletions course/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@

$extra = empty($cm->extra) ? '' : $cm->extra;
if (!empty($cm->icon)) {
$icon = '<img src="'.$OUTPUT->pix_url($cm->icon).'" class="activityicon" alt="" /> ';
$icon = '<img src="'.$OUTPUT->pix_url($cm->icon).'" class="activityicon" alt="'.get_string('modulename', $cm->modname).'" /> ';
} else {
$icon = '<img src="'.$OUTPUT->pix_url('icon', $cm->modname).'" class="activityicon" alt="" /> ';
$icon = '<img src="'.$OUTPUT->pix_url('icon', $cm->modname).'" class="activityicon" alt="'.get_string('modulename', $cm->modname).'" /> ';
}

$class = $cm->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
Expand Down
4 changes: 2 additions & 2 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1367,9 +1367,9 @@ protected function load_section_activities(navigation_node $sectionnode, $sectio
continue;
}
if ($cm->icon) {
$icon = new pix_icon($cm->icon, '', $cm->iconcomponent);
$icon = new pix_icon($cm->icon, get_string('modulename', $cm->modname), $cm->iconcomponent);
} else {
$icon = new pix_icon('icon', '', $cm->modname);
$icon = new pix_icon('icon', get_string('modulename', $cm->modname), $cm->modname);
}
$url = new moodle_url('/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id));
$activitynode = $sectionnode->add($cm->name, $url, navigation_node::TYPE_ACTIVITY, $cm->name, $cm->id, $icon);
Expand Down
2 changes: 1 addition & 1 deletion mod/resource/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
$icon = '';
if (!empty($cm->icon)) {
// each resource file has an icon in 2.0
$icon = '<img src="'.$OUTPUT->pix_url($cm->icon).'" class="activityicon" alt="" /> ';
$icon = '<img src="'.$OUTPUT->pix_url($cm->icon).'" class="activityicon" alt="'.get_string('modulename', $cm->modname).'" /> ';
}

$class = $resource->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
Expand Down
2 changes: 1 addition & 1 deletion mod/url/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
$icon = '';
if (!empty($cm->icon)) {
// each url has an icon in 2.0
$icon = '<img src="'.$OUTPUT->pix_url($cm->icon).'" class="activityicon" alt="" /> ';
$icon = '<img src="'.$OUTPUT->pix_url($cm->icon).'" class="activityicon" alt="'.get_string('modulename', $cm->modname).'" /> ';
}

$class = $url->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
Expand Down

0 comments on commit 3aa11c7

Please sign in to comment.