/** * Init style properties form */ function initStylePropertiesForm() { global $ilCtrl, $lng, $ilTabs, $ilSetting, $tpl; $tpl->setTreeFlatIcon("", ""); $ilTabs->clearTargets(); $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page"); if ($xpage_id > 0) { $ilTabs->setBackTarget($lng->txt("cntr_back_to_old_editor"), $ilCtrl->getLinkTarget($this, "switchToOldEditor"), "_top"); } else { $ilTabs->setBackTarget($lng->txt("back"), "./goto.php?target=" . $this->object->getType() . "_" . $this->object->getRefId(), "_top"); } include_once "./Services/Container/classes/class.ilContainerPageGUI.php"; $page_gui = new ilContainerPageGUI($this->object->getId()); $style_id = $this->object->getStyleSheetId(); if (ilObject::_lookupType($style_id) == "sty") { $page_gui->setStyleId($style_id); } else { $style_id = 0; } $page_gui->setTabHook($this, "addPageTabs"); $ilCtrl->getHTML($page_gui); $ilTabs->setTabActive("obj_sty"); include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $lng->loadLanguageModule("style"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $fixed_style = $ilSetting->get("fixed_content_style_id"); // $style_id = $this->object->getStyleSheetId(); if ($fixed_style > 0) { $st = new ilNonEditableValueGUI($lng->txt("wiki_current_style")); $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")"); $this->form->addItem($st); } else { $st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]); $st_styles[0] = $this->lng->txt("default"); ksort($st_styles); if ($style_id > 0) { // individual style if (!ilObjStyleSheet::_lookupStandard($style_id)) { $st = new ilNonEditableValueGUI($lng->txt("style_current_style")); $st->setValue(ilObject::_lookupTitle($style_id)); $this->form->addItem($st); //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit")); // delete command $this->form->addCommandButton("editStyle", $lng->txt("style_edit_style")); $this->form->addCommandButton("deleteStyle", $lng->txt("style_delete_style")); //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete")); } } if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) { $style_sel = ilUtil::formSelect($style_id, "style_id", $st_styles, false, true); $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id"); $style_sel->setOptions($st_styles); $style_sel->setValue($style_id); $this->form->addItem($style_sel); //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create")); $this->form->addCommandButton("saveStyleSettings", $lng->txt("save")); $this->form->addCommandButton("createStyle", $lng->txt("sty_create_ind_style")); } } $this->form->setTitle($lng->txt("obj_sty")); $this->form->setFormAction($ilCtrl->getFormAction($this)); }
function initStylePropertiesForm() { global $ilSetting; include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $this->lng->loadLanguageModule("style"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $fixed_style = $ilSetting->get("fixed_content_style_id"); $style_id = $this->object->getStyleSheetId(); if ($fixed_style > 0) { $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style")); $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")"); $form->addItem($st); } else { $st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]); $st_styles[0] = $this->lng->txt("default"); ksort($st_styles); if ($style_id > 0) { // individual style if (!ilObjStyleSheet::_lookupStandard($style_id)) { $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style")); $st->setValue(ilObject::_lookupTitle($style_id)); $form->addItem($st); // delete command $form->addCommandButton("editStyle", $this->lng->txt("style_edit_style")); $form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style")); } } if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) { $style_sel = new ilSelectInputGUI($this->lng->txt("style_current_style"), "style_id"); $style_sel->setOptions($st_styles); $style_sel->setValue($style_id); $form->addItem($style_sel); $form->addCommandButton("saveStyleSettings", $this->lng->txt("save")); $form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style")); } } $form->setTitle($this->lng->txt("blog_style")); $form->setFormAction($this->ctrl->getFormAction($this)); return $form; }
function initForm($a_mode) { global $ilCtrl, $lng, $ilSetting; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form_gui = new ilPropertyFormGUI(); $form_gui->setFormAction($ilCtrl->getFormAction($this)); $form_gui->setTitle($lng->txt("cont_ed_pglprop")); // title $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title"); $title_input->setSize(50); $title_input->setMaxLength(128); $title_input->setValue($this->layout_object->title); $title_input->setTitle($lng->txt("title")); $title_input->setRequired(true); // description $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc"); $desc_input->setValue($this->layout_object->description); $desc_input->setRows(3); $desc_input->setCols(37); $desc_input->setTitle($lng->txt("description")); $desc_input->setRequired(false); // modules $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module"); // $mods->setRequired(true); $mods->setValue($this->layout_object->getModules()); foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) { $mod = new ilCheckboxOption($mod_caption, $mod_id); $mods->addOption($mod); } $form_gui->addItem($title_input); $form_gui->addItem($desc_input); $form_gui->addItem($mods); // style $fixed_style = $ilSetting->get("fixed_content_style_id"); $style_id = $this->layout_object->getStyleId(); if ($fixed_style > 0) { $st = new ilNonEditableValueGUI($lng->txt("cont_current_style")); $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")"); $form_gui->addItem($st); } else { include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $st_styles = ilObjStyleSheet::_getStandardStyles(true, false); $st_styles[0] = $this->lng->txt("default"); ksort($st_styles); $style_sel = new ilSelectInputGUI($lng->txt("obj_sty"), "style_id"); $style_sel->setOptions($st_styles); $style_sel->setValue($style_id); $form_gui->addItem($style_sel); } $form_gui->addCommandButton("updateProperties", $lng->txt($a_mode)); return $form_gui; }