Merge branch 'MDL-59277-master' of https://github.com/snake/moodle

This commit is contained in:
Dan Poltawski
2017-09-19 09:48:30 +01:00
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -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 */
+3
View File
@@ -56,6 +56,7 @@ class core_navigationlib_testcase extends advanced_testcase {
$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';
@@ -239,9 +240,11 @@ class core_navigationlib_testcase extends advanced_testcase {
$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() {