ILIAS  release_4-4 Revision
ilPCTabsGUI Class Reference

Class ilPCTabsGUI. More...

+ Inheritance diagram for ilPCTabsGUI:
+ Collaboration diagram for ilPCTabsGUI:

Public Member Functions

 ilPCTabsGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public. More...
 
executeCommand ()
 execute command More...
 
 insert ($a_omit_form_init=false)
 Insert new tabs. More...
 
 editProperties ()
 Edit tabs. More...
 
 initForm ($a_mode="edit")
 Insert tabs form. More...
 
 getFormValues ()
 Get form values. More...
 
 create ()
 Create new tabs in dom and update page in db. More...
 
 afterCreation ()
 After creation processing. More...
 
 update ()
 Save tabs properties in db and return to page edit screen. More...
 
 edit ()
 List all tabs. More...
 
 saveTabs ()
 Save tabs properties in db and return to page edit screen. More...
 
 addTab ()
 Save tabs properties in db and return to page edit screen. More...
 
 confirmTabsDeletion ()
 Confirm tabs deletion. More...
 
 cancelTabDeletion ()
 Cancel tab deletion. More...
 
 deleteTabs ()
 Delete Tabs. More...
 
 setTabs ()
 Set tabs. More...
 
- Public Member Functions inherited from ilPageContentGUI
 ilPageContentGUI ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions ($a_type)
 Get table templates. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $ilias
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCTabsGUI.

User Interface for Tabbed Content

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 17 of file class.ilPCTabsGUI.php.

Member Function Documentation

◆ addTab()

ilPCTabsGUI::addTab ( )

Save tabs properties in db and return to page edit screen.

Definition at line 396 of file class.ilPCTabsGUI.php.

References $ilCtrl, ilPageContentGUI\$lng, and ilUtil\sendSuccess().

397  {
398  global $lng, $ilCtrl;
399 
400  $this->content_obj->addTab($lng->txt("cont_new_tab"));
401  $this->updated = $this->pg_obj->update();
402 
403  ilUtil::sendSuccess($lng->txt("cont_added_tab"), true);
404  $ilCtrl->redirect($this, "edit");
405  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ afterCreation()

ilPCTabsGUI::afterCreation ( )

After creation processing.

Definition at line 297 of file class.ilPCTabsGUI.php.

References $ilCtrl, edit(), and ilPageContentGUI\setHierId().

Referenced by create().

298  {
299  global $ilCtrl;
300 
301  $this->pg_obj->stripHierIDs();
302  $this->pg_obj->addHierIDs();
303  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
304  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
305  $this->content_obj->setHierId($this->content_obj->readHierId());
306  $this->setHierId($this->content_obj->readHierId());
307  $this->content_obj->setPCId($this->content_obj->readPCId());
308  $this->edit();
309  }
edit()
List all tabs.
global $ilCtrl
Definition: ilias.php:18
setHierId($a_hier_id)
get hierarchical id in dom object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelTabDeletion()

ilPCTabsGUI::cancelTabDeletion ( )

Cancel tab deletion.

Definition at line 444 of file class.ilPCTabsGUI.php.

References $ilCtrl.

445  {
446  global $ilCtrl;
447  $ilCtrl->redirect($this, "edit");
448  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmTabsDeletion()

ilPCTabsGUI::confirmTabsDeletion ( )

Confirm tabs deletion.

Definition at line 410 of file class.ilPCTabsGUI.php.

References $_POST, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilUtil\sendInfo(), and setTabs().

411  {
412  global $ilCtrl, $tpl, $lng;
413 
414  $this->setTabs();
415 
416  if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0)
417  {
418  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
419  $ilCtrl->redirect($this, "edit");
420  }
421  else
422  {
423  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
424  $cgui = new ilConfirmationGUI();
425  $cgui->setFormAction($ilCtrl->getFormAction($this));
426  $cgui->setHeaderText($lng->txt("cont_tabs_confirm_deletion"));
427  $cgui->setCancel($lng->txt("cancel"), "cancelTabDeletion");
428  $cgui->setConfirm($lng->txt("delete"), "deleteTabs");
429 
430  foreach ($_POST["tid"] as $k => $i)
431  {
432  $id = explode(":", $k);
433  $cgui->addItem("tid[]", $k,
434  $this->content_obj->getCaption($id[0], $id[1]));
435  }
436 
437  $tpl->setContent($cgui->getHTML());
438  }
439  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setTabs()
Set tabs.
Confirmation screen class.
+ Here is the call graph for this function:

◆ create()

ilPCTabsGUI::create ( )

Create new tabs in dom and update page in db.

Definition at line 246 of file class.ilPCTabsGUI.php.

References $_POST, ilPageContentGUI\$lng, $t, ilPCTabs\ACCORDION_HOR, ilPCTabs\ACCORDION_VER, afterCreation(), ilPageContentGUI\getPage(), initForm(), and insert().

247  {
248  global $ilDB, $lng;
249 
250  $this->initForm("create");
251  if ($this->form->checkInput())
252  {
253  $this->content_obj = new ilPCTabs($this->getPage());
254  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
255  $this->content_obj->setTabType($_POST["type"]);
256  $this->content_obj->setContentWidth($_POST["content_width"]);
257  $this->content_obj->setContentHeight($_POST["content_height"]);
258  $this->content_obj->setHorizontalAlign($_POST["align"]);
259  $this->content_obj->setBehavior($_POST["behavior"]);
260  for ($i = 0; $i < (int) $_POST["nr"]; $i++)
261  {
262  $this->content_obj->addTab($lng->txt("cont_new_tab"));
263  }
264  if ($_POST["type"] == ilPCTabs::ACCORDION_VER)
265  {
266  $t = explode(":", $_POST["vaccord_templ"]);
267  $this->content_obj->setTemplate($t[2]);
268  }
269  if ($_POST["type"] == ilPCTabs::ACCORDION_HOR)
270  {
271  $t = explode(":", $_POST["haccord_templ"]);
272  $this->content_obj->setTemplate($t[2]);
273  }
274  $this->updated = $this->pg_obj->update();
275 
276  if ($this->updated === true)
277  {
278  $this->afterCreation();
279  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
280  }
281  else
282  {
283  $this->insert();
284  }
285  }
286  else
287  {
288  $this->form->setValuesByPost();
289  $this->insert(true);
290 // return $this->form->getHtml();
291  }
292  }
$_POST['username']
Definition: cron.php:12
const ACCORDION_HOR
afterCreation()
After creation processing.
const ACCORDION_VER
insert($a_omit_form_init=false)
Insert new tabs.
Class ilPCTabs.
initForm($a_mode="edit")
Insert tabs form.
+ Here is the call graph for this function:

◆ deleteTabs()

ilPCTabsGUI::deleteTabs ( )

Delete Tabs.

Definition at line 453 of file class.ilPCTabsGUI.php.

References $_POST, and $ilCtrl.

454  {
455  global $ilCtrl;
456 
457  if (is_array($_POST["tid"]))
458  {
459  foreach($_POST["tid"] as $tid)
460  {
461  $ids = explode(":", $tid);
462  $this->content_obj->deleteTab($ids[0], $ids[1]);
463  }
464  }
465  $this->updated = $this->pg_obj->update();
466 
467  $ilCtrl->redirect($this, "edit");
468  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

◆ edit()

ilPCTabsGUI::edit ( )

List all tabs.

Definition at line 357 of file class.ilPCTabsGUI.php.

References $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, and setTabs().

Referenced by afterCreation().

358  {
359  global $tpl, $ilTabs, $ilCtrl, $ilToolbar, $lng;
360 
361  $ilToolbar->addButton($lng->txt("cont_add_tab"),
362  $ilCtrl->getLinkTarget($this, "addTab"));
363 
364  $this->setTabs();
365  $ilTabs->activateTab("cont_tabs");
366  include_once("./Services/COPage/classes/class.ilPCTabsTableGUI.php");
367  $table_gui = new ilPCTabsTableGUI($this, "edit", $this->content_obj);
368  $tpl->setContent($table_gui->getHTML());
369  }
global $ilCtrl
Definition: ilias.php:18
TableGUI class for tabs.
setTabs()
Set tabs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editProperties()

ilPCTabsGUI::editProperties ( )

Edit tabs.

Definition at line 69 of file class.ilPCTabsGUI.php.

References $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), getFormValues(), initForm(), and setTabs().

Referenced by update().

70  {
71  global $ilCtrl, $lng, $tpl;
72 
73  $this->displayValidationError();
74  $this->setTabs();
75 
76  $this->initForm();
77  $this->getFormValues();
78  $html = $this->form->getHTML();
79  $tpl->setContent($html);
80  }
global $ilCtrl
Definition: ilias.php:18
displayValidationError()
display validation errors
getFormValues()
Get form values.
setTabs()
Set tabs.
initForm($a_mode="edit")
Insert tabs form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilPCTabsGUI::executeCommand ( )

execute command

Definition at line 31 of file class.ilPCTabsGUI.php.

References $cmd, and $ret.

32  {
33  // get next class that processes or forwards current command
34  $next_class = $this->ctrl->getNextClass($this);
35 
36  // get current command
37  $cmd = $this->ctrl->getCmd();
38 
39  switch($next_class)
40  {
41  default:
42  $ret =& $this->$cmd();
43  break;
44  }
45 
46  return $ret;
47  }
$cmd
Definition: sahs_server.php:35

◆ getFormValues()

ilPCTabsGUI::getFormValues ( )

Get form values.

Definition at line 216 of file class.ilPCTabsGUI.php.

References ilObjStyleSheet\_lookupTemplateIdByName(), ilPCTabs\ACCORDION_HOR, ilPCTabs\ACCORDION_VER, and ilPageContentGUI\getStyleId().

Referenced by editProperties().

217  {
218  $values["type"] = $this->content_obj->getTabType();
219  $values["content_width"] = $this->content_obj->getContentWidth();
220  $values["content_height"] = $this->content_obj->getContentHeight();
221  $values["align"] = $this->content_obj->getHorizontalAlign();
222  $values["behavior"] = $this->content_obj->getBehavior();
223  $this->form->setValuesByArray($values);
224 
225  if ($values["type"] == ilPCTabs::ACCORDION_VER)
226  {
227  $va = $this->form->getItemByPostVar("vaccord_templ");
228  $v = "t:".
229  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()).":".
230  $this->content_obj->getTemplate();
231  $va->setValue($v);
232  }
233  if ($values["type"] == ilPCTabs::ACCORDION_HOR)
234  {
235  $ha = $this->form->getItemByPostVar("haccord_templ");
236  $v = "t:".
237  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()).":".
238  $this->content_obj->getTemplate();
239  $ha->setValue($v);
240  }
241  }
static _lookupTemplateIdByName($a_style_id, $a_name)
Lookup table template preview.
const ACCORDION_HOR
const ACCORDION_VER
getStyleId()
Get Style Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilPCTabsGUI()

ilPCTabsGUI::ilPCTabsGUI ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor public.

Definition at line 23 of file class.ilPCTabsGUI.php.

24  {
25  parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
26  }

◆ initForm()

ilPCTabsGUI::initForm (   $a_mode = "edit")

Insert tabs form.

Definition at line 85 of file class.ilPCTabsGUI.php.

References $ilCtrl, ilPageContentGUI\$lng, $options, $si, $t, ilPageContentGUI\$tpl, ilPCTabs\ACCORDION_HOR, ilPCTabs\ACCORDION_VER, ilAccordionGUI\addCss(), ilRadioOption\addSubItem(), ilPageContentGUI\getTemplateOptions(), ilNumberInputGUI\setMaxLength(), ilSelectInputGUI\setOptions(), and ilRadioGroupInputGUI\setValue().

Referenced by create(), editProperties(), insert(), and update().

86  {
87  global $ilCtrl, $tpl, $lng;
88 
89  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
91 
92  // edit form
93  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
94  $this->form = new ilPropertyFormGUI();
95  $this->form->setFormAction($ilCtrl->getFormAction($this));
96  if ($a_mode != "edit")
97  {
98  $this->form->setTitle($lng->txt("cont_ed_insert_tabs"));
99  }
100  else
101  {
102  $this->form->setTitle($lng->txt("cont_edit_tabs"));
103  }
104 
105  // tabs type
106  /*$type_prop = new ilSelectInputGUI($lng->txt("cont_type"),
107  "type");
108  $types = array(ilPCTabs::ACCORDION_VER => $lng->txt("cont_tabs_acc_ver"),
109  ilPCTabs::ACCORDION_HOR => $lng->txt("cont_tabs_acc_hor"));
110  $type_prop->setOptions($types);
111  $this->form->addItem($type_prop);*/
112 
113  $templ = $this->getTemplateOptions("vaccordion");
114 
115  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
116  $vchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"),
117  "vaccord_templ");
118 
119  $vchars = array();
120  foreach($templ as $k => $te)
121  {
122  $t = explode(":", $k);
123  $html = $this->style->lookupTemplatePreview($t[1]).'<div style="clear:both" class="small">'.$te."</div>";
124  $vchar_prop->addOption($k, $te, $html);
125  if ($t[2] == "VerticalAccordion")
126  {
127  $vchar_prop->setValue($k);
128  }
129  }
130 
131  $templ = $this->getTemplateOptions("haccordion");
132  $hchar_prop = new ilAdvSelectInputGUI($this->lng->txt("cont_characteristic"),
133  "haccord_templ");
134  $hchars = array();
135  foreach($templ as $k => $te)
136  {
137  $t = explode(":", $k);
138  $html = $this->style->lookupTemplatePreview($t[1]).'<div style="clear:both" class="small">'.$te."</div>";
139  $hchar_prop->addOption($k, $te, $html);
140  if ($t[2] == "HorizontalAccordion")
141  {
142  $hchar_prop->setValue($k);
143  }
144  }
145 
146  $radg = new ilRadioGroupInputGUI($lng->txt("cont_type"), "type");
148  $op1 = new ilRadioOption($lng->txt("cont_tabs_acc_ver"), ilPCTabs::ACCORDION_VER);
149  $op1->addSubItem($vchar_prop);
150  $radg->addOption($op1);
151  $op2 = new ilRadioOption($lng->txt("cont_tabs_acc_hor"), ilPCTabs::ACCORDION_HOR);
152  $op2->addSubItem($hchar_prop);
153  $radg->addOption($op2);
154  $this->form->addItem($radg);
155 
156 
157  // number of initial tabs
158  if ($a_mode == "create")
159  {
160  $nr_prop = new ilSelectInputGUI($lng->txt("cont_number_of_tabs"),
161  "nr");
162  $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6,
163  7 => 7, 8 => 8, 9 => 9, 10 => 10);
164  $nr_prop->setOptions($nrs);
165  $this->form->addItem($nr_prop);
166  }
167 
168  $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_width"), "content_width");
169  $ni->setMaxLength(4);
170  $ni->setSize(4);
171  $this->form->addItem($ni);
172 
173  $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_height"), "content_height");
174  $ni->setMaxLength(4);
175  $ni->setSize(4);
176  $this->form->addItem($ni);
177 
178  // behaviour
179  $options = array(
180  "AllClosed" => $lng->txt("cont_all_closed"),
181  "FirstOpen" => $lng->txt("cont_first_open"),
182  "ForceAllOpen" => $lng->txt("cont_force_all_open"),
183  );
184  $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "behavior");
185  $si->setOptions($options);
186  $this->form->addItem($si);
187 
188 
189  // alignment
190  $align_opts = array("Left" => $lng->txt("cont_left"),
191  "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
192  "LeftFloat" => $lng->txt("cont_left_float"),
193  "RightFloat" => $lng->txt("cont_right_float"));
194  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align");
195  $align->setOptions($align_opts);
196  $align->setValue("Center");
197  $align->setInfo($lng->txt("cont_tabs_hor_align_info"));
198  $this->form->addItem($align);
199 
200  // save/cancel buttons
201  if ($a_mode == "create")
202  {
203  $this->form->addCommandButton("create_section", $lng->txt("save"));
204  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
205  }
206  else
207  {
208  $this->form->addCommandButton("update", $lng->txt("save"));
209  $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
210  }
211  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
getTemplateOptions($a_type)
Get table templates.
global $ilCtrl
Definition: ilias.php:18
const ACCORDION_HOR
This class represents a property in a property form.
static addCss()
Add required css.
if(!is_array($argv)) $options
addSubItem($a_item)
Add Subitem.
This class represents a number property in a property form.
const ACCORDION_VER
setOptions($a_options)
Set Options.
setMaxLength($a_maxlength)
Set Max Length.
This class represents an advanced selection list property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCTabsGUI::insert (   $a_omit_form_init = false)

Insert new tabs.

Definition at line 52 of file class.ilPCTabsGUI.php.

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), and initForm().

Referenced by create().

53  {
54  global $tpl;
55 
56  $this->displayValidationError();
57 
58  if (!$a_omit_form_init)
59  {
60  $this->initForm("create");
61  }
62  $html = $this->form->getHTML();
63  $tpl->setContent($html);
64  }
displayValidationError()
display validation errors
initForm($a_mode="edit")
Insert tabs form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTabs()

ilPCTabsGUI::saveTabs ( )

Save tabs properties in db and return to page edit screen.

Definition at line 374 of file class.ilPCTabsGUI.php.

References $_POST, $ilCtrl, ilPageContentGUI\$lng, ilUtil\sendSuccess(), and ilUtil\stripSlashesArray().

375  {
376  global $ilCtrl, $lng;
377 
378  if (is_array($_POST["caption"]))
379  {
380  $captions = ilUtil::stripSlashesArray($_POST["caption"]);
381  $this->content_obj->saveCaptions($captions);
382  }
383  if (is_array($_POST["position"]))
384  {
385  $positions = ilUtil::stripSlashesArray($_POST["position"]);
386  $this->content_obj->savePositions($positions);
387  }
388  $this->updated = $this->pg_obj->update();
389  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
390  $ilCtrl->redirect($this, "edit");
391  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
+ Here is the call graph for this function:

◆ setTabs()

ilPCTabsGUI::setTabs ( )

Set tabs.

Definition at line 474 of file class.ilPCTabsGUI.php.

References $ilCtrl, and ilPageContentGUI\$lng.

Referenced by confirmTabsDeletion(), edit(), and editProperties().

475  {
476  global $ilTabs, $ilCtrl, $lng;
477 
478  $ilTabs->setBackTarget($lng->txt("pg"),
479  $this->ctrl->getParentReturn($this));
480 
481  $ilTabs->addTarget("cont_tabs",
482  $ilCtrl->getLinkTarget($this, "edit"), "edit",
483  get_class($this));
484 
485  $ilTabs->addTarget("cont_edit_tabs",
486  $ilCtrl->getLinkTarget($this, "editProperties"), "editProperties",
487  get_class($this));
488 
489  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ update()

ilPCTabsGUI::update ( )

Save tabs properties in db and return to page edit screen.

Definition at line 315 of file class.ilPCTabsGUI.php.

References $_POST, $t, ilPCTabs\ACCORDION_HOR, ilPCTabs\ACCORDION_VER, editProperties(), initForm(), and ilUtil\stripSlashes().

316  {
317  $this->initForm();
318  if ($this->form->checkInput())
319  {
320  $this->content_obj->setTabType(ilUtil::stripSlashes($_POST["type"]));
321  $this->content_obj->setContentWidth($_POST["content_width"]);
322  $this->content_obj->setContentHeight($_POST["content_height"]);
323  $this->content_obj->setHorizontalAlign($_POST["align"]);
324  $this->content_obj->setTemplate("");
325  $this->content_obj->setBehavior($_POST["behavior"]);
326  if ($_POST["type"] == ilPCTabs::ACCORDION_VER)
327  {
328  $t = explode(":", $_POST["vaccord_templ"]);
329  $this->content_obj->setTemplate($t[2]);
330  }
331  if ($_POST["type"] == ilPCTabs::ACCORDION_HOR)
332  {
333  $t = explode(":", $_POST["haccord_templ"]);
334  $this->content_obj->setTemplate($t[2]);
335  }
336  }
337  $this->updated = $this->pg_obj->update();
338  if ($this->updated === true)
339  {
340  $this->ctrl->returnToParent($this, "jump".$this->hier_id);
341  }
342  else
343  {
344  $this->pg_obj->addHierIDs();
345  $this->editProperties();
346  }
347  }
$_POST['username']
Definition: cron.php:12
const ACCORDION_HOR
const ACCORDION_VER
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
editProperties()
Edit tabs.
initForm($a_mode="edit")
Insert tabs form.
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: