Skip to content

Commit

Permalink
MDL-38631 link categories in My courses only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Jun 22, 2013
1 parent 073a972 commit 2c8e21a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/navigation/renderer.php
Expand Up @@ -105,7 +105,9 @@ protected function navigation_node($items, $attrs=array(), $expansionlimit=null,
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) {
Expand Down
3 changes: 3 additions & 0 deletions lib/ajax/getnavbranch.php
Expand Up @@ -103,6 +103,9 @@
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
Expand Down

0 comments on commit 2c8e21a

Please sign in to comment.