ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 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 = ""
 
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;"
 
- 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 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
 
- 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 @ilCtrl_isCalledBy 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 = "" 
)

Reimplemented from ilPageContentGUI.

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

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

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

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

107 : void
108 {
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...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

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

+ Here is the call graph for this function:

◆ executeCommand()

ilPCContentTemplateGUI::executeCommand ( )

Execute command.

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

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 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initForm()

ilPCContentTemplateGUI::initForm ( )

Init creation from.

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

77 {
78 $ilCtrl = $this->ctrl;
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", $lng->txt("insert"));
99 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
100
101 return $form;
102 }
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 form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

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

Referenced by create(), and insert().

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

64 : void
65 {
67
69 $form = $this->initForm();
70 $tpl->setContent($form->getHTML());
71 }

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), initForm(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

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