ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCTabsGUI Class Reference

Class ilPCTabsGUI. More...

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

Public Member Functions

 __construct (&$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 (bool $omit_form_init=false)
 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...
 
 setPropertiesByForm ()
 Set properties by post. 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
 __construct ($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...
 
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. 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...
 

Protected Member Functions

 checkWidthHeight (ilPropertyFormGUI $form)
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent ($hier_id="")
 Redirect to parent. More...
 
 getParentReturn ($hier_id="")
 

Protected Attributes

 $db
 
 $tabs
 
 $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- 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.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

39  {
40  global $DIC;
41 
42  $this->tpl = $DIC["tpl"];
43  $this->ctrl = $DIC->ctrl();
44  $this->lng = $DIC->language();
45  $this->db = $DIC->database();
46  $this->tabs = $DIC->tabs();
47  $this->toolbar = $DIC->toolbar();
48  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
49  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addTab()

ilPCTabsGUI::addTab ( )

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

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

References ilPageContentGUI\$ctrl, and ilPageContentGUI\$lng.

518  {
519  $lng = $this->lng;
520  $ilCtrl = $this->ctrl;
521 
522  $this->content_obj->addTab($lng->txt("cont_new_tab"));
523  $this->updated = $this->pg_obj->update();
524 
525  ilUtil::sendSuccess($lng->txt("cont_added_tab"), true);
526  $ilCtrl->redirect($this, "edit");
527  }

◆ afterCreation()

ilPCTabsGUI::afterCreation ( )

After creation processing.

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

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

Referenced by create().

386  {
387  $ilCtrl = $this->ctrl;
388 
389  $this->pg_obj->stripHierIDs();
390  $this->pg_obj->addHierIDs();
391  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
392  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
393  $this->content_obj->setHierId($this->content_obj->readHierId());
394  $this->setHierId($this->content_obj->readHierId());
395  $this->content_obj->setPCId($this->content_obj->readPCId());
396  $this->edit();
397  }
edit()
List all tabs.
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 567 of file class.ilPCTabsGUI.php.

References ilPageContentGUI\$ctrl.

568  {
569  $ilCtrl = $this->ctrl;
570  $ilCtrl->redirect($this, "edit");
571  }

◆ checkWidthHeight()

ilPCTabsGUI::checkWidthHeight ( ilPropertyFormGUI  $form)
protected

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

References $ok, ilPCTabs\ACCORDION_HOR, ilPropertyFormGUI\getInput(), and ilPropertyFormGUI\getItemByPostVar().

Referenced by create(), and update().

330  : bool
331  {
332  $ok = true;
333  if ($form->getInput("type") === ilPCTabs::ACCORDION_HOR) {
334  if ($form->getInput("content_width") === "") {
335  $form->getItemByPostVar("content_width")
336  ->setAlert($this->lng->txt("cont_hacc_needs_width"));
337  $ok = false;
338  }
339  if ($form->getInput("content_height") === "") {
340  $form->getItemByPostVar("content_height")
341  ->setAlert($this->lng->txt("cont_hacc_needs_height"));
342  $ok = false;
343  }
344  }
345  return $ok;
346  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
const ACCORDION_HOR
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmTabsDeletion()

ilPCTabsGUI::confirmTabsDeletion ( )

Confirm tabs deletion.

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

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

533  {
534  $ilCtrl = $this->ctrl;
535  $tpl = $this->tpl;
536  $lng = $this->lng;
537 
538  $this->setTabs();
539 
540  if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0) {
541  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
542  $ilCtrl->redirect($this, "edit");
543  } else {
544  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
545  $cgui = new ilConfirmationGUI();
546  $cgui->setFormAction($ilCtrl->getFormAction($this));
547  $cgui->setHeaderText($lng->txt("cont_tabs_confirm_deletion"));
548  $cgui->setCancel($lng->txt("cancel"), "cancelTabDeletion");
549  $cgui->setConfirm($lng->txt("delete"), "deleteTabs");
550 
551  foreach ($_POST["tid"] as $k => $i) {
552  $id = explode(":", $k);
553  $cgui->addItem(
554  "tid[]",
555  $k,
556  $this->content_obj->getCaption($id[0], $id[1])
557  );
558  }
559 
560  $tpl->setContent($cgui->getHTML());
561  }
562  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
setTabs()
Set tabs.
$_POST["username"]
$i
Definition: metadata.php:24
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 351 of file class.ilPCTabsGUI.php.

References $_POST, $db, $i, $ilDB, ilPageContentGUI\$lng, afterCreation(), checkWidthHeight(), ilPageContentGUI\getPage(), initForm(), insert(), and setPropertiesByForm().

352  {
353  $ilDB = $this->db;
354  $lng = $this->lng;
355 
356  $this->initForm("create");
357  if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
358  $this->content_obj = new ilPCTabs($this->getPage());
359  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
360 
361  $this->setPropertiesByForm();
362 
363  for ($i = 0; $i < (int) $_POST["nr"]; $i++) {
364  $this->content_obj->addTab($lng->txt("cont_new_tab"));
365  }
366 
367  $this->updated = $this->pg_obj->update();
368 
369  if ($this->updated === true) {
370  $this->afterCreation();
371  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
372  } else {
373  $this->insert();
374  }
375  } else {
376  $this->form->setValuesByPost();
377  $this->insert(true);
378  // return $this->form->getHtml();
379  }
380  }
checkWidthHeight(ilPropertyFormGUI $form)
setPropertiesByForm()
Set properties by post.
afterCreation()
After creation processing.
insert($a_omit_form_init=false)
Insert new tabs.
global $ilDB
Class ilPCTabs.
$_POST["username"]
initForm($a_mode="edit")
Insert tabs form.
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ deleteTabs()

ilPCTabsGUI::deleteTabs ( )

Delete Tabs.

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

References $_POST, and ilPageContentGUI\$ctrl.

577  {
578  $ilCtrl = $this->ctrl;
579 
580  if (is_array($_POST["tid"])) {
581  foreach ($_POST["tid"] as $tid) {
582  $ids = explode(":", $tid);
583  $this->content_obj->deleteTab($ids[0], $ids[1]);
584  }
585  }
586  $this->updated = $this->pg_obj->update();
587 
588  $ilCtrl->redirect($this, "edit");
589  }
$_POST["username"]

◆ edit()

ilPCTabsGUI::edit ( )

List all tabs.

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, $toolbar, ilPageContentGUI\$tpl, and setTabs().

Referenced by afterCreation().

474  {
475  $tpl = $this->tpl;
476  $ilTabs = $this->tabs;
477  $ilCtrl = $this->ctrl;
478  $ilToolbar = $this->toolbar;
479  $lng = $this->lng;
480 
481  $ilToolbar->addButton(
482  $lng->txt("cont_add_tab"),
483  $ilCtrl->getLinkTarget($this, "addTab")
484  );
485 
486  $this->setTabs();
487  $ilTabs->activateTab("cont_tabs");
488  include_once("./Services/COPage/classes/class.ilPCTabsTableGUI.php");
489  $table_gui = new ilPCTabsTableGUI($this, "edit", $this->content_obj);
490  $tpl->setContent($table_gui->getHTML());
491  }
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 ( bool  $omit_form_init = false)

Edit tabs.

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

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

Referenced by update().

91  {
92  $ilCtrl = $this->ctrl;
93  $lng = $this->lng;
94  $tpl = $this->tpl;
95 
96  $this->displayValidationError();
97  $this->setTabs();
98 
99  if (!$omit_form_init) {
100  $this->initForm();
101  $this->getFormValues();
102  }
103  $html = $this->form->getHTML();
104  $tpl->setContent($html);
105  }
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 54 of file class.ilPCTabsGUI.php.

References $ret.

55  {
56  // get next class that processes or forwards current command
57  $next_class = $this->ctrl->getNextClass($this);
58 
59  // get current command
60  $cmd = $this->ctrl->getCmd();
61 
62  switch ($next_class) {
63  default:
64  $ret = $this->$cmd();
65  break;
66  }
67 
68  return $ret;
69  }
$ret
Definition: parser.php:6

◆ getFormValues()

ilPCTabsGUI::getFormValues ( )

Get form values.

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

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

Referenced by editProperties().

293  {
294  $values["type"] = $this->content_obj->getTabType();
295  $values["content_width"] = $this->content_obj->getContentWidth();
296  $values["content_height"] = $this->content_obj->getContentHeight();
297  $values["valign"] = $this->content_obj->getHorizontalAlign();
298  $values["calign"] = $this->content_obj->getHorizontalAlign();
299  $values["vbehavior"] = $this->content_obj->getBehavior();
300  $values["hbehavior"] = $this->content_obj->getBehavior();
301 
302  $values["auto_time"] = $this->content_obj->getAutoTime();
303  $values["rand_start"] = $this->content_obj->getRandomStart();
304 
305  $this->form->setValuesByArray($values);
306 
307  if ($values["type"] == ilPCTabs::ACCORDION_VER) {
308  $va = $this->form->getItemByPostVar("vaccord_templ");
309  $v = "t:" .
310  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
311  $this->content_obj->getTemplate();
312  $va->setValue($v);
313  }
314  if ($values["type"] == ilPCTabs::ACCORDION_HOR) {
315  $ha = $this->form->getItemByPostVar("haccord_templ");
316  $v = "t:" .
317  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
318  $this->content_obj->getTemplate();
319  $ha->setValue($v);
320  }
321  if ($values["type"] == ilPCTabs::CAROUSEL) {
322  $ca = $this->form->getItemByPostVar("carousel_templ");
323  $v = "t:" .
324  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
325  $this->content_obj->getTemplate();
326  $ca->setValue($v);
327  }
328  }
static _lookupTemplateIdByName($a_style_id, $a_name)
Lookup table template preview.
const ACCORDION_HOR
const ACCORDION_VER
getStyleId()
Get Style Id.
const CAROUSEL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

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

Insert tabs form.

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $si, ilPageContentGUI\$tpl, ilPCTabs\ACCORDION_HOR, ilPCTabs\ACCORDION_VER, ilAccordionGUI\addCss(), ilSubEnabledFormPropertyGUI\addSubItem(), ilPCTabs\CAROUSEL, ilPageContentGUI\getTemplateOptions(), ilNumberInputGUI\setMaxLength(), and ilRadioGroupInputGUI\setValue().

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

111  {
112  $ilCtrl = $this->ctrl;
113  $tpl = $this->tpl;
114  $lng = $this->lng;
115 
116  include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
118 
119  // edit form
120  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
121  $this->form = new ilPropertyFormGUI();
122  $this->form->setFormAction($ilCtrl->getFormAction($this));
123  if ($a_mode != "edit") {
124  $this->form->setTitle($lng->txt("cont_ed_insert_tabs"));
125  } else {
126  $this->form->setTitle($lng->txt("cont_edit_tabs"));
127  }
128 
129 
130  // type selection
131  $radg = new ilRadioGroupInputGUI($lng->txt("cont_type"), "type");
133 
134  // type: vertical accordion
135  $op1 = new ilRadioOption($lng->txt("cont_tabs_acc_ver"), ilPCTabs::ACCORDION_VER);
136 
137  $templ = $this->getTemplateOptions("vaccordion");
138  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
139  if (count($templ) > 0) {
140  $vchar_prop = new ilAdvSelectInputGUI(
141  $this->lng->txt("cont_characteristic"),
142  "vaccord_templ"
143  );
144  foreach ($templ as $k => $te) {
145  $t = explode(":", $k);
146  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
147  $vchar_prop->addOption($k, $te, $html);
148  if ($t[2] == "VerticalAccordion") {
149  $vchar_prop->setValue($k);
150  }
151  }
152  $op1->addSubItem($vchar_prop);
153  } else {
154  $vchar_prop = new ilHiddenInputGUI("vaccord_templ");
155  $this->form->addItem($vchar_prop);
156  }
157  $radg->addOption($op1);
158 
159 
160 
161  // type: horizontal accordion
162  $op2 = new ilRadioOption($lng->txt("cont_tabs_acc_hor"), ilPCTabs::ACCORDION_HOR);
163 
164  $templ = $this->getTemplateOptions("haccordion");
165  if (count($templ) > 0) {
166  $hchar_prop = new ilAdvSelectInputGUI(
167  $this->lng->txt("cont_characteristic"),
168  "haccord_templ"
169  );
170  foreach ($templ as $k => $te) {
171  $t = explode(":", $k);
172  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
173  $hchar_prop->addOption($k, $te, $html);
174  if ($t[2] == "HorizontalAccordion") {
175  $hchar_prop->setValue($k);
176  }
177  }
178  $op2->addSubItem($hchar_prop);
179  } else {
180  $hchar_prop = new ilHiddenInputGUI("haccord_templ");
181  $this->form->addItem($hchar_prop);
182  }
183 
184  $radg->addOption($op2);
185 
186  // type: carousel
187  $op3 = new ilRadioOption($lng->txt("cont_tabs_carousel"), ilPCTabs::CAROUSEL);
188  $templ = $this->getTemplateOptions("carousel");
189  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
190  if (count($templ) > 0) {
191  $cchar_prop = new ilAdvSelectInputGUI(
192  $this->lng->txt("cont_characteristic"),
193  "carousel_templ"
194  );
195  foreach ($templ as $k => $te) {
196  $t = explode(":", $k);
197  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
198  $cchar_prop->addOption($k, $te, $html);
199  if ($t[2] == "Carousel") {
200  $cchar_prop->setValue($k);
201  }
202  }
203  $op3->addSubItem($cchar_prop);
204  } else {
205  $cchar_prop = new ilHiddenInputGUI("carousel_templ");
206  $this->form->addItem($cchar_prop);
207  }
208 
209  $radg->addOption($op3);
210  $this->form->addItem($radg);
211 
212 
213  // number of initial tabs
214  if ($a_mode == "create") {
215  $nr_prop = new ilSelectInputGUI(
216  $lng->txt("cont_number_of_tabs"),
217  "nr"
218  );
219  $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6,
220  7 => 7, 8 => 8, 9 => 9, 10 => 10);
221  $nr_prop->setOptions($nrs);
222  $this->form->addItem($nr_prop);
223  }
224 
225  $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_width"), "content_width");
226  $ni->setMaxLength(4);
227  $ni->setSize(4);
228  $this->form->addItem($ni);
229 
230  $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_height"), "content_height");
231  $ni->setMaxLength(4);
232  $ni->setSize(4);
233  $this->form->addItem($ni);
234 
235  // behaviour
236  $options = array(
237  "AllClosed" => $lng->txt("cont_all_closed"),
238  "FirstOpen" => $lng->txt("cont_first_open"),
239  "ForceAllOpen" => $lng->txt("cont_force_all_open"),
240  );
241  $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "vbehavior");
242  $si->setOptions($options);
243  $op1->addSubItem($si);
244  $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "hbehavior");
245  $si->setOptions($options);
246  $op2->addSubItem($si);
247 
248 
249  // alignment
250  $align_opts = array("Left" => $lng->txt("cont_left"),
251  "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
252  "LeftFloat" => $lng->txt("cont_left_float"),
253  "RightFloat" => $lng->txt("cont_right_float"));
254  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "valign");
255  $align->setOptions($align_opts);
256  $align->setValue("Center");
257  //$align->setInfo($lng->txt("cont_tabs_hor_align_info"));
258  $op1->addSubItem($align);
259  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "calign");
260  $align->setOptions($align_opts);
261  $align->setValue("Center");
262  $op3->addSubItem($align);
263 
264  // carousel: time
265  $ti = new ilNumberInputGUI($this->lng->txt("cont_auto_time"), "auto_time");
266  $ti->setMaxLength(6);
267  $ti->setSize(6);
268  $ti->setSuffix("ms");
269  $ti->setMinValue(100);
270  $op3->addSubItem($ti);
271 
272  // carousel: random start
273  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_rand_start"), "rand_start");
274  //$cb->setOptionTitle($this->lng->txt(""));
275  //$cb->setInfo($this->lng->txt(""));
276  $op3->addSubItem($cb);
277 
278 
279  // save/cancel buttons
280  if ($a_mode == "create") {
281  $this->form->addCommandButton("create_section", $lng->txt("save"));
282  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
283  } else {
284  $this->form->addCommandButton("update", $lng->txt("save"));
285  $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
286  }
287  }
This class represents an option in a radio group.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
getTemplateOptions($a_type)
Get table templates.
const ACCORDION_HOR
This class represents a hidden form property in a property form.
This class represents a property in a property form.
static addCss()
Add required css.
This class represents a number property in a property form.
const ACCORDION_VER
setMaxLength($a_maxlength)
Set Max Length.
const CAROUSEL
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 74 of file class.ilPCTabsGUI.php.

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

Referenced by create().

75  {
76  $tpl = $this->tpl;
77 
78  $this->displayValidationError();
79 
80  if (!$a_omit_form_init) {
81  $this->initForm("create");
82  }
83  $html = $this->form->getHTML();
84  $tpl->setContent($html);
85  }
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 496 of file class.ilPCTabsGUI.php.

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

497  {
498  $ilCtrl = $this->ctrl;
499  $lng = $this->lng;
500 
501  if (is_array($_POST["caption"])) {
502  $captions = ilUtil::stripSlashesArray($_POST["caption"]);
503  $this->content_obj->saveCaptions($captions);
504  }
505  if (is_array($_POST["position"])) {
506  $positions = ilUtil::stripSlashesArray($_POST["position"]);
507  $this->content_obj->savePositions($positions);
508  }
509  $this->updated = $this->pg_obj->update();
510  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
511  $ilCtrl->redirect($this, "edit");
512  }
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
$_POST["username"]
+ Here is the call graph for this function:

◆ setPropertiesByForm()

ilPCTabsGUI::setPropertiesByForm ( )

Set properties by post.

Parameters

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

References $_POST, $c, ilPageContentGUI\$content_obj, Vendor\Package\$f, ilPCTabs\ACCORDION_HOR, ilPCTabs\ACCORDION_VER, and ilPCTabs\CAROUSEL.

Referenced by create(), and update().

406  {
408  $f = $this->form;
409 
410  $c->setTabType($f->getInput("type"));
411 
412  $c->setContentWidth($f->getInput("content_width"));
413  $c->setContentHeight($f->getInput("content_height"));
414  $c->setTemplate("");
415  switch ($_POST["type"]) {
417  $t = explode(":", $f->getInput("vaccord_templ"));
418  $c->setTemplate($t[2]);
419  $c->setBehavior($f->getInput("vbehavior"));
420  $c->setHorizontalAlign($f->getInput("valign"));
421  break;
422 
424  $t = explode(":", $f->getInput("haccord_templ"));
425  $c->setTemplate($t[2]);
426  $c->setBehavior($f->getInput("hbehavior"));
427  break;
428 
429  case ilPCTabs::CAROUSEL:
430  $t = explode(":", $f->getInput("carousel_templ"));
431  $c->setTemplate($t[2]);
432  $c->setHorizontalAlign($f->getInput("calign"));
433  $c->setAutoTime($f->getInput("auto_time"));
434  $c->setRandomStart($f->getInput("rand_start"));
435  break;
436  }
437  }
$c
Definition: cli.php:37
const ACCORDION_HOR
const ACCORDION_VER
const CAROUSEL
$_POST["username"]
+ Here is the caller graph for this function:

◆ setTabs()

ilPCTabsGUI::setTabs ( )

Set tabs.

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, and $tabs.

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

596  {
597  $ilTabs = $this->tabs;
598  $ilCtrl = $this->ctrl;
599  $lng = $this->lng;
600 
601  $ilTabs->setBackTarget(
602  $lng->txt("pg"),
603  $this->ctrl->getParentReturn($this)
604  );
605 
606  $ilTabs->addTarget(
607  "cont_tabs",
608  $ilCtrl->getLinkTarget($this, "edit"),
609  "edit",
610  get_class($this)
611  );
612 
613  $ilTabs->addTarget(
614  "cont_edit_tabs",
615  $ilCtrl->getLinkTarget($this, "editProperties"),
616  "editProperties",
617  get_class($this)
618  );
619  }
+ 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 443 of file class.ilPCTabsGUI.php.

References checkWidthHeight(), editProperties(), initForm(), and setPropertiesByForm().

444  {
445  $this->initForm();
446  $this->updated = false;
447  if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
448  $this->setPropertiesByForm();
449  $this->updated = $this->pg_obj->update();
450  } else {
451  $this->form->setValuesByPost();
452  $this->editProperties(true);
453  return;
454  }
455  if ($this->updated === true) {
456  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
457  $this->ctrl->redirect($this, "editProperties");
458  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
459  } else {
460  $this->pg_obj->addHierIDs();
461  $this->editProperties();
462  }
463  }
checkWidthHeight(ilPropertyFormGUI $form)
editProperties(bool $omit_form_init=false)
Edit tabs.
setPropertiesByForm()
Set properties by post.
initForm($a_mode="edit")
Insert tabs form.
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilPCTabsGUI::$db
protected

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

Referenced by create().

◆ $tabs

ilPCTabsGUI::$tabs
protected

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

Referenced by edit(), and setTabs().

◆ $toolbar

ilPCTabsGUI::$toolbar
protected

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

Referenced by edit().


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