Skip to content

Commit

Permalink
Merge branch 'MDL-59277-master' of https://github.com/snake/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Sep 19, 2017
2 parents 00b7632 + 5d0cc05 commit 708100c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/navigationlib.php
Expand Up @@ -134,7 +134,9 @@ class navigation_node implements renderable {
/** @var bool Set to true if we KNOW that this node can be expanded. */
public $isexpandable = false;
/** @var array */
protected $namedtypes = array(0=>'system',10=>'category',20=>'course',30=>'structure',40=>'activity',50=>'resource',60=>'custom',70=>'setting',71=>'siteadmin', 80=>'user');
protected $namedtypes = array(0 => 'system', 10 => 'category', 20 => 'course', 30 => 'structure', 40 => 'activity',
50 => 'resource', 60 => 'custom', 70 => 'setting', 71 => 'siteadmin', 80 => 'user',
90 => 'container');
/** @var moodle_url */
protected static $fullmeurl = null;
/** @var bool toogles auto matching of active node */
Expand Down
3 changes: 3 additions & 0 deletions lib/tests/navigationlib_test.php
Expand Up @@ -56,6 +56,7 @@ protected function setup_node() {
$demo4 = $demo3->add('demo4', $inactiveurl, navigation_node::TYPE_COURSE, null, 'demo4', new pix_icon('i/course', ''));
$demo5 = $demo3->add('demo5', $activeurl, navigation_node::TYPE_COURSE, null, 'demo5', new pix_icon('i/course', ''));
$demo5->add('activity1', null, navigation_node::TYPE_ACTIVITY, null, 'activity1')->make_active();
$demo6 = $demo3->add('demo6', null, navigation_node::TYPE_CONTAINER, 'container node test', 'demo6');
$hiddendemo1 = $this->node->add('hiddendemo1', $inactiveurl, navigation_node::TYPE_CATEGORY, null, 'hiddendemo1', new pix_icon('i/course', ''));
$hiddendemo1->hidden = true;
$hiddendemo1->add('hiddendemo2', $inactiveurl, navigation_node::TYPE_COURSE, null, 'hiddendemo2', new pix_icon('i/course', ''))->helpbutton = 'Here is a help button';
Expand Down Expand Up @@ -239,9 +240,11 @@ public function test_node_get_css_type() {
$csstype2 = $this->node->get('demo3')->get('demo5')->get_css_type();
$this->node->get('demo3')->get('demo5')->type = 1000;
$csstype3 = $this->node->get('demo3')->get('demo5')->get_css_type();
$csstype4 = $this->node->get('demo3')->get('demo6')->get_css_type();
$this->assertSame('type_category', $csstype1);
$this->assertSame('type_course', $csstype2);
$this->assertSame('type_unknown', $csstype3);
$this->assertSame('type_container', $csstype4);
}

public function test_node_make_active() {
Expand Down

0 comments on commit 708100c

Please sign in to comment.