ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPCContentIncludeGUI 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 ilPCContentIncludeGUI:
+ Collaboration diagram for ilPCContentIncludeGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 
 insert ()
 Insert new resources component form. More...
 
 insertFromPool ()
 Insert page snippet from media pool. More...
 
 poolSelection ()
 Pool Selection. More...
 
 create ()
 create new content include in dom and update page in db More...
 
 selectPool ()
 Select concrete pool. 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...
 

Protected Attributes

ilAccessHandler $access
 
ilTabsGUI $tabs
 
- 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;"
 
- 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="")
 
- 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 ilPCContentIncludeGUI User Interface for Content Includes (Snippets) Editing

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

Definition at line 25 of file class.ilPCContentIncludeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilPageContentGUI.

Definition at line 31 of file class.ilPCContentIncludeGUI.php.

36 {
37 global $DIC;
38
39 $this->ctrl = $DIC->ctrl();
40 $this->access = $DIC->access();
41 $this->tabs = $DIC->tabs();
42 $this->tpl = $DIC["tpl"];
43 $this->lng = $DIC->language();
44 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
45 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilPCContentIncludeGUI::create ( )

create new content include in dom and update page in db

Definition at line 149 of file class.ilPCContentIncludeGUI.php.

149 : void
150 {
151 $ids = $this->request->getIntArray("id");
152 if (count($ids) > 0) {
153 for ($i = count($ids) - 1; $i >= 0; $i--) {
154 // similar code in ilpageeditorgui::insertFromClipboard
155 $this->content_obj = new ilPCContentInclude($this->getPage());
156 $this->content_obj->create(
157 $this->pg_obj,
158 $this->request->getHierId(),
159 $this->pc_id
160 );
161 $this->content_obj->setContentType("mep");
162 $this->content_obj->setContentId($ids[$i]);
163 }
164 $this->updated = $this->pg_obj->update();
165 }
166 if ($this->updated === true) {
167 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
168 } else {
169 $this->insert();
170 }
171 }
insert()
Insert new resources component form.
Class ilPCContentInclude.

References ILIAS\Repository\ctrl(), ilPageContentGUI\getPage(), and insert().

+ Here is the call graph for this function:

◆ executeCommand()

ilPCContentIncludeGUI::executeCommand ( )

Definition at line 47 of file class.ilPCContentIncludeGUI.php.

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ insert()

ilPCContentIncludeGUI::insert ( )

Insert new resources component form.

Definition at line 65 of file class.ilPCContentIncludeGUI.php.

65 : void
66 {
67 switch ($this->sub_command) {
68 case "selectPool":
69 $this->selectPool();
70 break;
71
72 case "poolSelection":
73 $this->poolSelection();
74 break;
75
76 default:
77 $this->insertFromPool();
78 break;
79 }
80 }
insertFromPool()
Insert page snippet from media pool.
selectPool()
Select concrete pool.

References insertFromPool(), poolSelection(), and selectPool().

Referenced by create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromPool()

ilPCContentIncludeGUI::insertFromPool ( )

Insert page snippet from media pool.

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

85 : void
86 {
87 $ilCtrl = $this->ctrl;
88 $ilAccess = $this->access;
91
92 if ($this->edit_repo->getMediaPool() > 0 &&
93 $ilAccess->checkAccess("write", "", $this->edit_repo->getMediaPool())
94 && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getMediaPool())) == "mep") {
95 $tb = new ilToolbarGUI();
96
97 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
98
99 $tb->addButton(
100 $lng->txt("cont_select_media_pool"),
101 $ilCtrl->getLinkTarget($this, "insert")
102 );
103 $html = $tb->getHTML();
104
105 $ilCtrl->setParameter($this, "subCmd", "");
106
107 $pool = new ilObjMediaPool($this->edit_repo->getMediaPool());
108 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
109 $mpool_table = new ilMediaPoolTableGUI(
110 $this,
111 "insert",
112 $pool,
113 "mep_folder",
115 );
116 $mpool_table->setInsertCommand("create");
117
118 $html .= $mpool_table->getHTML();
119
120 $tpl->setContent($html);
121 } else {
122 $this->poolSelection();
123 }
124 }
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...
TableGUI class for recent changes in wiki.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
ilGlobalTemplateInterface $tpl
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.

References $access, ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), ilMediaPoolTableGUI\IL_MEP_SELECT_CONTENT, poolSelection(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ poolSelection()

ilPCContentIncludeGUI::poolSelection ( )

Pool Selection.

Definition at line 129 of file class.ilPCContentIncludeGUI.php.

129 : void
130 {
132 $ilCtrl = $this->ctrl;
133
134 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
135 $exp = new ilPoolSelectorGUI($this, "insert");
136
137 // filter
138 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
139 $exp->setClickableTypes(array('mep'));
140
141 if (!$exp->handleCommand()) {
142 $tpl->setContent($exp->getHTML());
143 }
144 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilPageContentGUI\$ctrl, ilPageContentGUI\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), and ilCtrl\setParameter().

Referenced by insert(), and insertFromPool().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectPool()

ilPCContentIncludeGUI::selectPool ( )

Select concrete pool.

Definition at line 176 of file class.ilPCContentIncludeGUI.php.

176 : void
177 {
178 $ilCtrl = $this->ctrl;
179
180 $this->edit_repo->setMediaPool($this->request->getInt("pool_ref_id"));
181 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
182 $ilCtrl->redirect($this, "insert");
183 }

References ilPageContentGUI\$ctrl, and ilCtrl\setParameter().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilPCContentIncludeGUI::$access
protected

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

Referenced by insertFromPool().

◆ $tabs

ilTabsGUI ilPCContentIncludeGUI::$tabs
protected

Definition at line 28 of file class.ilPCContentIncludeGUI.php.


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