/**
  * activates or deactivates pages
  */
 function activatePages()
 {
     global $lng;
     include_once "./Services/COPage/classes/class.ilPageObject.php";
     if (is_array($_POST["id"])) {
         $act_items = array();
         // get all "top" ids, i.e. remove ids, that have a selected parent
         foreach ($_POST["id"] as $id) {
             $path = $this->tree->getPathId($id);
             $take = true;
             foreach ($path as $path_id) {
                 if ($path_id != $id && in_array($path_id, $_POST["id"])) {
                     $take = false;
                 }
             }
             if ($take) {
                 $act_items[] = $id;
             }
         }
         foreach ($act_items as $id) {
             $childs = $this->tree->getChilds($id);
             foreach ($childs as $child) {
                 if (ilLMObject::_lookupType($child["child"]) == "pg") {
                     $act = ilPageObject::_lookupActive($child["child"], $this->content_object->getType());
                     ilPageObject::_writeActive($child["child"], $this->content_object->getType(), !$act);
                 }
             }
             if (ilLMObject::_lookupType($id) == "pg") {
                 $act = ilPageObject::_lookupActive($id, $this->content_object->getType());
                 ilPageObject::_writeActive($id, $this->content_object->getType(), !$act);
             }
         }
     } else {
         ilUtil::sendFailure($lng->txt("no_checkbox"), true);
     }
     $this->ctrl->redirect($this, "view");
 }
 /**
  * activates or deactivates pages
  */
 function activatePages()
 {
     if (is_array($_POST["id"])) {
         foreach ($_POST["id"] as $id) {
             include_once "./Services/COPage/classes/class.ilPageObject.php";
             $act = ilPageObject::_lookupActive($id, $this->object->getType());
             ilPageObject::_writeActive($id, $this->object->getType(), !$act);
         }
     }
     $this->ctrl->redirect($this, "pages");
 }