ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilPCTabsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 
 insert (bool $a_omit_form_init=false)
 Insert new tabs. More...
 
 editProperties (bool $init_form=true)
 
 initForm (string $a_mode="edit")
 
 initCreationForm ()
 
 initEditingForm ()
 
 getFormValues ()
 
 create ()
 
 afterCreation ()
 
 setPropertiesByForm ()
 
 update ()
 
 edit ()
 
 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 ()
 
 cancelTabDeletion ()
 
 deleteTabs ()
 
 setTabs ()
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 displayValidationError ()
 
 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 (string $a_type="")
 Get table templates. More...
 

Protected Member Functions

 checkWidthHeight (ilPropertyFormGUI $form)
 
 getCaptionForm (string $caption="")
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

Protected Attributes

ILIAS COPage PC PCDefinition $pc_def
 
ILIAS COPage Xsl XslManager $xsl
 
ilPropertyFormGUI $form
 
ilDBInterface $db
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $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 array $common_bb_buttons
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning User Interface for Tabbed Content

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilPCTabsGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

37  {
38  global $DIC;
39 
40  $this->tpl = $DIC["tpl"];
41  $this->ctrl = $DIC->ctrl();
42  $this->lng = $DIC->language();
43  $this->db = $DIC->database();
44  $this->tabs = $DIC->tabs();
45  $this->toolbar = $DIC->toolbar();
46  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
47  $this->xsl = $DIC->copage()->internal()->domain()->xsl();
48  $this->pc_def = $DIC->copage()->internal()->domain()->pc()->definition();
49  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ 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 479 of file class.ilPCTabsGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilCtrl\redirect(), and ilLanguage\txt().

479  : void
480  {
481  $lng = $this->lng;
482  $ilCtrl = $this->ctrl;
483 
484  $this->content_obj->addTab($lng->txt("cont_new_tab"));
485  $this->updated = $this->pg_obj->update();
486 
487  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_added_tab"), true);
488  $ilCtrl->redirect($this, "edit");
489  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ afterCreation()

ilPCTabsGUI::afterCreation ( )

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

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

Referenced by create().

372  : void
373  {
374  $ilCtrl = $this->ctrl;
375 
376  $this->pg_obj->stripHierIDs();
377  $this->pg_obj->addHierIDs();
378  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
379  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
380  $this->content_obj->setHierId($this->content_obj->readHierId());
381  $this->setHierId($this->content_obj->readHierId());
382  $this->content_obj->setPcId($this->content_obj->readPCId());
383  $this->edit();
384  }
setHierId(string $a_hier_id)
set hierarchical id in dom object
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelTabDeletion()

ilPCTabsGUI::cancelTabDeletion ( )

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

References ilPageContentGUI\$ctrl, and ilCtrl\redirect().

523  : void
524  {
525  $ilCtrl = $this->ctrl;
526  $ilCtrl->redirect($this, "edit");
527  }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ checkWidthHeight()

ilPCTabsGUI::checkWidthHeight ( ilPropertyFormGUI  $form)
protected

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

References ilPCTabs\ACCORDION_HOR, ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), and ILIAS\Repository\lng().

Referenced by create(), and update().

326  : bool
327  {
328  $ok = true;
329  if ($form->getInput("type") === ilPCTabs::ACCORDION_HOR) {
330  if ($form->getInput("content_width") == "") {
331  $form->getItemByPostVar("content_width")
332  ->setAlert($this->lng->txt("cont_hacc_needs_width"));
333  $ok = false;
334  }
335  if ($form->getInput("content_height") == "") {
336  $form->getItemByPostVar("content_height")
337  ->setAlert($this->lng->txt("cont_hacc_needs_height"));
338  $ok = false;
339  }
340  }
341  return $ok;
342  }
getItemByPostVar(string $a_post_var)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
const ACCORDION_HOR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmTabsDeletion()

ilPCTabsGUI::confirmTabsDeletion ( )

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

References ilPageContentGUI\$ctrl, $id, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

491  : void
492  {
493  $ilCtrl = $this->ctrl;
494  $tpl = $this->tpl;
495  $lng = $this->lng;
496 
497  $this->setTabs();
498 
499  $tids = $this->request->getStringArray("tid");
500  if (count($tids) == 0) {
501  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
502  $ilCtrl->redirect($this, "edit");
503  } else {
504  $cgui = new ilConfirmationGUI();
505  $cgui->setFormAction($ilCtrl->getFormAction($this));
506  $cgui->setHeaderText($lng->txt("cont_tabs_confirm_deletion"));
507  $cgui->setCancel($lng->txt("cancel"), "cancelTabDeletion");
508  $cgui->setConfirm($lng->txt("delete"), "deleteTabs");
509 
510  foreach ($tids as $k => $i) {
511  $id = explode(":", $k);
512  $cgui->addItem(
513  "tid[]",
514  $k,
515  $this->content_obj->getCaption($id[0], $id[1])
516  );
517  }
518 
519  $tpl->setContent($cgui->getHTML());
520  }
521  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ create()

ilPCTabsGUI::create ( )

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

References ilPageContentGUI\$lng, afterCreation(), checkWidthHeight(), ILIAS\Repository\form(), ilPageContentGUI\getPage(), initForm(), insert(), setPropertiesByForm(), and ilLanguage\txt().

344  : void
345  {
346  $lng = $this->lng;
347 
348  $this->initForm("create");
349  if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
350  $this->content_obj = new ilPCTabs($this->getPage());
351  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
352 
353  $this->setPropertiesByForm();
354 
355  for ($i = 0; $i < $this->request->getInt("nr"); $i++) {
356  $this->content_obj->addTab($lng->txt("cont_new_tab"));
357  }
358 
359  $this->updated = $this->pg_obj->update();
360 
361  if ($this->updated === true) {
362  $this->afterCreation();
363  } else {
364  $this->insert();
365  }
366  } else {
367  $this->form->setValuesByPost();
368  $this->insert(true);
369  }
370  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
insert(bool $a_omit_form_init=false)
Insert new tabs.
checkWidthHeight(ilPropertyFormGUI $form)
initForm(string $a_mode="edit")
form( $class_path, string $cmd, string $submit_caption="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deleteTabs()

ilPCTabsGUI::deleteTabs ( )

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

References ilPageContentGUI\$ctrl.

529  : void
530  {
531  $ilCtrl = $this->ctrl;
532 
533  $tids = $this->request->getStringArray("tid");
534  foreach ($tids as $tid) {
535  $ids = explode(":", $tid);
536  $this->content_obj->deleteTab($ids[0], $ids[1]);
537  }
538  $this->updated = $this->pg_obj->update();
539 
540  $ilCtrl->redirect($this, "edit");
541  }

◆ edit()

ilPCTabsGUI::edit ( )

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, $toolbar, ilPageContentGUI\$tpl, ilPageContentGUI\getEditorScriptTag(), ilPageContentGUI\initEditor(), ilGlobalTemplateInterface\setContent(), and ILIAS\Repository\tabs().

Referenced by afterCreation().

441  : void
442  {
443  $tpl = $this->tpl;
444  $ilTabs = $this->tabs;
445  $ilCtrl = $this->ctrl;
446  $ilToolbar = $this->toolbar;
447  $lng = $this->lng;
448 
449  $this->initEditor();
450  $this->tabs->setBackTarget("", "");
451 
452  $tpl->setContent($this->getTabPanels() . $this->getEditorScriptTag($this->pc_id, "Tabs"));
453  }
ilToolbarGUI $toolbar
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
getEditorScriptTag(string $form_pc_id="", string $form_cname="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editProperties()

ilPCTabsGUI::editProperties ( bool  $init_form = true)

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

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), getFormValues(), initForm(), ilGlobalTemplateInterface\setContent(), and setTabs().

Referenced by update().

83  : void
84  {
85  $tpl = $this->tpl;
86 
87  $this->displayValidationError();
88  $this->setTabs();
89 
90  if ($init_form) {
91  $this->initForm();
92  $this->getFormValues();
93  }
94  $html = $this->form->getHTML();
95  $tpl->setContent($html);
96  }
setContent(string $a_html)
Sets content for standard template.
initForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCTabsGUI::executeCommand ( )

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

References ILIAS\Repository\ctrl().

51  : void
52  {
53  // get next class that processes or forwards current command
54  $next_class = $this->ctrl->getNextClass($this);
55 
56  // get current command
57  $cmd = $this->ctrl->getCmd();
58 
59  switch ($next_class) {
60  default:
61  $this->$cmd();
62  break;
63  }
64  }
+ Here is the call graph for this function:

◆ getCaptionForm()

ilPCTabsGUI::getCaptionForm ( string  $caption = "")
protected

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

References ilPageContentGUI\$content_obj, ilPageContentGUI\$lng, $params, ilPageContentGUI\$pc_id, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilPageContentGUI\getPage(), ilFileUtils\getWebspaceDir(), and ILIAS\Repository\lng().

570  {
571  return $this->gui->form([self::class], "saveCaption")
572  ->text("caption", $this->lng->txt("title"), "", $caption);
573  }
text(string $key, string $title, string $description="", ?string $value=null)
+ Here is the call graph for this function:

◆ getFormValues()

ilPCTabsGUI::getFormValues ( )

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

References ilObjStyleSheet\_lookupTemplateIdByName(), ilPCTabs\ACCORDION_VER, ilPCTabs\CAROUSEL, ILIAS\Repository\form(), and ilPageContentGUI\getStyleId().

Referenced by editProperties(), and initEditingForm().

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

◆ initCreationForm()

ilPCTabsGUI::initCreationForm ( )

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

References $form, and initForm().

Referenced by ilPCTabsEditorGUI\getEditorElements().

275  {
276  $this->initForm("create");
277  return $this->form;
278  }
initForm(string $a_mode="edit")
ilPropertyFormGUI $form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditingForm()

ilPCTabsGUI::initEditingForm ( )

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

References $form, getFormValues(), and initForm().

281  {
282  $this->initForm("edit");
283  $this->getFormValues();
284  return $this->form;
285  }
initForm(string $a_mode="edit")
ilPropertyFormGUI $form
+ Here is the call graph for this function:

◆ initForm()

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

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPCTabs\ACCORDION_VER, ilAccordionGUI\addCss(), ilPCTabs\CAROUSEL, ILIAS\Repository\form(), ilPageContentGUI\getTemplateOptions(), ILIAS\Repository\lng(), ilSelectInputGUI\setOptions(), ilRadioGroupInputGUI\setValue(), and ilLanguage\txt().

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

100  : void {
101  $ilCtrl = $this->ctrl;
102  $lng = $this->lng;
103 
105 
106  // edit form
107  $this->form = new ilPropertyFormGUI();
108  $this->form->setShowTopButtons(false);
109  $this->form->setFormAction($ilCtrl->getFormAction($this));
110  if ($a_mode != "edit") {
111  $this->form->setTitle($lng->txt("cont_ed_insert_tabs"));
112  } else {
113  $this->form->setTitle($lng->txt("cont_edit_tabs"));
114  }
115 
116 
117  // type selection
118  $radg = new ilRadioGroupInputGUI($lng->txt("cont_type"), "type");
120 
121  // type: vertical accordion
122  $op1 = new ilRadioOption($lng->txt("cont_tabs_acc_ver"), ilPCTabs::ACCORDION_VER);
123  $templ = $this->getTemplateOptions("vaccordion");
124  if (count($templ) > 0) {
125 
126  $options = [];
127  foreach ($templ as $k => $te) {
128  $options[$k] = $te;
129  }
130  $vchar_prop = new ilSelectInputGUI($this->lng->txt("cont_characteristic"), "vaccord_templ");
131  $vchar_prop->setOptions($options);
132  $op1->addSubItem($vchar_prop);
133 
134 
135  } else {
136  $vchar_prop = new ilHiddenInputGUI("vaccord_templ");
137  $this->form->addItem($vchar_prop);
138  }
139  $radg->addOption($op1);
140 
141 
142 
143  // type: horizontal accordion
144  /*
145  $op2 = new ilRadioOption($lng->txt("cont_tabs_acc_hor"), ilPCTabs::ACCORDION_HOR);
146 
147  $templ = $this->getTemplateOptions("haccordion");
148  if (count($templ) > 0) {
149  $hchar_prop = new ilAdvSelectInputGUI(
150  $this->lng->txt("cont_characteristic"),
151  "haccord_templ"
152  );
153  foreach ($templ as $k => $te) {
154  $t = explode(":", $k);
155  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
156  $hchar_prop->addOption($k, $te, $html);
157  if ($t[2] == "HorizontalAccordion") {
158  $hchar_prop->setValue($k);
159  }
160  }
161  $op2->addSubItem($hchar_prop);
162  } else {
163  $hchar_prop = new ilHiddenInputGUI("haccord_templ");
164  $this->form->addItem($hchar_prop);
165  }
166 
167  $radg->addOption($op2);*/
168 
169  // type: carousel
170  $op3 = new ilRadioOption($lng->txt("cont_tabs_carousel"), ilPCTabs::CAROUSEL);
171  $templ = $this->getTemplateOptions("carousel");
172  if (count($templ) > 0) {
173  $cchar_prop = new ilAdvSelectInputGUI(
174  $this->lng->txt("cont_characteristic"),
175  "carousel_templ"
176  );
177  foreach ($templ as $k => $te) {
178  $t = explode(":", $k);
179  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both" class="small">' . $te . "</div>";
180  $cchar_prop->addOption($k, $te, $html);
181  if ($t[2] == "Carousel") {
182  $cchar_prop->setValue($k);
183  }
184  }
185  $op3->addSubItem($cchar_prop);
186  } else {
187  $cchar_prop = new ilHiddenInputGUI("carousel_templ");
188  $this->form->addItem($cchar_prop);
189  }
190 
191  $radg->addOption($op3);
192  $this->form->addItem($radg);
193 
194 
195  // number of initial tabs
196  if ($a_mode == "create") {
197  $nr_prop = new ilSelectInputGUI(
198  $lng->txt("cont_number_of_tabs"),
199  "nr"
200  );
201  $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6,
202  7 => 7, 8 => 8, 9 => 9, 10 => 10);
203  $nr_prop->setOptions($nrs);
204  $this->form->addItem($nr_prop);
205  }
206 
207  /*
208  $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_width"), "content_width");
209  $ni->setMaxLength(4);
210  $ni->setSize(4);
211  $this->form->addItem($ni);
212 
213  $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_height"), "content_height");
214  $ni->setMaxLength(4);
215  $ni->setSize(4);
216  $this->form->addItem($ni);*/
217 
218  // behaviour
219  $options = array(
220  "AllClosed" => $lng->txt("cont_all_closed"),
221  "FirstOpen" => $lng->txt("cont_first_open"),
222  "ForceAllOpen" => $lng->txt("cont_force_all_open"),
223  );
224  $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "vbehavior");
225  $si->setOptions($options);
226  $op1->addSubItem($si);
227  /*
228  $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "hbehavior");
229  $si->setOptions($options);
230  $op2->addSubItem($si);*/
231 
232 
233  // alignment
234  /*
235  $align_opts = array("Left" => $lng->txt("cont_left"),
236  "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
237  "LeftFloat" => $lng->txt("cont_left_float"),
238  "RightFloat" => $lng->txt("cont_right_float"));
239  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "valign");
240  $align->setOptions($align_opts);
241  $align->setValue("Center");
242  //$align->setInfo($lng->txt("cont_tabs_hor_align_info"));
243  $op1->addSubItem($align);
244  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "calign");
245  $align->setOptions($align_opts);
246  $align->setValue("Center");
247  $op3->addSubItem($align);*/
248 
249  // carousel: time
250  $ti = new ilNumberInputGUI($this->lng->txt("cont_auto_time"), "auto_time");
251  $ti->setMaxLength(6);
252  $ti->setSize(6);
253  $ti->setSuffix("ms");
254  $ti->setMinValue(100);
255  $op3->addSubItem($ti);
256 
257  // carousel: random start
258  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_rand_start"), "rand_start");
259  //$cb->setOptionTitle($this->lng->txt(""));
260  //$cb->setInfo($this->lng->txt(""));
261  $op3->addSubItem($cb);
262 
263 
264  // save/cancel buttons
265  if ($a_mode == "create") {
266  $this->form->addCommandButton("create_section", $lng->txt("save"));
267  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
268  } else {
269  $this->form->addCommandButton("update", $lng->txt("save"));
270  $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
271  }
272  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setOptions(array $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
static addCss()
Add required css.
const ACCORDION_VER
form( $class_path, string $cmd, string $submit_caption="")
const CAROUSEL
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTemplateOptions(string $a_type="")
Get table templates.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCTabsGUI::insert ( bool  $a_omit_form_init = false)

Insert new tabs.

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

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), initForm(), and ilGlobalTemplateInterface\setContent().

Referenced by create().

71  : void {
72  $tpl = $this->tpl;
73 
74  $this->displayValidationError();
75 
76  if (!$a_omit_form_init) {
77  $this->initForm("create");
78  }
79  $html = $this->form->getHTML();
80  $tpl->setContent($html);
81  }
setContent(string $a_html)
Sets content for standard template.
initForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
+ 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 458 of file class.ilPCTabsGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, and ilLanguage\txt().

458  : void
459  {
460  $ilCtrl = $this->ctrl;
461  $lng = $this->lng;
462 
463  $captions = $this->request->getStringArray("caption");
464  $positions = $this->request->getStringArray("position");
465  if (count($captions) > 0) {
466  $this->content_obj->saveCaptions($captions);
467  }
468  if (count($positions)) {
469  $this->content_obj->savePositions($positions);
470  }
471  $this->updated = $this->pg_obj->update();
472  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
473  $ilCtrl->redirect($this, "edit");
474  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ setPropertiesByForm()

ilPCTabsGUI::setPropertiesByForm ( )

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

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

Referenced by create(), and update().

386  : void
387  {
389  $f = $this->form;
390 
391  $c->setTabType($f->getInput("type"));
392 
393  $c->setContentWidth((string) $f->getInput("content_width"));
394  $c->setContentHeight((string) $f->getInput("content_height"));
395  $c->setTemplate("");
396  switch ($this->request->getString("type")) {
398  $t = explode(":", $f->getInput("vaccord_templ"));
399  $c->setTemplate($t[2] ?? "");
400  $c->setBehavior($f->getInput("vbehavior"));
401  $c->setHorizontalAlign($f->getInput("valign"));
402  break;
403 
405  $t = explode(":", $f->getInput("haccord_templ"));
406  $c->setTemplate($t[2] ?? "");
407  $c->setBehavior($f->getInput("hbehavior"));
408  break;
409 
410  case ilPCTabs::CAROUSEL:
411  $t = explode(":", $f->getInput("carousel_templ"));
412  $c->setTemplate($t[2] ?? "");
413  $c->setHorizontalAlign($f->getInput("calign"));
414  $c->setAutoTime($f->getInput("auto_time"));
415  $c->setRandomStart($f->getInput("rand_start"));
416  break;
417  }
418  }
const ACCORDION_HOR
ilPropertyFormGUI $form
const ACCORDION_VER
const CAROUSEL
+ Here is the caller graph for this function:

◆ setTabs()

ilPCTabsGUI::setTabs ( )

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, ILIAS\Repository\ctrl(), and ilLanguage\txt().

Referenced by confirmTabsDeletion(), and editProperties().

543  : void
544  {
545  $ilTabs = $this->tabs;
546  $ilCtrl = $this->ctrl;
547  $lng = $this->lng;
548 
549  $ilTabs->setBackTarget(
550  $lng->txt("pg"),
551  $this->ctrl->getParentReturn($this)
552  );
553 
554  $ilTabs->addTarget(
555  "cont_tabs",
556  $ilCtrl->getLinkTarget($this, "edit"),
557  "edit",
558  get_class($this)
559  );
560 
561  $ilTabs->addTarget(
562  "cont_edit_tabs",
563  $ilCtrl->getLinkTarget($this, "editProperties"),
564  "editProperties",
565  get_class($this)
566  );
567  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilPCTabsGUI::update ( )

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

References checkWidthHeight(), ILIAS\Repository\ctrl(), editProperties(), ILIAS\Repository\form(), initForm(), ILIAS\Repository\lng(), and setPropertiesByForm().

420  : void
421  {
422  $this->initForm();
423  $this->updated = false;
424  if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
425  $this->setPropertiesByForm();
426  $this->updated = $this->pg_obj->update();
427  } else {
428  $this->form->setValuesByPost();
429  $this->editProperties(false);
430  return;
431  }
432  if ($this->updated === true) {
433  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
434  $this->ctrl->redirect($this, "editProperties");
435  } else {
436  $this->pg_obj->addHierIDs();
437  $this->editProperties(false);
438  }
439  }
editProperties(bool $init_form=true)
checkWidthHeight(ilPropertyFormGUI $form)
initForm(string $a_mode="edit")
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilPCTabsGUI::$db
protected

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

◆ $form

ilPropertyFormGUI ilPCTabsGUI::$form
protected

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

Referenced by initCreationForm(), initEditingForm(), and setPropertiesByForm().

◆ $pc_def

ILIAS COPage PC PCDefinition ilPCTabsGUI::$pc_def
protected

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

◆ $tabs

ilTabsGUI ilPCTabsGUI::$tabs
protected

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

Referenced by edit(), and setTabs().

◆ $toolbar

ilToolbarGUI ilPCTabsGUI::$toolbar
protected

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

Referenced by edit().

◆ $xsl

ILIAS COPage Xsl XslManager ilPCTabsGUI::$xsl
protected

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


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