From: skodak Date: Fri, 13 Jul 2007 09:05:36 +0000 (+0000) Subject: updated category locking to work the same as hiding - locking of category now locks... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7a7a53d32ae84e1edac14b06808f5afb33d16004;p=moodle.git updated category locking to work the same as hiding - locking of category now locks all children too --- diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index a3ab203224..7f6d7f1cb6 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -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); + } + } } /**