コード例 #1
0
 /**
  * Import record
  *
  * @param
  * @return
  */
 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 {
     switch ($a_entity) {
         case "pgtp":
             include_once "./Services/Style/classes/class.ilPageLayout.php";
             $pt = new ilPageLayout();
             $pt->setTitle($a_rec["Title"]);
             $pt->setDescription($a_rec["Description"]);
             $pt->setSpecialPage($a_rec["SpecialPage"]);
             $pt->update();
             $this->current_obj = $pt;
             $a_mapping->addMapping("Services/COPage", "pgtp", $a_rec["Id"], $pt->getId());
             $a_mapping->addMapping("Services/COPage", "pg", "stys:" . $a_rec["Id"], "stys:" . $pt->getId());
             break;
     }
 }
コード例 #2
0
 /**
  * Save page layout types
  */
 function savePageLayoutTypesObject()
 {
     global $lng, $ilCtrl;
     include_once "./Services/Style/classes/class.ilPageLayout.php";
     if (is_array($_POST["type"])) {
         foreach ($_POST["type"] as $id => $t) {
             if ($id > 0) {
                 $l = new ilPageLayout($id);
                 $l->readObject();
                 $l->setSpecialPage($t);
                 if (is_array($_POST["module"][$id])) {
                     $l->setModules(array_keys($_POST["module"][$id]));
                 } else {
                     $l->setModules();
                 }
                 $l->update();
             }
         }
         ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
     }
     $ilCtrl->redirect($this, "viewPageLayouts");
 }