Merge branch 'wip-MDL-38593-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Dan Poltawski
2013-04-09 11:46:27 +08:00
12 changed files with 89 additions and 123 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ class block_course_list extends block_list {
foreach ($categories as $category) {
$categoryname = $category->get_formatted_name();
$linkcss = $category->visible ? "" : " class=\"dimmed\" ";
$this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/category.php?id=$category->id\">".$icon . $categoryname . "</a>";
$this->content->items[]="<a $linkcss href=\"$CFG->wwwroot/course/index.php?categoryid=$category->id\">".$icon . $categoryname . "</a>";
}
/// If we can update any course of the view all isn't hidden, show the view all courses link
if (has_capability('moodle/course:update', context_system::instance()) || empty($CFG->block_course_list_hideallcourseslink)) {
+1 -1
View File
@@ -527,7 +527,7 @@ BRANCH.prototype = {
url = M.cfg.wwwroot + '/course/index.php';
}
} else {
url = M.cfg.wwwroot+'/course/category.php?id=' + branch.get('key');
url = M.cfg.wwwroot+'/course/index.php?categoryid=' + branch.get('key');
}
branch.addChild({
name : M.str.moodle.viewallcourses,
+3 -48
View File
@@ -24,54 +24,9 @@
*/
require_once("../config.php");
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/textlib.class.php');
require_once($CFG->libdir. '/coursecatlib.php');
$id = required_param('id', PARAM_INT); // Category id
$page = optional_param('page', 0, PARAM_INT); // which page to show
$categoryid = required_param('id', PARAM_INT); // Category id
$perpage = optional_param('perpage', $CFG->coursesperpage, PARAM_INT); // how many per page
debugging('Please use URL /course/index.php?categoryid=XXX instead of /course/category.php?id=XXX', DEBUG_DEVELOPER);
if (empty($id)) {
print_error("unknowcategory");
}
$PAGE->set_category_by_id($id);
$PAGE->set_url(new moodle_url('/course/category.php', array('id' => $id)));
// This is sure to be the category context
$context = $PAGE->context;
// And the object has been loaded for us no need for another DB call
$category = $PAGE->category;
if ($CFG->forcelogin) {
require_login();
}
if (!$category->visible) {
require_capability('moodle/category:viewhiddencategories', $context);
}
// Prepare the standard URL params for this page. We'll need them later.
$urlparams = array('id' => $id);
if ($page) {
$urlparams['page'] = $page;
}
if ($perpage) {
$urlparams['perpage'] = $perpage;
}
// Begin output
$PAGE->set_pagelayout('coursecategory');
$courserenderer = $PAGE->get_renderer('core', 'course');
$site = get_site();
$PAGE->set_title("$site->shortname: $category->name");
$PAGE->set_heading($site->fullname);
$content = $courserenderer->course_category($id);
echo $OUTPUT->header();
echo $content;
echo $OUTPUT->footer();
redirect(new moodle_url('/course/index.php', array('categoryid' => $categoryid)));
+3 -3
View File
@@ -37,7 +37,7 @@
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php/'));
$PAGE->navbar->add($strcategories, new moodle_url('/course/index.php'));
$PAGE->navbar->add($categoryname, new moodle_url('/course/category.php', array('id'=>$course->category)));
$PAGE->navbar->add($categoryname, new moodle_url('/course/index.php', array('categoryid' => $course->category)));
if (! $delete) {
$strdeletecheck = get_string("deletecheck", "", $courseshortname);
$strdeletecoursecheck = get_string("deletecoursecheck");
@@ -49,7 +49,7 @@
$message = "$strdeletecoursecheck<br /><br />" . format_string($course->fullname, true, array('context' => $coursecontext)) . " (" . $courseshortname . ")";
echo $OUTPUT->confirm($message, "delete.php?id=$course->id&delete=".md5($course->timemodified), "manage.php?id=$course->category");
echo $OUTPUT->confirm($message, "delete.php?id=$course->id&delete=".md5($course->timemodified), "manage.php?categoryid=$course->category");
echo $OUTPUT->footer();
exit;
@@ -80,7 +80,7 @@
echo $OUTPUT->heading( get_string("deletedcourse", "", $courseshortname) );
echo $OUTPUT->continue_button("manage.php?id=$course->category");
echo $OUTPUT->continue_button("manage.php?categoryid=$course->category");
echo $OUTPUT->footer();
+2 -2
View File
@@ -95,10 +95,10 @@ $editform = new course_edit_form(NULL, array('course'=>$course, 'category'=>$cat
if ($editform->is_cancelled()) {
switch ($returnto) {
case 'category':
$url = new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$categoryid));
$url = new moodle_url($CFG->wwwroot.'/course/index.php', array('categoryid' => $categoryid));
break;
case 'catmanage':
$url = new moodle_url($CFG->wwwroot.'/course/manage.php', array('id'=>$categoryid));
$url = new moodle_url($CFG->wwwroot.'/course/manage.php', array('categoryid' => $categoryid));
break;
case 'topcatmanage':
$url = new moodle_url($CFG->wwwroot.'/course/manage.php');
+3 -3
View File
@@ -86,9 +86,9 @@ $mform->set_data($category);
if ($mform->is_cancelled()) {
if ($id) {
redirect($CFG->wwwroot . '/course/manage.php?id=' . $id);
redirect($CFG->wwwroot . '/course/manage.php?categoryid=' . $id);
} else if ($parent) {
redirect($CFG->wwwroot .'/course/manage.php?id=' . $parent);
redirect($CFG->wwwroot .'/course/manage.php?categoryid=' . $parent);
} else {
redirect($CFG->wwwroot .'/course/manage.php');
}
@@ -103,7 +103,7 @@ if ($mform->is_cancelled()) {
$newcategory = coursecat::create($data, $editoroptions);
}
redirect('manage.php?id='.$newcategory->id);
redirect('manage.php?categoryid='.$newcategory->id);
}
// Page "Add new category" (with "Top" as a parent) does not exist in navigation.
+19 -12
View File
@@ -24,29 +24,36 @@
*/
require_once("../config.php");
require_once("lib.php");
require_once($CFG->dirroot. '/course/lib.php');
require_once($CFG->libdir. '/coursecatlib.php');
$categoryid = optional_param('categoryid', 0, PARAM_INT); // Category id
$site = get_site();
$systemcontext = context_system::instance();
if ($categoryid) {
$PAGE->set_category_by_id($categoryid);
$PAGE->set_url(new moodle_url('/course/index.php', array('categoryid' => $categoryid)));
// And the object has been loaded for us no need for another DB call
$category = $PAGE->category;
} else {
$categoryid = 0;
$PAGE->set_url('/course/index.php');
$PAGE->set_context(context_system::instance());
}
$PAGE->set_url('/course/index.php');
$PAGE->set_context($systemcontext);
$PAGE->set_pagelayout('admin');
$PAGE->set_pagelayout('coursecategory');
$courserenderer = $PAGE->get_renderer('core', 'course');
if ($CFG->forcelogin) {
require_login();
}
$countcategories = $DB->count_records('course_categories');
if (can_edit_in_category()) {
$managebutton = $OUTPUT->single_button(new moodle_url('/course/manage.php'),
get_string('managecourses'), 'get');
$PAGE->set_button($managebutton);
if ($categoryid && !$category->visible && !has_capability('moodle/category:viewhiddencategories', $PAGE->context)) {
throw new moodle_exception('unknowncategory');
}
$PAGE->set_heading($COURSE->fullname);
$content = $courserenderer->course_category(0);
$PAGE->set_heading($site->fullname);
$content = $courserenderer->course_category($categoryid);
echo $OUTPUT->header();
echo $OUTPUT->skip_link_target();
+13 -13
View File
@@ -27,7 +27,7 @@ require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->libdir.'/coursecatlib.php');
// Category id.
$id = optional_param('id', 0, PARAM_INT);
$id = optional_param('categoryid', 0, PARAM_INT);
// Which page to show.
$page = optional_param('page', 0, PARAM_INT);
// How many per page.
@@ -71,11 +71,11 @@ $coursecat = coursecat::get($id);
if ($id) {
$PAGE->set_category_by_id($id);
$PAGE->set_url(new moodle_url('/course/manage.php', array('id' => $id)));
$PAGE->set_url(new moodle_url('/course/manage.php', array('categoryid' => $id)));
// This is sure to be the category context.
$context = $PAGE->context;
if (!can_edit_in_category($coursecat->id)) {
redirect(new moodle_url('/course/category.php', array('id' => $coursecat->id)));
redirect(new moodle_url('/course/index.php', array('categoryid' => $coursecat->id)));
}
} else {
$context = context_system::instance();
@@ -281,7 +281,7 @@ if ((!empty($moveup) or !empty($movedown)) && confirm_sesskey()) {
}
// Prepare the standard URL params for this page. We'll need them later.
$urlparams = array('id' => $id);
$urlparams = array('categoryid' => $id);
if ($page) {
$urlparams['page'] = $page;
}
@@ -298,7 +298,7 @@ if (can_edit_in_category()) {
// otherwise the admin block does not appear to this user, and you get an error.
require_once($CFG->libdir . '/adminlib.php');
if ($id) {
navigation_node::override_active_url(new moodle_url('/course/category.php', array('id' => $id)));
navigation_node::override_active_url(new moodle_url('/course/index.php', array('categoryid' => $id)));
}
admin_externalpage_setup('coursemgmt', '', $urlparams, $CFG->wwwroot . '/course/manage.php');
$settingsnode = $PAGE->settingsnav->find_active_node();
@@ -345,7 +345,7 @@ if (!empty($searchcriteria)) {
echo html_writer::table($table);
} else {
// Print the category selector.
$select = new single_select(new moodle_url('/course/manage.php'), 'id', $displaylist, $coursecat->id, null, 'switchcategory');
$select = new single_select(new moodle_url('/course/manage.php'), 'categoryid', $displaylist, $coursecat->id, null, 'switchcategory');
$select->set_label(get_string('categories').':');
echo html_writer::start_tag('div', array('class' => 'categorypicker'));
@@ -416,7 +416,7 @@ if (!empty($searchcriteria)) {
$attributes = $subcategory->visible ? array() : array('class' => 'dimmed');
$text = format_string($subcategory->name, true, array('context' => $context));
// Add the subcategory to the table.
$baseurl->param('id', $subcategory->id);
$baseurl->param('categoryid', $subcategory->id);
$table->data[] = array(html_writer::link($baseurl, $text, $attributes));
}
@@ -567,8 +567,8 @@ if (!$courses) {
$cell->colspan = 3;
$cell->attributes['class'] = 'mdl-right';
$cell->text = html_writer::label(get_string('moveselectedcoursesto'), 'movetoid', false, array('class' => 'accesshide'));
$cell->text .= html_writer::select($movetocategories, 'moveto', $id, null, array('id'=>'movetoid', 'class' => 'autosubmit'));
$cell->text .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'id', 'value' => $id));
$cell->text .= html_writer::select($movetocategories, 'moveto', $id, null, array('id' => 'movetoid', 'class' => 'autosubmit'));
$cell->text .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'categoryid', 'value' => $id));
$PAGE->requires->yui_module('moodle-core-formautosubmit',
'M.core.init_formautosubmit',
array(array('selectid' => 'movetoid', 'nothing' => $id))
@@ -577,7 +577,7 @@ if (!$courses) {
}
$actionurl = new moodle_url('/course/manage.php');
$pagingurl = new moodle_url('/course/manage.php', array('id' => $id, 'perpage' => $perpage) + $searchcriteria);
$pagingurl = new moodle_url('/course/manage.php', array('categoryid' => $id, 'perpage' => $perpage) + $searchcriteria);
echo $OUTPUT->paging_bar($totalcount, $page, $perpage, $pagingurl);
echo html_writer::start_tag('form', array('id' => 'movecourses', 'action' => $actionurl, 'method' => 'post'));
@@ -595,7 +595,7 @@ if (!$courses) {
echo html_writer::start_tag('div', array('class' => 'buttons'));
if ($canmanage and $numcourses > 1 && empty($searchcriteria)) {
// Print button to re-sort courses by name.
$url = new moodle_url('/course/manage.php', array('id' => $id, 'resort' => 'name', 'sesskey' => sesskey()));
$url = new moodle_url('/course/manage.php', array('categoryid' => $id, 'resort' => 'name', 'sesskey' => sesskey()));
echo $OUTPUT->single_button($url, get_string('resortcoursesbyname'), 'get');
}
@@ -653,7 +653,7 @@ function print_category_edit(html_table $table, coursecat $category, $depth = -1
$attributes = array();
$attributes['class'] = $category->visible ? '' : 'dimmed';
$attributes['title'] = $str->edit;
$categoryurl = new moodle_url('/course/manage.php', array('id' => $category->id, 'sesskey' => sesskey()));
$categoryurl = new moodle_url('/course/manage.php', array('categoryid' => $category->id, 'sesskey' => sesskey()));
$categoryname = $category->get_formatted_name();
$categorypadding = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $depth);
$categoryname = $categorypadding . html_writer::link($categoryurl, $categoryname, $attributes);
@@ -717,7 +717,7 @@ function print_category_edit(html_table $table, coursecat $category, $depth = -1
$actions = '';
if (has_capability('moodle/category:manage', $categorycontext)) {
$popupurl = new moodle_url("manage.php?movecat=$category->id&sesskey=".sesskey());
$popupurl = new moodle_url('/course/manage.php', array('movecat' => $category->id, 'sesskey' => sesskey()));
$tempdisplaylist = array(0 => get_string('top')) + coursecat::make_categories_list('moodle/category:manage', $category->id);
$select = new single_select($popupurl, 'movetocat', $tempdisplaylist, $category->parent, null, "moveform$category->id");
$select->set_label(get_string('frontpagecategorynames'), array('class' => 'accesshide'));
+39 -35
View File
@@ -1161,7 +1161,7 @@ class core_course_renderer extends plugin_renderer_base {
&& ($cat = coursecat::get($course->category, IGNORE_MISSING))) {
$content .= html_writer::start_tag('div', array('class' => 'coursecat'));
$content .= get_string('category').': '.
html_writer::link(new moodle_url('/course/category.php', array('id' => $cat->id)),
html_writer::link(new moodle_url('/course/index.php', array('categoryid' => $cat->id)),
$cat->get_formatted_name(), array('class' => $cat->visible ? '' : 'dimmed'));
$content .= html_writer::end_tag('div'); // .coursecat
}
@@ -1300,12 +1300,8 @@ class core_course_renderer extends plugin_renderer_base {
}
} else if ($viewmoreurl = $chelper->get_categories_display_option('viewmoreurl')) {
// the option 'viewmoreurl' was specified, display more link (if it is link to category view page, add category id)
if ($viewmoreurl->compare(new moodle_url('/course/category.php'), URL_MATCH_BASE)) {
if ($coursecat->id) {
$viewmoreurl->param('id', $coursecat->id);
} else {
$viewmoreurl = new moodle_url('/course/index.php', $viewmoreurl->params());
}
if ($viewmoreurl->compare(new moodle_url('/course/index.php'), URL_MATCH_BASE)) {
$viewmoreurl->param('categoryid', $coursecat->id);
}
$viewmoretext = $chelper->get_categories_display_option('viewmoretext', new lang_string('viewmore'));
$morelink = html_writer::tag('div', html_writer::link($viewmoreurl, $viewmoretext),
@@ -1367,8 +1363,8 @@ class core_course_renderer extends plugin_renderer_base {
$courses = $coursecat->get_courses($chelper->get_courses_display_options());
if ($viewmoreurl = $chelper->get_courses_display_option('viewmoreurl')) {
// the option for 'View more' link was specified, display more link (if it is link to category view page, add category id)
if ($viewmoreurl->compare(new moodle_url('/course/category.php'), URL_MATCH_BASE)) {
$chelper->set_courses_display_option('viewmoreurl', new moodle_url($viewmoreurl, array('id' => $coursecat->id)));
if ($viewmoreurl->compare(new moodle_url('/course/index.php'), URL_MATCH_BASE)) {
$chelper->set_courses_display_option('viewmoreurl', new moodle_url($viewmoreurl, array('categoryid' => $coursecat->id)));
}
}
$content .= $this->coursecat_courses($chelper, $courses, $coursecat->get_courses_count());
@@ -1422,8 +1418,8 @@ class core_course_renderer extends plugin_renderer_base {
// category name
$categoryname = $coursecat->get_formatted_name();
$categoryname = html_writer::link(new moodle_url('/course/category.php',
array('id' => $coursecat->id)),
$categoryname = html_writer::link(new moodle_url('/course/index.php',
array('categoryid' => $coursecat->id)),
$categoryname);
if ($chelper->get_show_courses() == self::COURSECAT_SHOW_COURSES_COUNT
&& ($coursescount = $coursecat->get_courses_count())) {
@@ -1498,21 +1494,29 @@ class core_course_renderer extends plugin_renderer_base {
$site = get_site();
$output = '';
if (!$coursecat->id && coursecat::count_all() == 1) {
// There exists only one category in the system, do not display link to it
$coursecat = coursecat::get_default();
$strfulllistofcourses = get_string('fulllistofcourses');
$this->page->set_title("$site->shortname: $strfulllistofcourses");
} else if (!$coursecat->id) {
$strcategories = get_string('categories');
$this->page->set_title("$site->shortname: $strcategories");
$this->page->set_button($this->course_search_form('', 'navbar'));
if (!$coursecat->id) {
if (can_edit_in_category()) {
// add 'Manage' button instead of course search form
$managebutton = $this->single_button(new moodle_url('/course/manage.php'),
get_string('managecourses'), 'get');
$this->page->set_button($managebutton);
}
if (coursecat::count_all() == 1) {
// There exists only one category in the system, do not display link to it
$coursecat = coursecat::get_default();
$strfulllistofcourses = get_string('fulllistofcourses');
$this->page->set_title("$site->shortname: $strfulllistofcourses");
} else {
$strcategories = get_string('categories');
$this->page->set_title("$site->shortname: $strcategories");
}
} else {
$this->page->set_title("$site->shortname: ". $coursecat->get_formatted_name());
$this->page->set_button($this->course_search_form('', 'navbar'));
// Print the category selector
$output .= html_writer::start_tag('div', array('class' => 'categorypicker'));
$select = new single_select(new moodle_url('/course/category.php'), 'id',
$select = new single_select(new moodle_url('/course/index.php'), 'categoryid',
coursecat::make_categories_list(), $coursecat->id, null, 'switchcategory');
$select->set_label(get_string('categories').':');
$output .= $this->render($select);
@@ -1534,29 +1538,29 @@ class core_course_renderer extends plugin_renderer_base {
$browse = optional_param('browse', null, PARAM_ALPHA);
$perpage = optional_param('perpage', $CFG->coursesperpage, PARAM_INT);
$page = optional_param('page', 0, PARAM_INT);
$baseurl = new moodle_url('/course/index.php');
if ($coursecat->id) {
$baseurl = new moodle_url('/course/category.php', array('id' => $coursecat->id));
} else {
$baseurl = new moodle_url('/course/index.php');
$baseurl->param('categoryid', $coursecat->id);
}
if ($perpage != $CFG->coursesperpage) {
$baseurl->param('perpage', $perpage);
}
$coursedisplayoptions['limit'] = $perpage;
$catdisplayoptions['limit'] = $perpage;
if ($browse === 'courses' || !$coursecat->has_children()) {
$coursedisplayoptions['limit'] = $perpage;
$coursedisplayoptions['offset'] = $page * $perpage;
$coursedisplayoptions['paginationurl'] = new moodle_url($baseurl, array('browse' => 'courses', 'perpage' => $perpage));
$coursedisplayoptions['paginationurl'] = new moodle_url($baseurl, array('browse' => 'courses'));
$catdisplayoptions['nodisplay'] = true;
$catdisplayoptions['viewmoreurl'] = new moodle_url($baseurl, array('browse' => 'categories', 'page' => 0));
$catdisplayoptions['viewmoreurl'] = new moodle_url($baseurl, array('browse' => 'categories'));
$catdisplayoptions['viewmoretext'] = new lang_string('viewallsubcategories');
} else if ($browse === 'categories' || !$coursecat->has_courses()) {
$coursedisplayoptions['nodisplay'] = true;
$catdisplayoptions['limit'] = $perpage;
$catdisplayoptions['offset'] = $page * $perpage;
$catdisplayoptions['paginationurl'] = new moodle_url($baseurl, array('browse' => 'categories', 'perpage' => $perpage));
$coursedisplayoptions['viewmoreurl'] = new moodle_url($baseurl, array('browse' => 'courses', 'page' => 0));
$catdisplayoptions['paginationurl'] = new moodle_url($baseurl, array('browse' => 'categories'));
$coursedisplayoptions['viewmoreurl'] = new moodle_url($baseurl, array('browse' => 'courses'));
$coursedisplayoptions['viewmoretext'] = new lang_string('viewallcourses');
} else {
// we have a category that has both subcategories and courses, display pagination separately
$coursedisplayoptions['limit'] = $CFG->coursesperpage;
$catdisplayoptions['limit'] = $CFG->coursesperpage;
$coursedisplayoptions['viewmoreurl'] = new moodle_url($baseurl, array('browse' => 'courses', 'page' => 1));
$catdisplayoptions['viewmoreurl'] = new moodle_url($baseurl, array('browse' => 'categories', 'page' => 1));
}
@@ -1849,12 +1853,12 @@ class core_course_renderer extends plugin_renderer_base {
$chelper->set_subcat_depth($CFG->maxcategorydepth)->
set_categories_display_options(array(
'limit' => $CFG->coursesperpage,
'viewmoreurl' => new moodle_url('/course/category.php',
'viewmoreurl' => new moodle_url('/course/index.php',
array('browse' => 'categories', 'page' => 1))
))->
set_courses_display_options(array(
'limit' => $CFG->coursesperpage,
'viewmoreurl' => new moodle_url('/course/category.php',
'viewmoreurl' => new moodle_url('/course/index.php',
array('browse' => 'courses', 'page' => 1))
))->
set_attributes(array('class' => 'frontpage-category-combo'));
@@ -1874,7 +1878,7 @@ class core_course_renderer extends plugin_renderer_base {
set_show_courses(self::COURSECAT_SHOW_COURSES_COUNT)->
set_categories_display_options(array(
'limit' => $CFG->coursesperpage,
'viewmoreurl' => new moodle_url('/course/category.php',
'viewmoreurl' => new moodle_url('/course/index.php',
array('browse' => 'categories', 'page' => 1))
))->
set_attributes(array('class' => 'frontpage-category-names'));
+1 -1
View File
@@ -6281,7 +6281,7 @@ class context_coursecat extends context {
* @return moodle_url
*/
public function get_url() {
return new moodle_url('/course/category.php', array('id'=>$this->_instanceid));
return new moodle_url('/course/index.php', array('categoryid' => $this->_instanceid));
}
/**
+3 -3
View File
@@ -1693,7 +1693,7 @@ class global_navigation extends navigation_node {
$excessivecategories = $DB->get_records_sql($sql, $params);
foreach ($categories as &$category) {
if (array_key_exists($category->key, $excessivecategories) && !$this->can_add_more_courses_to_category($category)) {
$url = new moodle_url('/course/category.php', array('id'=>$category->key));
$url = new moodle_url('/course/index.php', array('categoryid' => $category->key));
$category->add(get_string('viewallcourses'), $url, self::TYPE_SETTING);
}
}
@@ -1713,7 +1713,7 @@ class global_navigation extends navigation_node {
if (array_key_exists($category->id, $this->addedcategories)) {
return;
}
$url = new moodle_url('/course/category.php', array('id' => $category->id));
$url = new moodle_url('/course/index.php', array('categoryid' => $category->id));
$context = context_coursecat::instance($category->id);
$categoryname = format_string($category->name, true, array('context' => $context));
$categorynode = $parent->add($categoryname, $url, $nodetype, $categoryname, $category->id);
@@ -4089,7 +4089,7 @@ class settings_navigation extends navigation_node {
$onmanagepage = $this->page->url->compare(new moodle_url('/course/manage.php'), URL_MATCH_BASE);
if (can_edit_in_category($this->context->instanceid) && !$onmanagepage) {
$url = new moodle_url('/course/manage.php', array('id' => $this->context->instanceid));
$url = new moodle_url('/course/manage.php', array('categoryid' => $this->context->instanceid));
$editstring = get_string('managecategorythis');
$categorynode->add($editstring, $url, self::TYPE_SETTING, null, null, new pix_icon('i/edit', ''));
}
+1 -1
View File
@@ -765,7 +765,7 @@
foreach ($ras AS $key=>$ra) {
$rolename = $allrolenames[$ra['roleid']] ;
if ($ra['ctxlevel'] == CONTEXT_COURSECAT) {
$rastring .= $rolename. ' @ ' . '<a href="'.$CFG->wwwroot.'/course/category.php?id='.$ra['ctxinstanceid'].'">'.s($ra['ccname']).'</a>';
$rastring .= $rolename. ' @ ' . '<a href="'.$CFG->wwwroot.'/course/index.php?categoryid='.$ra['ctxinstanceid'].'">'.s($ra['ccname']).'</a>';
} elseif ($ra['ctxlevel'] == CONTEXT_SYSTEM) {
$rastring .= $rolename. ' - ' . get_string('globalrole','role');
} else {