/**
  * 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;
     }
 }
 function createPgObject()
 {
     global $ilCtrl;
     $form_gui = $this->initAddPageLayoutForm();
     if (!$form_gui->checkInput()) {
         $form_gui->setValuesByPost();
         return $this->addPageLayoutObject($form_gui);
     }
     //create Page-Layout-Object first
     $pg_object = new ilPageLayout();
     $pg_object->setTitle($form_gui->getInput('pgl_title'));
     $pg_object->setDescription($form_gui->getInput('pgl_desc'));
     $pg_object->setSpecialPage($form_gui->getInput('special_page'));
     $pg_object->setModules($form_gui->getInput('module'));
     $pg_object->update();
     include_once "./Services/COPage/classes/class.ilPageObject.php";
     //create Page
     if (!is_object($pg_content)) {
         $this->pg_content =& new ilPageObject($this->type);
     }
     $this->pg_content->setId($pg_object->getId());
     $tmpl = $form_gui->getInput('pgl_template');
     if ($tmpl != "-1") {
         $layout_obj = new ilPageLayout($tmpl);
         $this->pg_content->setXMLContent($layout_obj->getXMLContent());
         $this->pg_content->create(false);
     } else {
         $this->pg_content->create(false);
     }
     $ilCtrl->setParameterByClass("ilpagelayoutgui", "obj_id", $pg_object->getId());
     $ilCtrl->redirectByClass("ilpagelayoutgui", "edit");
 }