MDL-38631 link categories in My courses only when needed

This commit is contained in:
Marina Glancy
2013-06-22 16:21:30 +10:00
parent 073a972375
commit 2c8e21ac35
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -105,7 +105,9 @@ class block_navigation_renderer extends plugin_renderer_base {
if ($item->hidden) {
$attributes['class'] = 'dimmed_text';
}
if (is_string($item->action) || empty($item->action) || ($item->type === navigation_node::TYPE_CATEGORY && empty($options['linkcategories']))) {
if (is_string($item->action) || empty($item->action) ||
(($item->type === navigation_node::TYPE_CATEGORY || $item->type === navigation_node::TYPE_MY_CATEGORY) &&
empty($options['linkcategories']))) {
$attributes['tabindex'] = '0'; //add tab support to span but still maintain character stream sequence.
$content = html_writer::tag('span', $content, $attributes);
} else if ($item->action instanceof action_link) {
+3
View File
@@ -103,6 +103,9 @@ try {
foreach ($branch->find_all_of_type(navigation_node::TYPE_CATEGORY) as $category) {
$category->action = null;
}
foreach ($branch->find_all_of_type(navigation_node::TYPE_MY_CATEGORY) as $category) {
$category->action = null;
}
}
// Stop buffering errors at this point