ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPCLayoutTemplateGUI Class Reference

@ilCtrl_isCalledBy ilPCLayoutTemplateGUI: ilPageEditorGUI More...

+ Inheritance diagram for ilPCLayoutTemplateGUI:
+ Collaboration diagram for ilPCLayoutTemplateGUI:

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...
 
 initCreationForm ()
 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

@ilCtrl_isCalledBy ilPCLayoutTemplateGUI: ilPageEditorGUI

Definition at line 24 of file class.ilPCLayoutTemplateGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilPageContentGUI.

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

31 {
32 global $DIC;
33
34 $this->tpl = $DIC["tpl"];
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
38 }
__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()

ilPCLayoutTemplateGUI::create ( )

Insert the template.

Definition at line 111 of file class.ilPCLayoutTemplateGUI.php.

111 : void
112 {
114
115 $form = $this->initForm();
116 if ($form->checkInput()) {
117 $this->content_obj = new ilPCLayoutTemplate($this->getPage());
118 $this->content_obj->create(
119 $this->pg_obj,
120 $this->hier_id,
121 $this->pc_id,
122 (int) $form->getInput("tmpl")
123 );
124 $this->updated = $this->pg_obj->update();
125 if ($this->updated === true) {
126 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
127 return;
128 }
129 }
130 $this->displayValidationError();
131 $form->setValuesByPost();
132 $tpl->setContent($form->getHTML());
133 }
Layout templates are not existing in the page.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

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

+ Here is the call graph for this function:

◆ executeCommand()

ilPCLayoutTemplateGUI::executeCommand ( )

Execute command.

Definition at line 43 of file class.ilPCLayoutTemplateGUI.php.

43 : void
44 {
45 // get next class that processes or forwards current command
46 $next_class = $this->ctrl->getNextClass($this);
47
48 // get current command
49 $cmd = $this->ctrl->getCmd();
50
51 switch ($next_class) {
52 default:
53 $this->$cmd();
54 break;
55 }
56 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initCreationForm()

ilPCLayoutTemplateGUI::initCreationForm ( )

Init creation from.

Definition at line 73 of file class.ilPCLayoutTemplateGUI.php.

74 {
75 $ilCtrl = $this->ctrl;
77
78 // edit form
79 $form = new ilPropertyFormGUI();
80 $form->setFormAction($ilCtrl->getFormAction($this));
81 $form->setTitle($this->lng->txt("cont_ed_insert_lay"));
82
83 $config = $this->getPage()->getPageConfig();
84 $templates = ilPageLayout::activeLayouts($config->getLayoutTemplateType());
85 $first = true;
86 if ($templates) {
87 $use_template = new ilRadioGroupInputGUI($this->lng->txt("cont_layout"), "tmpl");
88 $use_template->setRequired(true);
89 $form->addItem($use_template);
90
91 foreach ($templates as $templ) {
92 $templ->readObject();
93 $opt = new ilRadioOption($templ->getTitle() . $templ->getPreview(), (string) $templ->getId());
94 $use_template->addOption($opt);
95 if ($first) {
96 $use_template->setValue((string) $templ->getId());
97 $first = false;
98 }
99 }
100 }
101
102 $form->addCommandButton("create", $lng->txt("insert"));
103 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
104
105 return $form;
106 }
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...
static activeLayouts(int $a_module=0)
Get active layouts.
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, ilPageLayout\activeLayouts(), ilPageContentGUI\getPage(), ILIAS\Repository\lng(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ insert()

ilPCLayoutTemplateGUI::insert ( )

Insert content template.

Definition at line 61 of file class.ilPCLayoutTemplateGUI.php.

61 : void
62 {
64
66 $form = $this->initForm();
67 $tpl->setContent($form->getHTML());
68 }

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

+ Here is the call graph for this function:

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