24 require_once(
"./Services/COPage/classes/class.ilPCTabs.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
44 function ilPCTabsGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
55 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
82 function edit($a_insert =
false)
89 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
91 $form->setFormAction($ilCtrl->getFormAction($this));
94 $form->setTitle($this->lng->txt(
"cont_insert_tabs"));
98 $form->setTitle($this->lng->txt(
"cont_update_tabs"));
104 $types = array(
"HorizontalTabs" => $this->lng->txt(
"cont_tabs_hor_tabs"),
105 "Accordion" => $this->lng->txt(
"cont_tabs_accordion"));
106 $selected = ($a_insert)
108 : $this->content_obj->getTabType();
110 $type_prop->setOptions($types);
111 $form->addItem($type_prop);
118 $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6,
119 7 => 7, 8 => 8, 9 => 9, 10 => 10);
120 $nr_prop->setOptions($nrs);
121 $form->addItem($nr_prop);
125 $captions = $this->content_obj->getCaptions();
127 foreach($captions as $caption)
129 $cap_prop[$i] =
new ilTextInputGUI($this->lng->txt(
"cont_caption").
" ".($i + 1),
131 $cap_prop[$i]->setValue($caption);
132 $form->addItem($cap_prop[$i]);
140 $form->addCommandButton(
"create_section", $lng->txt(
"save"));
141 $form->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
145 $form->addCommandButton(
"update_section", $lng->txt(
"save"));
146 $form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
148 $html = $form->getHTML();
149 $tpl->setContent($html);
159 $this->content_obj =
new ilPCTabs($this->dom);
160 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
161 $this->content_obj->addItems($_POST[
"nr"]);
162 $this->content_obj->setTabType($_POST[
"type"]);
163 $this->updated = $this->pg_obj->update();
164 if ($this->updated ===
true)
166 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
180 if (is_array($_POST[
"caption"]))
183 foreach($_POST[
"caption"] as $k => $v)
187 $this->content_obj->setCaptions($caption);
189 $this->updated = $this->pg_obj->update();
190 if ($this->updated ===
true)
192 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
196 $this->pg_obj->addHierIDs();