]> git.mjollnir.org Git - moodle.git/commitdiff
parameter cleaup - round 8; short php tag in group-edit.html
authorskodak <skodak>
Tue, 7 Mar 2006 19:36:13 +0000 (19:36 +0000)
committerskodak <skodak>
Tue, 7 Mar 2006 19:36:13 +0000 (19:36 +0000)
course/category.php
course/delete.php
course/edit.php
course/group-edit.html
course/group.php
course/groups.php
course/import/activities/index.php
course/import/groups/index.php

index 016ddaac21820612ed800882a7329375a0144c5b..b2e62c94b244652354412ec8c19aac4be7e82df1 100644 (file)
@@ -6,17 +6,17 @@
     require_once("../config.php");
     require_once("lib.php");
 
-    $id      = required_param('id', PARAM_INT);          // Category id
-    $page    = optional_param('page', 0, PARAM_INT);     // which page to show
-    $perpage = optional_param('perpage', 20, PARAM_INT); // how many per page
-    $edit = optional_param('edit','',PARAM_ALPHA);
-    $hide = optional_param('hide',0,PARAM_INT);
-    $show = optional_param('show',0,PARAM_INT);
-    $moveup = optional_param('moveup',0,PARAM_INT);
-    $movedown = optional_param('movedown',0,PARAM_INT);
-    $moveto = optional_param('moveto',0,PARAM_INT);
-    $rename = optional_param('rename','');
-    $resort = optional_param('resort','');
+    $id       = required_param('id', PARAM_INT);          // Category id
+    $page     = optional_param('page', 0, PARAM_INT);     // which page to show
+    $perpage  = optional_param('perpage', 20, PARAM_INT); // how many per page
+    $edit     = optional_param('edit', -1, PARAM_BOOL);
+    $hide     = optional_param('hide', 0, PARAM_INT);
+    $show     = optional_param('show', 0, PARAM_INT);
+    $moveup   = optional_param('moveup', 0, PARAM_INT);
+    $movedown = optional_param('movedown', 0, PARAM_INT);
+    $moveto   = optional_param('moveto', 0, PARAM_INT);
+    $rename   = optional_param('rename', '', PARAM_NOTAGS);
+    $resort   = optional_param('resort', 0, PARAM_BOOL);
 
     if (!$site = get_site()) {
         error("Site isn't defined!");
     }
 
     if (iscreator()) {
-        if (!empty($edit) and confirm_sesskey()) {
-            if ($edit == "on") {
-                $USER->categoryediting = true;
-            } else if ($edit == "off") {
-                $USER->categoryediting = false;
-            }
+        if ($edit !== -1) {
+            $USER->categoryediting = $edit;
         }
         $navbaritem = update_category_button($category->id);
 
@@ -64,7 +60,7 @@
 
         /// Resort the category if requested
 
-        if (!empty($resort) and confirm_sesskey()) {
+        if ($resort and confirm_sesskey()) {
             if ($courses = get_courses($category->id, "fullname ASC", 'c.id,c.fullname,c.sortorder')) {
                 // move it off the range
                 $count = get_record_sql('SELECT MAX(sortorder) AS max, 1
index 2a9d0da6340e3f11327ddbae1464105488e000e3..74b0dae7c63536beea8a45b691b2cf362c1fb4f5 100644 (file)
@@ -3,8 +3,8 @@
 
     require_once("../config.php");
 
-    $id = required_param('id',PARAM_INT);       // course id
-    $delete = optional_param('delete');   // delete confirmation
+    $id     = required_param('id', PARAM_INT);              // course id
+    $delete = optional_param('delete', '', PARAM_ALPHANUM); // delete confirmation hash
 
     require_login();
 
index 8b87c3a16e07b1516b216e70b5c898cc85036a7a..d196164e3181ba76380fa65df88c924d81ebaf76 100644 (file)
@@ -5,7 +5,7 @@
     require_once("lib.php");
     require_once("$CFG->libdir/blocklib.php");
 
-    $id = optional_param('id', 0, PARAM_INT); // course id
+    $id       = optional_param('id', 0, PARAM_INT); // course id
     $category = optional_param('category', 0, PARAM_INT); // possible default category
 
     require_login();
index 58cef414326dadc3da3b82ab21eda1043be05f4e..57969bbea034b9bdff0177f52f1d81c750512d56 100644 (file)
@@ -18,7 +18,7 @@
 </tr>
 
 <tr valign="top">
-    <td align="right"><?print_string('enrolmentkey') ?>:</td>
+    <td align="right"><?php print_string('enrolmentkey') ?>:</td>
     <td><input type="text" name="password" size="25" value="<?php echo $group->password ?>" alt="<?print_string('enrolmentkey') ?>" /></td>
 </tr>
 
index 1435eb3bdcf7139ec9cd711fb615acb97f0b1a66..2c043b207b576ae733299a2363fe999c739b3c2d 100644 (file)
@@ -8,9 +8,8 @@
     require_once('../config.php');
     require_once('lib.php');
 
-    $id    = required_param('id');          // Course id
-    $group = optional_param('group', 0);    // Optionally look at other groups
-    $edit  = optional_param('edit', false); // Editing can be turned on
+    $id    = required_param('id', PARAM_INT);          // Course id
+    $group = optional_param('group', 0, PARAM_INT);    // Optionally look at other groups
 
     if (! $course = get_record('course', 'id', $id) ) {
         error("That's an invalid course id");
@@ -38,7 +37,6 @@
     if ($form = data_submitted() and confirm_sesskey()) { 
 
         if (empty($form->name)) {
-            $edit = true;
             $err['name'] = get_string("missingname");
 
         } else {
     }
 
 
-/// Are we editing?  If so, handle it.
-
-    if ($usehtmleditor = can_use_richtext_editor()) {
-        $defaultformat = FORMAT_HTML;
-    } else {
-        $defaultformat = FORMAT_MOODLE;
-    }
-
     $usehtmleditor = false;
 
     $sesskey = !empty($USER->id) ? $USER->sesskey : '';
 
     include('group-edit.html');
 
-    if ($usehtmleditor) {
-        use_html_editor("description");
-    }
-
     echo "</body></html>";
 ?>
index 5cd6e5454291a7b0aeae37a9bbd6bea2d4d3ed47..33394ff6f4409b44bdeccf0f7536338cebec3adf 100644 (file)
@@ -28,8 +28,8 @@
     require_once('../config.php');
     require_once('lib.php');
 
-    $courseid      = required_param('id');           // Course id
-    $selectedgroup = optional_param('group', NULL);  // Current group id
+    $courseid      = required_param('id', PARAM_INT);           // Course id
+    $selectedgroup = optional_param('group', NULL, PARAM_INT);  // Current group id
 
     if (! $course = get_record('course', 'id', $courseid) ) {
         error("That's an invalid course id");
index 51ee2930f623827f4a0a4e909e2373e7676abff7..3e468cc34bffa7ef04f3298a464595ea58ec7fcb 100644 (file)
@@ -4,12 +4,13 @@
     require_once('../../lib.php');
     require_once($CFG->dirroot.'/backup/restorelib.php');
     
+    $id               = required_param('id', PARAM_INT);   // course id to import TO
+    $fromcourse       = optional_param('fromcourse', 0, PARAM_INT);
+    $fromcoursesearch = optional_param('fromcoursesearch', '', PARAM_RAW);
+    $page             = optional_param('page', 0, PARAM_INT);
+    $filename         = optional_param('filename', 0, PARAM_PATH);
+
     $strimportothercourses = get_string('importfromothercourses');
-    $id = required_param('id', PARAM_INT);   // course id to import TO
-    $fromcourse = optional_param('fromcourse',0,PARAM_INT);
-    $fromcoursesearch = optional_param('fromcoursesearch','',PARAM_CLEAN);
-    $page = optional_param('page',0,PARAM_INT);
-    $filename = optional_param('filename',0,PARAM_PATH);
 
     if (! ($course = get_record("course", "id", $id)) ) {
         error("That's an invalid course id");
index 615e97891f194414118f10d03a3a75dc3033b40b..ea9fa367da553c167ba271266bd6e39bb541d164 100755 (executable)
@@ -5,7 +5,7 @@
        require_once('../../../config.php');
     require_once('../../lib.php');
        
-       $mycourseid = required_param('id');    // Course id
+       $mycourseid = required_param('id', PARAM_INT);    // Course id
     
        if (! $course = get_record('course', 'id', $mycourseid) ) {
         error("That's an invalid course id");