From 611684a8ec703579a85dd547aa1489ab4a2b8c12 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Thu, 14 Apr 2011 17:28:53 +0100 Subject: [PATCH] MDL-27198 Accessibility: For labels, completion/editing icons must appear after content --- course/lib.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/course/lib.php b/course/lib.php index 10fd77ded29..fa948b1d6b0 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1637,6 +1637,16 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, // Module can put text after the link (e.g. forum unread) echo $mod->get_after_link(); + // If there is content but NO link (eg label), then display the + // content here (BEFORE any icons). In this case cons must be + // displayed after the content so that it makes more sense visually + // and for accessibility reasons, e.g. if you have a one-line label + // it should work similarly (at least in terms of ordering) to an + // activity. + if (empty($url)) { + echo $contentpart; + } + if ($isediting) { if ($groupbuttons and plugin_supports('mod', $mod->modname, FEATURE_GROUPS, 0)) { if (! $mod->groupmodelink = $groupbuttonslink) { @@ -1721,8 +1731,11 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, } } - // Display the content (if any) at this part of the html - echo $contentpart; + // If there is content AND a link, then display the content here + // (AFTER any icons). Otherwise it was displayed before + if (!empty($url)) { + echo $contentpart; + } // Show availability information (for someone who isn't allowed to // see the activity itself, or for staff)