/**
  * Create new scorm 2004 with page-layout
  */
 function createWithLayoutId($a_layout_id)
 {
     include_once "./Services/Style/classes/class.ilPageLayout.php";
     //get XML Data for Layout
     $layout_obj = new ilPageLayout($a_layout_id);
     parent::setXMLContent($layout_obj->getXMLContent());
     // create page object
     parent::create();
 }
 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");
 }
Пример #3
0
 protected function afterSave(ilObject $a_new_object)
 {
     // create 1st page / blog
     include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
     $page = $this->getPageInstance(null, $a_new_object->getId());
     if ($_POST["ptype"] == "page") {
         $page->setType(ilPortfolioPage::TYPE_PAGE);
         $page->setTitle($_POST["fpage"]);
         // use template as basis
         $layout_id = $_POST["tmpl"];
         if ($layout_id) {
             include_once "./Services/Style/classes/class.ilPageLayout.php";
             $layout_obj = new ilPageLayout($layout_id);
             $page->setXMLContent($layout_obj->getXMLContent());
         }
     } else {
         $page->setType(ilPortfolioPage::TYPE_BLOG);
         $page->setTitle($_POST["blog"]);
     }
     $page->create();
     ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
     $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
     $this->ctrl->redirect($this, "view");
 }
 /**
  * Create new portfolio page
  */
 public function savePage()
 {
     $form = $this->initPageForm("create");
     if ($form->checkInput() && $this->checkPermissionBool("write")) {
         include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
         $page = $this->getPageInstance();
         $page->setType(ilPortfolioPage::TYPE_PAGE);
         $page->setTitle($form->getInput("title"));
         // use template as basis
         $layout_id = $form->getInput("tmpl");
         if ($layout_id) {
             include_once "./Services/Style/classes/class.ilPageLayout.php";
             $layout_obj = new ilPageLayout($layout_id);
             $page->setXMLContent($layout_obj->getXMLContent());
         }
         $page->create();
         ilUtil::sendSuccess($this->lng->txt("prtf_page_created"), true);
         $this->ctrl->redirect($this, "view");
     }
     $this->tabs_gui->clearTargets();
     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, "view"));
     $form->setValuesByPost();
     $this->tpl->setContent($form->getHtml());
 }
 /**
  * Create new portfolio page
  */
 public function savePage()
 {
     global $tpl, $lng, $ilCtrl, $ilTabs;
     $form = $this->initPageForm("create");
     if ($form->checkInput() && $this->checkAccess("write")) {
         include_once "Services/Portfolio/classes/class.ilPortfolioPage.php";
         $page = new ilPortfolioPage($this->portfolio->getId());
         $page->setType(ilPortfolioPage::TYPE_PAGE);
         $page->setTitle($form->getInput("title"));
         // use template as basis
         $layout_id = $form->getInput("tmpl");
         if ($layout_id) {
             include_once "./Services/Style/classes/class.ilPageLayout.php";
             $layout_obj = new ilPageLayout($layout_id);
             $page->setXMLContent($layout_obj->getXMLContent());
         }
         $page->create();
         ilUtil::sendSuccess($lng->txt("prtf_page_created"), true);
         $ilCtrl->redirect($this, "pages");
     }
     $ilTabs->clearTargets();
     $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "pages"));
     $form->setValuesByPost();
     $tpl->setContent($form->getHtml());
 }