ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
 
LOMServices $lom_services
 
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 = "" 
)

Reimplemented from ilPageContentGUI.

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

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 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ 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 444 of file class.ilPCTabsGUI.php.

444 : void
445 {
447 $ilCtrl = $this->ctrl;
448
449 $this->content_obj->addTab($lng->txt("cont_new_tab"));
450 $this->updated = $this->pg_obj->update();
451
452 $this->tpl->setOnScreenMessage('success', $lng->txt("cont_added_tab"), true);
453 $ilCtrl->redirect($this, "edit");
454 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
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...

References $lng.

◆ afterCreation()

ilPCTabsGUI::afterCreation ( )

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

337 : void
338 {
339 $ilCtrl = $this->ctrl;
340
341 $this->pg_obj->stripHierIDs();
342 $this->pg_obj->addHierIDs();
343 $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
344 $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
345 $this->content_obj->setHierId($this->content_obj->readHierId());
346 $this->setHierId($this->content_obj->readHierId());
347 $this->content_obj->setPcId($this->content_obj->readPCId());
348 $this->edit();
349 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
setHierId(string $a_hier_id)
set hierarchical id in dom object

◆ cancelTabDeletion()

ilPCTabsGUI::cancelTabDeletion ( )

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

488 : void
489 {
490 $ilCtrl = $this->ctrl;
491 $ilCtrl->redirect($this, "edit");
492 }

◆ checkWidthHeight()

ilPCTabsGUI::checkWidthHeight ( ilPropertyFormGUI  $form)
protected

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

291 : bool
292 {
293 $ok = true;
294 if ($form->getInput("type") === ilPCTabs::ACCORDION_HOR) {
295 if ($form->getInput("content_width") == "") {
296 $form->getItemByPostVar("content_width")
297 ->setAlert($this->lng->txt("cont_hacc_needs_width"));
298 $ok = false;
299 }
300 if ($form->getInput("content_height") == "") {
301 $form->getItemByPostVar("content_height")
302 ->setAlert($this->lng->txt("cont_hacc_needs_height"));
303 $ok = false;
304 }
305 }
306 return $ok;
307 }
ilPropertyFormGUI $form
const ACCORDION_HOR
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-...
getItemByPostVar(string $a_post_var)

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

+ Here is the call graph for this function:

◆ confirmTabsDeletion()

ilPCTabsGUI::confirmTabsDeletion ( )

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

456 : void
457 {
458 $ilCtrl = $this->ctrl;
461
462 $this->setTabs();
463
464 $tids = $this->request->getStringArray("tid");
465 if (count($tids) == 0) {
466 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
467 $ilCtrl->redirect($this, "edit");
468 } else {
469 $cgui = new ilConfirmationGUI();
470 $cgui->setFormAction($ilCtrl->getFormAction($this));
471 $cgui->setHeaderText($lng->txt("cont_tabs_confirm_deletion"));
472 $cgui->setCancel($lng->txt("cancel"), "cancelTabDeletion");
473 $cgui->setConfirm($lng->txt("delete"), "deleteTabs");
474
475 foreach ($tids as $k => $i) {
476 $id = explode(":", $k);
477 $cgui->addItem(
478 "tid[]",
479 $k,
480 $this->content_obj->getCaption($id[0], $id[1])
481 );
482 }
483
484 $tpl->setContent($cgui->getHTML());
485 }
486 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References $id, and $lng.

◆ create()

ilPCTabsGUI::create ( )

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

309 : void
310 {
312
313 $this->initForm("create");
314 if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
315 $this->content_obj = new ilPCTabs($this->getPage());
316 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
317
318 $this->setPropertiesByForm();
319
320 for ($i = 0; $i < $this->request->getInt("nr"); $i++) {
321 $this->content_obj->addTab($lng->txt("cont_new_tab"));
322 }
323
324 $this->updated = $this->pg_obj->update();
325
326 if ($this->updated === true) {
327 $this->afterCreation();
328 } else {
329 $this->insert();
330 }
331 } else {
332 $this->form->setValuesByPost();
333 $this->insert(true);
334 }
335 }
insert(bool $a_omit_form_init=false)
Insert new tabs.
initForm(string $a_mode="edit")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd, string $submit_caption="")

References $lng, and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ deleteTabs()

ilPCTabsGUI::deleteTabs ( )

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

494 : void
495 {
496 $ilCtrl = $this->ctrl;
497
498 $tids = $this->request->getStringArray("tid");
499 foreach ($tids as $tid) {
500 $ids = explode(":", $tid);
501 $this->content_obj->deleteTab($ids[0], $ids[1]);
502 }
503 $this->updated = $this->pg_obj->update();
504
505 $ilCtrl->redirect($this, "edit");
506 }

◆ edit()

ilPCTabsGUI::edit ( )

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

406 : void
407 {
409 $ilTabs = $this->tabs;
410 $ilCtrl = $this->ctrl;
411 $ilToolbar = $this->toolbar;
413
414 $this->initEditor();
415 $this->tabs->setBackTarget("", "");
416
417 $tpl->setContent($this->getTabPanels() . $this->getEditorScriptTag($this->pc_id, "Tabs"));
418 }
ilToolbarGUI $toolbar
getEditorScriptTag(string $form_pc_id="", string $form_cname="")

References $lng, and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ editProperties()

ilPCTabsGUI::editProperties ( bool  $init_form = true)

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

83 : void
84 {
86
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 }

References ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ executeCommand()

ilPCTabsGUI::executeCommand ( )

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

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 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getCaptionForm()

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

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

535 {
536 return $this->gui->form([self::class], "saveCaption")
537 ->text("caption", $this->lng->txt("title"), "", $caption);
538 }
text(string $key, string $title, string $description="", ?string $value=null)

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getFormValues()

ilPCTabsGUI::getFormValues ( )

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

252 : void
253 {
254 $values["type"] = $this->content_obj->getTabType();
255 $values["content_width"] = $this->content_obj->getContentWidth();
256 $values["content_height"] = $this->content_obj->getContentHeight();
257 $values["valign"] = $this->content_obj->getHorizontalAlign();
258 $values["calign"] = $this->content_obj->getHorizontalAlign();
259 $values["vbehavior"] = $this->content_obj->getBehavior();
260 $values["hbehavior"] = $this->content_obj->getBehavior();
261
262 $values["auto_time"] = $this->content_obj->getAutoTime();
263 $values["rand_start"] = $this->content_obj->getRandomStart();
264
265 $this->form->setValuesByArray($values);
266
267 if ($values["type"] == ilPCTabs::ACCORDION_VER) {
268 $va = $this->form->getItemByPostVar("vaccord_templ");
269 $v = "t:" .
270 ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
271 $this->content_obj->getTemplate();
272 $va->setValue($v);
273 }
274 /*
275 if ($values["type"] == ilPCTabs::ACCORDION_HOR) {
276 $ha = $this->form->getItemByPostVar("haccord_templ");
277 $v = "t:" .
278 ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
279 $this->content_obj->getTemplate();
280 $ha->setValue($v);
281 }*/
282 if ($values["type"] == ilPCTabs::CAROUSEL) {
283 $ca = $this->form->getItemByPostVar("carousel_templ");
284 $v = "t:" .
285 ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
286 $this->content_obj->getTemplate();
287 $ca->setValue($v);
288 }
289 }
static _lookupTemplateIdByName(int $a_style_id, string $a_name)
Lookup table template preview.
const CAROUSEL
const ACCORDION_VER

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

+ Here is the call graph for this function:

◆ initCreationForm()

ilPCTabsGUI::initCreationForm ( )

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

240 {
241 $this->initForm("create");
242 return $this->form;
243 }
This class represents a property form user interface.

◆ initEditingForm()

ilPCTabsGUI::initEditingForm ( )

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

246 {
247 $this->initForm("edit");
248 $this->getFormValues();
249 return $this->form;
250 }

◆ initForm()

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

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

100 : void {
101 $ilCtrl = $this->ctrl;
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");
119 $radg->setValue(ilPCTabs::ACCORDION_VER);
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 // type: carousel
142 $op3 = new ilRadioOption($lng->txt("cont_tabs_carousel"), ilPCTabs::CAROUSEL);
143 $templ = $this->getTemplateOptions("carousel");
144 if (count($templ) > 0) {
145 $cchar_prop = new ilSelectInputGUI(
146 $this->lng->txt("cont_characteristic"),
147 "carousel_templ"
148 );
149 $cchar_prop->setOptions($templ);
150 $op3->addSubItem($cchar_prop);
151 } else {
152 $cchar_prop = new ilHiddenInputGUI("carousel_templ");
153 $this->form->addItem($cchar_prop);
154 }
155
156 $radg->addOption($op3);
157 $this->form->addItem($radg);
158
159
160 // number of initial tabs
161 if ($a_mode == "create") {
162 $nr_prop = new ilSelectInputGUI(
163 $lng->txt("cont_number_of_tabs"),
164 "nr"
165 );
166 $nrs = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6,
167 7 => 7, 8 => 8, 9 => 9, 10 => 10);
168 $nr_prop->setOptions($nrs);
169 $this->form->addItem($nr_prop);
170 }
171
172 /*
173 $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_width"), "content_width");
174 $ni->setMaxLength(4);
175 $ni->setSize(4);
176 $this->form->addItem($ni);
177
178 $ni = new ilNumberInputGUI($this->lng->txt("cont_tab_cont_height"), "content_height");
179 $ni->setMaxLength(4);
180 $ni->setSize(4);
181 $this->form->addItem($ni);*/
182
183 // behaviour
184 $options = array(
185 "AllClosed" => $lng->txt("cont_all_closed"),
186 "FirstOpen" => $lng->txt("cont_first_open"),
187 "ForceAllOpen" => $lng->txt("cont_force_all_open"),
188 );
189 $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "vbehavior");
190 $si->setOptions($options);
191 $op1->addSubItem($si);
192 /*
193 $si = new ilSelectInputGUI($this->lng->txt("cont_behavior"), "hbehavior");
194 $si->setOptions($options);
195 $op2->addSubItem($si);*/
196
197
198 // alignment
199 /*
200 $align_opts = array("Left" => $lng->txt("cont_left"),
201 "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
202 "LeftFloat" => $lng->txt("cont_left_float"),
203 "RightFloat" => $lng->txt("cont_right_float"));
204 $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "valign");
205 $align->setOptions($align_opts);
206 $align->setValue("Center");
207 //$align->setInfo($lng->txt("cont_tabs_hor_align_info"));
208 $op1->addSubItem($align);
209 $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "calign");
210 $align->setOptions($align_opts);
211 $align->setValue("Center");
212 $op3->addSubItem($align);*/
213
214 // carousel: time
215 $ti = new ilNumberInputGUI($this->lng->txt("cont_auto_time"), "auto_time");
216 $ti->setMaxLength(6);
217 $ti->setSize(6);
218 $ti->setSuffix("ms");
219 $ti->setMinValue(100);
220 $op3->addSubItem($ti);
221
222 // carousel: random start
223 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_rand_start"), "rand_start");
224 //$cb->setOptionTitle($this->lng->txt(""));
225 //$cb->setInfo($this->lng->txt(""));
226 $op3->addSubItem($cb);
227
228
229 // save/cancel buttons
230 if ($a_mode == "create") {
231 $this->form->addCommandButton("create", $lng->txt("save"));
232 $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
233 } else {
234 $this->form->addCommandButton("update", $lng->txt("save"));
235 $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
236 }
237 }
static addCss()
Add required css.
This class represents a checkbox property in a property form.
This class represents a hidden form property in a property form.
This class represents a number property in a property form.
getTemplateOptions(string $a_type="")
Get table templates.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.

◆ insert()

ilPCTabsGUI::insert ( bool  $a_omit_form_init = false)

Insert new tabs.

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

71 : void {
73
75
76 if (!$a_omit_form_init) {
77 $this->initForm("create");
78 }
79 $html = $this->form->getHTML();
80 $tpl->setContent($html);
81 }

◆ saveTabs()

ilPCTabsGUI::saveTabs ( )

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

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

423 : void
424 {
425 $ilCtrl = $this->ctrl;
427
428 $captions = $this->request->getStringArray("caption");
429 $positions = $this->request->getStringArray("position");
430 if (count($captions) > 0) {
431 $this->content_obj->saveCaptions($captions);
432 }
433 if (count($positions)) {
434 $this->content_obj->savePositions($positions);
435 }
436 $this->updated = $this->pg_obj->update();
437 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
438 $ilCtrl->redirect($this, "edit");
439 }

References $lng.

◆ setPropertiesByForm()

ilPCTabsGUI::setPropertiesByForm ( )

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

351 : void
352 {
354 $f = $this->form;
355
356 $c->setTabType($f->getInput("type"));
357
358 $c->setContentWidth((string) $f->getInput("content_width"));
359 $c->setContentHeight((string) $f->getInput("content_height"));
360 $c->setTemplate("");
361 switch ($this->request->getString("type")) {
363 $t = explode(":", $f->getInput("vaccord_templ"));
364 $c->setTemplate($t[2] ?? "");
365 $c->setBehavior($f->getInput("vbehavior"));
366 $c->setHorizontalAlign($f->getInput("valign"));
367 break;
368
370 $t = explode(":", $f->getInput("haccord_templ"));
371 $c->setTemplate($t[2] ?? "");
372 $c->setBehavior($f->getInput("hbehavior"));
373 break;
374
376 $t = explode(":", $f->getInput("carousel_templ"));
377 $c->setTemplate($t[2] ?? "");
378 $c->setHorizontalAlign($f->getInput("calign"));
379 $c->setAutoTime($f->getInput("auto_time"));
380 $c->setRandomStart($f->getInput("rand_start"));
381 break;
382 }
383 }
$c
Definition: deliver.php:25

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

◆ setTabs()

ilPCTabsGUI::setTabs ( )

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

508 : void
509 {
510 $ilTabs = $this->tabs;
511 $ilCtrl = $this->ctrl;
513
514 $ilTabs->setBackTarget(
515 $lng->txt("pg"),
516 $this->ctrl->getParentReturn($this)
517 );
518
519 $ilTabs->addTarget(
520 "cont_tabs",
521 $ilCtrl->getLinkTarget($this, "edit"),
522 "edit",
523 get_class($this)
524 );
525
526 $ilTabs->addTarget(
527 "cont_edit_tabs",
528 $ilCtrl->getLinkTarget($this, "editProperties"),
529 "editProperties",
530 get_class($this)
531 );
532 }

References $lng.

◆ update()

ilPCTabsGUI::update ( )

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

385 : void
386 {
387 $this->initForm();
388 $this->updated = false;
389 if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
390 $this->setPropertiesByForm();
391 $this->updated = $this->pg_obj->update();
392 } else {
393 $this->form->setValuesByPost();
394 $this->editProperties(false);
395 return;
396 }
397 if ($this->updated === true) {
398 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
399 $this->ctrl->redirect($this, "editProperties");
400 } else {
401 $this->pg_obj->addHierIDs();
402 $this->editProperties(false);
403 }
404 }
editProperties(bool $init_form=true)

References ILIAS\Repository\ctrl(), ILIAS\Repository\form(), and ILIAS\Repository\lng().

+ 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.

◆ $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.

◆ $toolbar

ilToolbarGUI ilPCTabsGUI::$toolbar
protected

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

◆ $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: