ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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
 
array bool null $updated = null
 
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 469 of file class.ilPCTabsGUI.php.

469 : void
470 {
472 $ilCtrl = $this->ctrl;
473
474 $this->content_obj->addTab($lng->txt("cont_new_tab"));
475 $this->updated = $this->pg_obj->update();
476
477 $this->tpl->setOnScreenMessage('success', $lng->txt("cont_added_tab"), true);
478 $ilCtrl->redirect($this, "edit");
479 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
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 362 of file class.ilPCTabsGUI.php.

362 : void
363 {
364 $ilCtrl = $this->ctrl;
365
366 $this->pg_obj->stripHierIDs();
367 $this->pg_obj->addHierIDs();
368 $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
369 $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
370 $this->content_obj->setHierId($this->content_obj->readHierId());
371 $this->setHierId($this->content_obj->readHierId());
372 $this->content_obj->setPcId($this->content_obj->readPCId());
373 $this->edit();
374 }
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 513 of file class.ilPCTabsGUI.php.

513 : void
514 {
515 $ilCtrl = $this->ctrl;
516 $ilCtrl->redirect($this, "edit");
517 }

◆ checkWidthHeight()

ilPCTabsGUI::checkWidthHeight ( ilPropertyFormGUI  $form)
protected

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

316 : bool
317 {
318 $ok = true;
319 if ($form->getInput("type") === ilPCTabs::ACCORDION_HOR) {
320 if ($form->getInput("content_width") == "") {
321 $form->getItemByPostVar("content_width")
322 ->setAlert($this->lng->txt("cont_hacc_needs_width"));
323 $ok = false;
324 }
325 if ($form->getInput("content_height") == "") {
326 $form->getItemByPostVar("content_height")
327 ->setAlert($this->lng->txt("cont_hacc_needs_height"));
328 $ok = false;
329 }
330 }
331 return $ok;
332 }
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 481 of file class.ilPCTabsGUI.php.

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

+ Here is the call graph for this function:

◆ create()

ilPCTabsGUI::create ( )

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

334 : void
335 {
337
338 $this->initForm("create");
339 if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
340 $this->content_obj = new ilPCTabs($this->getPage());
341 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
342
343 $this->setPropertiesByForm();
344
345 for ($i = 0; $i < $this->request->getInt("nr"); $i++) {
346 $this->content_obj->addTab($lng->txt("cont_new_tab"));
347 }
348
349 $this->updated = $this->pg_obj->update();
350
351 if ($this->updated === true) {
352 $this->afterCreation();
353 } else {
354 $this->insert();
355 }
356 } else {
357 $this->form->setValuesByPost();
358 $this->insert(true);
359 }
360 }
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(?array $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 519 of file class.ilPCTabsGUI.php.

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

◆ edit()

ilPCTabsGUI::edit ( )

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

431 : void
432 {
434 $ilTabs = $this->tabs;
435 $ilCtrl = $this->ctrl;
436 $ilToolbar = $this->toolbar;
438
439 $this->initEditor();
440 $this->tabs->setBackTarget("", "");
441
442 $tpl->setContent($this->getTabPanels() . $this->getEditorScriptTag($this->pc_id, "Tabs"));
443 }
ilToolbarGUI $toolbar
getEditorScriptTag(string $form_pc_id="", string $form_cname="")

References $lng, ILIAS\News\Common\Table\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ editProperties()

ilPCTabsGUI::editProperties ( bool  $init_form = true)

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

85 : void
86 {
88
90 $this->setTabs();
91
92 if ($init_form) {
93 $this->initForm();
94 $this->getFormValues();
95 }
96 $html = $this->form->getHTML();
97 $tpl->setContent($html);
98 }

References ILIAS\News\Common\Table\$tpl, ILIAS\Repository\form(), and ILIAS\UICore\GlobalTemplate\setContent().

+ 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 $this->tpl->addCss(ilObjStyleSheet::getBaseContentStylePath());
57 $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->getStyleId()));
58 // get current command
59 $cmd = $this->ctrl->getCmd();
60
61 switch ($next_class) {
62 default:
63 $this->$cmd();
64 break;
65 }
66 }
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)

References ILIAS\Repository\ctrl(), ilObjStyleSheet\getBaseContentStylePath(), ilObjStyleSheet\getContentStylePath(), and ilPageContentGUI\getStyleId().

+ Here is the call graph for this function:

◆ getCaptionForm()

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

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

560 {
561 return $this->gui->form([self::class], "saveCaption")
562 ->text("caption", $this->lng->txt("title"), "", $caption);
563 }
text(string $key, string $title, string $description="", ?string $value=null, int $max_length=0)

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getFormValues()

ilPCTabsGUI::getFormValues ( )

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

277 : void
278 {
279 $values["type"] = $this->content_obj->getTabType();
280 $values["content_width"] = $this->content_obj->getContentWidth();
281 $values["content_height"] = $this->content_obj->getContentHeight();
282 $values["valign"] = $this->content_obj->getHorizontalAlign();
283 $values["calign"] = $this->content_obj->getHorizontalAlign();
284 $values["vbehavior"] = $this->content_obj->getBehavior();
285 $values["hbehavior"] = $this->content_obj->getBehavior();
286
287 $values["auto_time"] = $this->content_obj->getAutoTime();
288 $values["rand_start"] = $this->content_obj->getRandomStart();
289
290 $this->form->setValuesByArray($values);
291
292 if ($values["type"] == ilPCTabs::ACCORDION_VER) {
293 $va = $this->form->getItemByPostVar("vaccord_templ");
294 $v = "t:" .
295 ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
296 $this->content_obj->getTemplate();
297 $va->setValue($v);
298 }
299 /*
300 if ($values["type"] == ilPCTabs::ACCORDION_HOR) {
301 $ha = $this->form->getItemByPostVar("haccord_templ");
302 $v = "t:" .
303 ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
304 $this->content_obj->getTemplate();
305 $ha->setValue($v);
306 }*/
307 if ($values["type"] == ilPCTabs::CAROUSEL) {
308 $ca = $this->form->getItemByPostVar("carousel_templ");
309 $v = "t:" .
310 ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
311 $this->content_obj->getTemplate();
312 $ca->setValue($v);
313 }
314 }
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 264 of file class.ilPCTabsGUI.php.

265 {
266 $this->initForm("create");
267 return $this->form;
268 }
This class represents a property form user interface.

◆ initEditingForm()

ilPCTabsGUI::initEditingForm ( )

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

271 {
272 $this->initForm("edit");
273 $this->getFormValues();
274 return $this->form;
275 }

◆ initForm()

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

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

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

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

◆ saveTabs()

ilPCTabsGUI::saveTabs ( )

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

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

448 : void
449 {
450 $ilCtrl = $this->ctrl;
452
453 $captions = $this->request->getStringArray("caption");
454 $positions = $this->request->getStringArray("position");
455 if (count($captions) > 0) {
456 $this->content_obj->saveCaptions($captions);
457 }
458 if (count($positions)) {
459 $this->content_obj->savePositions($positions);
460 }
461 $this->updated = $this->pg_obj->update();
462 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
463 $ilCtrl->redirect($this, "edit");
464 }

References $lng.

◆ setPropertiesByForm()

ilPCTabsGUI::setPropertiesByForm ( )

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

376 : void
377 {
379 $f = $this->form;
380
381 $c->setTabType($f->getInput("type"));
382
383 $c->setContentWidth((string) $f->getInput("content_width"));
384 $c->setContentHeight((string) $f->getInput("content_height"));
385 $c->setTemplate("");
386 switch ($this->request->getString("type")) {
388 $t = explode(":", $f->getInput("vaccord_templ"));
389 $c->setTemplate($t[2] ?? "");
390 $c->setBehavior($f->getInput("vbehavior"));
391 $c->setHorizontalAlign($f->getInput("valign"));
392 break;
393
395 $t = explode(":", $f->getInput("haccord_templ"));
396 $c->setTemplate($t[2] ?? "");
397 $c->setBehavior($f->getInput("hbehavior"));
398 break;
399
401 $t = explode(":", $f->getInput("carousel_templ"));
402 $c->setTemplate($t[2] ?? "");
403 $c->setHorizontalAlign($f->getInput("calign"));
404 $c->setAutoTime($f->getInput("auto_time"));
405 $c->setRandomStart($f->getInput("rand_start"));
406 break;
407 }
408 }

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

◆ setTabs()

ilPCTabsGUI::setTabs ( )

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

533 : void
534 {
535 $ilTabs = $this->tabs;
536 $ilCtrl = $this->ctrl;
538
539 $ilTabs->setBackTarget(
540 $lng->txt("pg"),
541 $this->ctrl->getParentReturn($this)
542 );
543
544 $ilTabs->addTarget(
545 "cont_tabs",
546 $ilCtrl->getLinkTarget($this, "edit"),
547 "edit",
548 get_class($this)
549 );
550
551 $ilTabs->addTarget(
552 "cont_edit_tabs",
553 $ilCtrl->getLinkTarget($this, "editProperties"),
554 "editProperties",
555 get_class($this)
556 );
557 }

References $lng.

◆ update()

ilPCTabsGUI::update ( )

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

410 : void
411 {
412 $this->initForm();
413 $this->updated = false;
414 if ($this->form->checkInput() && $this->checkWidthHeight($this->form)) {
415 $this->setPropertiesByForm();
416 $this->updated = $this->pg_obj->update();
417 } else {
418 $this->form->setValuesByPost();
419 $this->editProperties(false);
420 return;
421 }
422 if ($this->updated === true) {
423 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
424 $this->ctrl->redirect($this, "editProperties");
425 } else {
426 $this->pg_obj->addHierIDs();
427 $this->editProperties(false);
428 }
429 }
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: