]> git.mjollnir.org Git - moodle.git/commitdiff
updated category locking to work the same as hiding - locking of category now locks...
authorskodak <skodak>
Fri, 13 Jul 2007 09:05:36 +0000 (09:05 +0000)
committerskodak <skodak>
Fri, 13 Jul 2007 09:05:36 +0000 (09:05 +0000)
lib/grade/grade_category.php

index a3ab20322421897f05cf05bc4c1aa3032c4bf070..7f6d7f1cb69785de18c4f41d1fd7c5087129c76a 100644 (file)
@@ -909,7 +909,17 @@ class grade_category extends grade_object {
      */
     function set_locked($lockedstate) {
         $this->load_grade_item();
-        return $this->grade_item->set_locked($lockedstate);
+        $this->grade_item->set_locked($lockedstate);
+        if ($children = grade_item::fetch_all(array('categoryid'=>$this->id))) {
+            foreach($children as $child) {
+                $child->set_locked($lockedstate);
+            }
+        }
+        if ($children = grade_category::fetch_all(array('parent'=>$this->id))) {
+            foreach($children as $child) {
+                $child->set_locked($lockedstate);
+            }
+        }
     }
 
     /**