ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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")
 
 getFormValues ()
 
 create ()
 
 afterCreation ()
 
 setPropertiesByForm ()
 
 update ()
 
 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 ()
 
 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 ()
 
 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)
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 

Protected Attributes

ilPropertyFormGUI $form
 
ilDBInterface $db
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
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
 
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 = ""
 
php4DOMDocument $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 30 of file class.ilPCTabsGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

35  {
36  global $DIC;
37 
38  $this->tpl = $DIC["tpl"];
39  $this->ctrl = $DIC->ctrl();
40  $this->lng = $DIC->language();
41  $this->db = $DIC->database();
42  $this->tabs = $DIC->tabs();
43  $this->toolbar = $DIC->toolbar();
44  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
45  }
global $DIC
Definition: feed.php:28
__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 467 of file class.ilPCTabsGUI.php.

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

467  : void
468  {
469  $lng = $this->lng;
470  $ilCtrl = $this->ctrl;
471 
472  $this->content_obj->addTab($lng->txt("cont_new_tab"));
473  $this->updated = $this->pg_obj->update();
474 
475  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_added_tab"), true);
476  $ilCtrl->redirect($this, "edit");
477  }
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 353 of file class.ilPCTabsGUI.php.

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

Referenced by create().

353  : void
354  {
355  $ilCtrl = $this->ctrl;
356 
357  $this->pg_obj->stripHierIDs();
358  $this->pg_obj->addHierIDs();
359  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
360  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
361  $this->content_obj->setHierId($this->content_obj->readHierId());
362  $this->setHierId($this->content_obj->readHierId());
363  $this->content_obj->setPcId($this->content_obj->readPCId());
364  $this->edit();
365  }
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 511 of file class.ilPCTabsGUI.php.

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

511  : void
512  {
513  $ilCtrl = $this->ctrl;
514  $ilCtrl->redirect($this, "edit");
515  }
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 307 of file class.ilPCTabsGUI.php.

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

Referenced by create(), and update().

307  : bool
308  {
309  $ok = true;
310  if ($form->getInput("type") === ilPCTabs::ACCORDION_HOR) {
311  if ($form->getInput("content_width") == "") {
312  $form->getItemByPostVar("content_width")
313  ->setAlert($this->lng->txt("cont_hacc_needs_width"));
314  $ok = false;
315  }
316  if ($form->getInput("content_height") == "") {
317  $form->getItemByPostVar("content_height")
318  ->setAlert($this->lng->txt("cont_hacc_needs_height"));
319  $ok = false;
320  }
321  }
322  return $ok;
323  }
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 479 of file class.ilPCTabsGUI.php.

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

479  : void
480  {
481  $ilCtrl = $this->ctrl;
482  $tpl = $this->tpl;
483  $lng = $this->lng;
484 
485  $this->setTabs();
486 
487  $tids = $this->request->getStringArray("tid");
488  if (count($tids) == 0) {
489  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
490  $ilCtrl->redirect($this, "edit");
491  } else {
492  $cgui = new ilConfirmationGUI();
493  $cgui->setFormAction($ilCtrl->getFormAction($this));
494  $cgui->setHeaderText($lng->txt("cont_tabs_confirm_deletion"));
495  $cgui->setCancel($lng->txt("cancel"), "cancelTabDeletion");
496  $cgui->setConfirm($lng->txt("delete"), "deleteTabs");
497 
498  foreach ($tids as $k => $i) {
499  $id = explode(":", $k);
500  $cgui->addItem(
501  "tid[]",
502  $k,
503  $this->content_obj->getCaption($id[0], $id[1])
504  );
505  }
506 
507  $tpl->setContent($cgui->getHTML());
508  }
509  }
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
$i
Definition: metadata.php:41
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:

◆ create()

ilPCTabsGUI::create ( )

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

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

325  : void
326  {
327  $lng = $this->lng;
328 
329  $this->initForm("create");
330  if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
331  $this->content_obj = new ilPCTabs($this->getPage());
332  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
333 
334  $this->setPropertiesByForm();
335 
336  for ($i = 0; $i < $this->request->getInt("nr"); $i++) {
337  $this->content_obj->addTab($lng->txt("cont_new_tab"));
338  }
339 
340  $this->updated = $this->pg_obj->update();
341 
342  if ($this->updated === true) {
343  $this->afterCreation();
344  } else {
345  $this->insert();
346  }
347  } else {
348  $this->form->setValuesByPost();
349  $this->insert(true);
350  }
351  }
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ deleteTabs()

ilPCTabsGUI::deleteTabs ( )

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

References ilPageContentGUI\$ctrl.

517  : void
518  {
519  $ilCtrl = $this->ctrl;
520 
521  $tids = $this->request->getStringArray("tid");
522  foreach ($tids as $tid) {
523  $ids = explode(":", $tid);
524  $this->content_obj->deleteTab($ids[0], $ids[1]);
525  }
526  $this->updated = $this->pg_obj->update();
527 
528  $ilCtrl->redirect($this, "edit");
529  }

◆ editProperties()

ilPCTabsGUI::editProperties ( bool  $init_form = true)

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

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

Referenced by update().

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

◆ executeCommand()

ilPCTabsGUI::executeCommand ( )

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

References ILIAS\Repository\ctrl().

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

◆ getFormValues()

ilPCTabsGUI::getFormValues ( )

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

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

Referenced by editProperties().

269  : void
270  {
271  $values["type"] = $this->content_obj->getTabType();
272  $values["content_width"] = $this->content_obj->getContentWidth();
273  $values["content_height"] = $this->content_obj->getContentHeight();
274  $values["valign"] = $this->content_obj->getHorizontalAlign();
275  $values["calign"] = $this->content_obj->getHorizontalAlign();
276  $values["vbehavior"] = $this->content_obj->getBehavior();
277  $values["hbehavior"] = $this->content_obj->getBehavior();
278 
279  $values["auto_time"] = $this->content_obj->getAutoTime();
280  $values["rand_start"] = $this->content_obj->getRandomStart();
281 
282  $this->form->setValuesByArray($values);
283 
284  if ($values["type"] == ilPCTabs::ACCORDION_VER) {
285  $va = $this->form->getItemByPostVar("vaccord_templ");
286  $v = "t:" .
287  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
288  $this->content_obj->getTemplate();
289  $va->setValue($v);
290  }
291  if ($values["type"] == ilPCTabs::ACCORDION_HOR) {
292  $ha = $this->form->getItemByPostVar("haccord_templ");
293  $v = "t:" .
294  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
295  $this->content_obj->getTemplate();
296  $ha->setValue($v);
297  }
298  if ($values["type"] == ilPCTabs::CAROUSEL) {
299  $ca = $this->form->getItemByPostVar("carousel_templ");
300  $v = "t:" .
301  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
302  $this->content_obj->getTemplate();
303  $ca->setValue($v);
304  }
305  }
static _lookupTemplateIdByName(int $a_style_id, string $a_name)
Lookup table template preview.
const ACCORDION_HOR
const ACCORDION_VER
form( $class_path, string $cmd)
const CAROUSEL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

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

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPCTabs\ACCORDION_HOR, ilPCTabs\ACCORDION_VER, ilAccordionGUI\addCss(), ilSubEnabledFormPropertyGUI\addSubItem(), ilPCTabs\CAROUSEL, ILIAS\Repository\form(), ilPageContentGUI\getTemplateOptions(), ILIAS\Repository\lng(), ilNumberInputGUI\setMaxLength(), ilRadioGroupInputGUI\setValue(), and ilLanguage\txt().

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

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

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

Referenced by create().

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

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

446  : void
447  {
448  $ilCtrl = $this->ctrl;
449  $lng = $this->lng;
450 
451  $captions = $this->request->getStringArray("caption");
452  $positions = $this->request->getStringArray("position");
453  if (count($captions) > 0) {
454  $this->content_obj->saveCaptions($captions);
455  }
456  if (count($positions)) {
457  $this->content_obj->savePositions($positions);
458  }
459  $this->updated = $this->pg_obj->update();
460  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
461  $ilCtrl->redirect($this, "edit");
462  }
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 367 of file class.ilPCTabsGUI.php.

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

Referenced by create(), and update().

367  : void
368  {
370  $f = $this->form;
371 
372  $c->setTabType($f->getInput("type"));
373 
374  $c->setContentWidth((string) $f->getInput("content_width"));
375  $c->setContentHeight((string) $f->getInput("content_height"));
376  $c->setTemplate("");
377  switch ($this->request->getString("type")) {
379  $t = explode(":", $f->getInput("vaccord_templ"));
380  $c->setTemplate($t[2] ?? "");
381  $c->setBehavior($f->getInput("vbehavior"));
382  $c->setHorizontalAlign($f->getInput("valign"));
383  break;
384 
386  $t = explode(":", $f->getInput("haccord_templ"));
387  $c->setTemplate($t[2] ?? "");
388  $c->setBehavior($f->getInput("hbehavior"));
389  break;
390 
391  case ilPCTabs::CAROUSEL:
392  $t = explode(":", $f->getInput("carousel_templ"));
393  $c->setTemplate($t[2] ?? "");
394  $c->setHorizontalAlign($f->getInput("calign"));
395  $c->setAutoTime($f->getInput("auto_time"));
396  $c->setRandomStart($f->getInput("rand_start"));
397  break;
398  }
399  }
$c
Definition: cli.php:38
const ACCORDION_HOR
ilPropertyFormGUI $form
const ACCORDION_VER
const CAROUSEL
+ Here is the caller graph for this function:

◆ setTabs()

ilPCTabsGUI::setTabs ( )

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

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

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

531  : void
532  {
533  $ilTabs = $this->tabs;
534  $ilCtrl = $this->ctrl;
535  $lng = $this->lng;
536 
537  $ilTabs->setBackTarget(
538  $lng->txt("pg"),
539  $this->ctrl->getParentReturn($this)
540  );
541 
542  $ilTabs->addTarget(
543  "cont_tabs",
544  $ilCtrl->getLinkTarget($this, "edit"),
545  "edit",
546  get_class($this)
547  );
548 
549  $ilTabs->addTarget(
550  "cont_edit_tabs",
551  $ilCtrl->getLinkTarget($this, "editProperties"),
552  "editProperties",
553  get_class($this)
554  );
555  }
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 401 of file class.ilPCTabsGUI.php.

References ilPageContentGUI\$content_obj, ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, $toolbar, ilPageContentGUI\$tpl, checkWidthHeight(), ILIAS\Repository\ctrl(), editProperties(), ILIAS\Repository\form(), initForm(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), setPropertiesByForm(), setTabs(), and ilLanguage\txt().

401  : void
402  {
403  $this->initForm();
404  $this->updated = false;
405  if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
406  $this->setPropertiesByForm();
407  $this->updated = $this->pg_obj->update();
408  } else {
409  $this->form->setValuesByPost();
410  $this->editProperties(false);
411  return;
412  }
413  if ($this->updated === true) {
414  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
415  $this->ctrl->redirect($this, "editProperties");
416  } else {
417  $this->pg_obj->addHierIDs();
418  $this->editProperties(false);
419  }
420  }
editProperties(bool $init_form=true)
checkWidthHeight(ilPropertyFormGUI $form)
initForm(string $a_mode="edit")
form( $class_path, string $cmd)
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilPCTabsGUI::$db
protected

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

◆ $form

ilPropertyFormGUI ilPCTabsGUI::$form
protected

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

Referenced by setPropertiesByForm().

◆ $tabs

ilTabsGUI ilPCTabsGUI::$tabs
protected

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

Referenced by setTabs(), and update().

◆ $toolbar

ilToolbarGUI ilPCTabsGUI::$toolbar
protected

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

Referenced by update().


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