mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-33017 navigation: added current course and simplified loading
This commit is contained in:
parent
6caf3f5c74
commit
58b602da8e
3 changed files with 195 additions and 222 deletions
14
blocks/navigation/yui/navigation/navigation.js
vendored
14
blocks/navigation/yui/navigation/navigation.js
vendored
|
@ -425,7 +425,7 @@ BRANCH.prototype = {
|
|||
this.addChild(object.children[i]);
|
||||
}
|
||||
}
|
||||
if (this.get('type') == 10 && coursecount >= M.block_navigation.courselimit) {
|
||||
if ((this.get('type') == 10 || this.get('type') == 0) && coursecount >= M.block_navigation.courselimit) {
|
||||
this.addViewAllCoursesChild(this);
|
||||
}
|
||||
this.get('tree').toggleExpansion({target:this.node});
|
||||
|
@ -468,10 +468,20 @@ BRANCH.prototype = {
|
|||
* Add a link to view all courses in a category
|
||||
*/
|
||||
addViewAllCoursesChild: function(branch) {
|
||||
var url = null;
|
||||
if (branch.get('type') == 0 ) {
|
||||
if (branch.get('key') == 'mycourses') {
|
||||
url = M.cfg.wwwroot+'/my';
|
||||
} else {
|
||||
url = M.cfg.wwwroot+'/course/index.php';
|
||||
}
|
||||
} else {
|
||||
url = M.cfg.wwwroot+'/course/category.php?id='+branch.get('key');
|
||||
}
|
||||
branch.addChild({
|
||||
name : M.str.moodle.viewallcourses,
|
||||
title : M.str.moodle.viewallcourses,
|
||||
link : M.cfg.wwwroot+'/course/category.php?id='+branch.get('key'),
|
||||
link : url,
|
||||
haschildren : false,
|
||||
icon : {'pix':"i/navigationitem",'component':'moodle'}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue