MDL-38593 Argument 'id' renamed to 'categoryid' in course/manage.php
authorMarina Glancy <marina@moodle.com>
Tue, 9 Apr 2013 02:55:50 +0000 (12:55 +1000)
committerMarina Glancy <marina@moodle.com>
Tue, 9 Apr 2013 02:55:50 +0000 (12:55 +1000)
course/delete.php
course/edit.php
course/editcategory.php
course/manage.php
lib/navigationlib.php

index 757092f..71bafca 100644 (file)
@@ -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();
 
index 842e62c..c549cc1 100644 (file)
@@ -98,7 +98,7 @@ if ($editform->is_cancelled()) {
                 $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');
index 355aca1..f2dfd03 100644 (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.
index bfd2dcb..5817b32 100644 (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,7 +71,7 @@ $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)) {
@@ -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;
 }
@@ -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'));
index fe1b255..e8e9ca0 100644 (file)
@@ -4110,7 +4110,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', ''));
         }