ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCContentTemplateGUI 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 ilPCContentTemplateGUI:
+ Collaboration diagram for ilPCContentTemplateGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 Execute command. More...
 
 insert ()
 Insert content template. More...
 
 initForm ()
 Init creation from. More...
 
 create ()
 Insert the template. More...
 
- 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...
 

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;"
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
- 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
 
- 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 Class ilPCContentTemplateGUI

User Interface for inserting content templates

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

34  {
35  global $DIC;
36 
37  $this->tpl = $DIC["tpl"];
38  $this->ctrl = $DIC->ctrl();
39  $this->lng = $DIC->language();
40  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
41  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCContentTemplateGUI::create ( )

Insert the template.

Definition at line 107 of file class.ilPCContentTemplateGUI.php.

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

107  : void
108  {
109  $tpl = $this->tpl;
110 
111  $form = $this->initForm();
112  if ($form->checkInput()) {
113  $this->content_obj = new ilPCContentTemplate($this->getPage());
114  $this->content_obj->create(
115  $this->pg_obj,
116  $this->hier_id,
117  $this->pc_id,
118  $form->getInput("page_templ")
119  );
120  $this->updated = $this->pg_obj->update();
121  if ($this->updated === true) {
122  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
123  return;
124  }
125  }
126  $this->displayValidationError();
127  $form->setValuesByPost();
128  $tpl->setContent($form->getHTML());
129  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ executeCommand()

ilPCContentTemplateGUI::executeCommand ( )

Execute command.

Definition at line 46 of file class.ilPCContentTemplateGUI.php.

References ILIAS\Repository\ctrl().

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

◆ initForm()

ilPCContentTemplateGUI::initForm ( )

Init creation from.

Definition at line 76 of file class.ilPCContentTemplateGUI.php.

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\getPage(), ILIAS\Repository\lng(), ilFormPropertyGUI\setRequired(), and ilLanguage\txt().

Referenced by create(), and insert().

77  {
78  $ilCtrl = $this->ctrl;
79  $lng = $this->lng;
80 
81  // edit form
82  $form = new ilPropertyFormGUI();
83  $form->setFormAction($ilCtrl->getFormAction($this));
84  $form->setTitle($this->lng->txt("cont_ed_insert_templ"));
85 
86  $radg = new ilRadioGroupInputGUI($lng->txt("cont_template"), "page_templ");
87  $radg->setRequired(true);
88 
89  $ts = $this->getPage()->getContentTemplates();
90  foreach ($ts as $t) {
91  $op = new ilRadioOption($t["title"], $t["id"] . ":" . $t["parent_type"]);
92  $radg->addOption($op);
93  }
94 
95  $form->addItem($radg);
96 
97 
98  $form->addCommandButton("create_templ", $lng->txt("insert"));
99  $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
100 
101  return $form;
102  }
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...
This class represents a property in a property form.
setRequired(bool $a_required)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCContentTemplateGUI::insert ( )

Insert content template.

Definition at line 64 of file class.ilPCContentTemplateGUI.php.

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

64  : void
65  {
66  $tpl = $this->tpl;
67 
68  $this->displayValidationError();
69  $form = $this->initForm();
70  $tpl->setContent($form->getHTML());
71  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

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