Skip to content

Commit

Permalink
Merge branch 'MDL-31976-23' of git://github.com/FMCorz/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_23_STABLE
  • Loading branch information
Sam Hemelryk committed Sep 25, 2012
2 parents 2d39f72 + 05daea0 commit 4c69620
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 27 deletions.
3 changes: 2 additions & 1 deletion course/format/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ protected function section_header($section, $course, $onsectionpage, $sectionret
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
$url = new moodle_url('/course/editsection.php', array('id'=>$section->id, 'sr'=>$sectionreturn));
$o.= html_writer::link($url,
html_writer::empty_tag('img', array('src' => $this->output->pix_url('t/edit'), 'class' => 'iconsmall edit')),
html_writer::empty_tag('img', array('src' => $this->output->pix_url('t/edit'),
'class' => 'iconsmall edit', 'alt' => get_string('editsummary'))),
array('title' => get_string('editsummary')));
}
$o.= html_writer::end_tag('div');
Expand Down
33 changes: 15 additions & 18 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1572,8 +1572,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
// Display link itself
echo '<a ' . $linkcss . $mod->extra . $onclick .
' href="' . $url . '"><img src="' . $mod->get_icon_url() .
'" class="activityicon" alt="' .
$modulename . '" /> ' .
'" class="activityicon" alt="" /> ' .
$accesstext . '<span class="instancename">' .
$instancename . $altname . '</span></a>';

Expand Down Expand Up @@ -1608,9 +1607,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
// Display greyed-out text of link
echo '<div ' . $textcss . $mod->extra .
' >' . '<img src="' . $mod->get_icon_url() .
'" class="activityicon" alt="' .
$modulename .
'" /> <span>'. $instancename . $altname .
'" class="activityicon" alt="" /> <span>'. $instancename . $altname .
'</span></div>';

// Do not display content after link when it is greyed out like this.
Expand Down Expand Up @@ -3204,7 +3201,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if ($mod->modname !== 'label' && $hasmanageactivities && course_ajax_enabled($COURSE)) {
$actions[] = new action_link(
new moodle_url($baseurl, array('update' => $mod->id)),
new pix_icon('t/editstring', $str->edittitle, 'moodle', array('class' => 'iconsmall visibleifjs')),
new pix_icon('t/editstring', $str->edittitle, 'moodle', array('class' => 'iconsmall visibleifjs', 'title' => '')),
null,
array('class' => 'editing_title', 'title' => $str->edittitle)
);
Expand All @@ -3223,15 +3220,15 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if ($indent > 0) {
$actions[] = new action_link(
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '-1')),
new pix_icon($leftarrow, $str->moveleft, 'moodle', array('class' => 'iconsmall')),
new pix_icon($leftarrow, $str->moveleft, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_moveleft', 'title' => $str->moveleft)
);
}
if ($indent >= 0) {
$actions[] = new action_link(
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '1')),
new pix_icon($rightarrow, $str->moveright, 'moodle', array('class' => 'iconsmall')),
new pix_icon($rightarrow, $str->moveright, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_moveright', 'title' => $str->moveright)
);
Expand All @@ -3243,20 +3240,20 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if ($moveselect) {
$actions[] = new action_link(
new moodle_url($baseurl, array('copy' => $mod->id)),
new pix_icon('t/move', $str->move, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/move', $str->move, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_move', 'title' => $str->move)
);
} else {
$actions[] = new action_link(
new moodle_url($baseurl, array('id' => $mod->id, 'move' => '-1')),
new pix_icon('t/up', $str->moveup, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/up', $str->moveup, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_moveup', 'title' => $str->moveup)
);
$actions[] = new action_link(
new moodle_url($baseurl, array('id' => $mod->id, 'move' => '1')),
new pix_icon('t/down', $str->movedown, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/down', $str->movedown, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_movedown', 'title' => $str->movedown)
);
Expand All @@ -3267,7 +3264,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if ($hasmanageactivities) {
$actions[] = new action_link(
new moodle_url($baseurl, array('update' => $mod->id)),
new pix_icon('t/edit', $str->update, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/edit', $str->update, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_update', 'title' => $str->update)
);
Expand All @@ -3277,7 +3274,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if (has_all_capabilities($dupecaps, $coursecontext) && plugin_supports('mod', $mod->modname, FEATURE_BACKUP_MOODLE2)) {
$actions[] = new action_link(
new moodle_url($baseurl, array('duplicate' => $mod->id)),
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/copy', $str->duplicate, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_duplicate', 'title' => $str->duplicate)
);
Expand All @@ -3287,7 +3284,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if ($hasmanageactivities) {
$actions[] = new action_link(
new moodle_url($baseurl, array('delete' => $mod->id)),
new pix_icon('t/delete', $str->delete, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/delete', $str->delete, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_delete', 'title' => $str->delete)
);
Expand All @@ -3298,14 +3295,14 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if ($mod->visible) {
$actions[] = new action_link(
new moodle_url($baseurl, array('hide' => $mod->id)),
new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_hide', 'title' => $str->hide)
);
} else {
$actions[] = new action_link(
new moodle_url($baseurl, array('show' => $mod->id)),
new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall')),
new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_show', 'title' => $str->show)
);
Expand Down Expand Up @@ -3336,7 +3333,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if ($mod->groupmodelink) {
$actions[] = new action_link(
new moodle_url($baseurl, array('id' => $mod->id, 'groupmode' => $groupmode)),
new pix_icon($groupimage, $grouptitle, 'moodle', array('class' => 'iconsmall')),
new pix_icon($groupimage, $grouptitle, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => $groupclass, 'title' => $grouptitle)
);
Expand All @@ -3349,7 +3346,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele
if (has_capability('moodle/role:assign', $modcontext)){
$actions[] = new action_link(
new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid' => $modcontext->id)),
new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall')),
new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall', 'title' => '')),
null,
array('class' => 'editing_assign', 'title' => $str->assign)
);
Expand Down
6 changes: 0 additions & 6 deletions course/yui/toolboxes/toolboxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
var newstring = M.util.get_string(status, 'moodle');
hideicon.setAttrs({
'alt' : newstring,
'title' : newstring,
'src' : M.util.image_url('t/' + status)
});
button.set('title', newstring);
Expand Down Expand Up @@ -424,7 +423,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
// Change the UI
icon.setAttrs({
'alt' : newtitle,
'title' : newtitle,
'src' : iconsrc
});
button.setAttribute('title', newtitle);
Expand Down Expand Up @@ -452,7 +450,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
.addClass(CSS.GENERICICONCLASS)
.setAttrs({
'src' : M.util.image_url('t/left', 'moodle'),
'title' : left_string,
'alt' : left_string
});
var moveright = target.one(CSS.MOVERIGHT);
Expand Down Expand Up @@ -663,7 +660,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
var newstring = M.util.get_string(status + 'fromothers', 'format_' + this.get('format'));
hideicon.setAttrs({
'alt' : newstring,
'title' : newstring,
'src' : M.util.image_url('i/' + status)
});
button.set('title', newstring);
Expand Down Expand Up @@ -721,7 +717,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
.set('title', old_string);
Y.one(CSS.PAGECONTENT)
.all(M.course.format.get_section_selector(Y) + '.current ' + CSS.HIGHLIGHT + ' img')
.set('title', old_string)
.set('alt', old_string)
.set('src', M.util.image_url('i/marker'));

Expand All @@ -737,7 +732,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
button
.set('title', new_string);
buttonicon
.set('title', new_string)
.set('alt', new_string)
.set('src', M.util.image_url('i/marked'));
}
Expand Down
4 changes: 4 additions & 0 deletions lib/outputcomponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ public function __construct($pix, $alt, $component='moodle', array $attributes =
}
if (!isset($this->attributes['title'])) {
$this->attributes['title'] = $this->attributes['alt'];
} else if (empty($this->attributes['title'])) {
// Remove the title attribute if empty, we probably want to use the parent node's title
// and some browsers might overwrite it with an empty title.
unset($this->attributes['title']);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions lib/yui/dragdrop/dragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ YUI.add('moodle-core-dragdrop', function(Y) {
.setStyle('cursor', 'move')
.setAttrs({
'src' : M.util.image_url(MOVEICON.pix, MOVEICON.component),
'alt' : title,
'title' : M.str.moodle.move
'alt' : title
});
if (iconclass) {
dragicon.addClass(iconclass);
Expand Down

0 comments on commit 4c69620

Please sign in to comment.