one more category locking fix

This commit is contained in:
skodak 2007-07-13 09:12:23 +00:00
parent 7a7a53d32a
commit b121b54432

View File

@ -909,17 +909,22 @@ class grade_category extends grade_object {
*/
function set_locked($lockedstate) {
$this->load_grade_item();
$this->grade_item->set_locked($lockedstate);
$result = $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 (!$child->set_locked($lockedstate)) {
$result = false;
}
}
}
if ($children = grade_category::fetch_all(array('parent'=>$this->id))) {
foreach($children as $child) {
$child->set_locked($lockedstate);
if (!$child->set_locked($lockedstate)) {
$result = false;
}
}
}
return $result;
}
/**