ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 (?array $ids=null)
 create new content include in dom and update page in db More...
 
 createSingle (int $id)
 
 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
 
ILIAS MediaPool InternalGUIService $media_pool_gui
 
- 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;"
 
- 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 32 of file class.ilPCContentIncludeGUI.php.

37 {
38 global $DIC;
39
40 $this->ctrl = $DIC->ctrl();
41 $this->access = $DIC->access();
42 $this->tabs = $DIC->tabs();
43 $this->tpl = $DIC["tpl"];
44 $this->lng = $DIC->language();
45 $this->media_pool_gui = $DIC->mediaPool()->internal()->gui();
46 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
47 }
__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 ( ?array  $ids = null)

create new content include in dom and update page in db

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

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

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

Referenced by createSingle().

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

◆ createSingle()

ilPCContentIncludeGUI::createSingle ( int  $id)

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

181 : void
182 {
183 $this->create([$id]);
184 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
create(?array $ids=null)
create new content include in dom and update page in db

References create().

+ Here is the call graph for this function:

◆ executeCommand()

ilPCContentIncludeGUI::executeCommand ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ insert()

ilPCContentIncludeGUI::insert ( )

Insert new resources component form.

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

67 : void
68 {
69 switch ($this->sub_command) {
70 case "selectPool":
71 $this->selectPool();
72 break;
73
74 case "poolSelection":
75 $this->poolSelection();
76 break;
77
78 default:
79 $this->insertFromPool();
80 break;
81 }
82 }
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 87 of file class.ilPCContentIncludeGUI.php.

87 : void
88 {
89 $ilCtrl = $this->ctrl;
90 $ilAccess = $this->access;
93
94 if ($this->edit_repo->getMediaPool() > 0 &&
95 $ilAccess->checkAccess("write", "", $this->edit_repo->getMediaPool())
96 && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getMediaPool())) == "mep") {
97 $tb = new ilToolbarGUI();
98
99 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
100
101 $tb->addButton(
102 $lng->txt("cont_select_media_pool"),
103 $ilCtrl->getLinkTarget($this, "insert")
104 );
105 $html = $tb->getHTML();
106
107 $ilCtrl->setParameter($this, "subCmd", "");
108
109 $pool = new ilObjMediaPool($this->edit_repo->getMediaPool());
110 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
111 $table_builder = $this->media_pool_gui->mediaPoolTableBuilder(
112 $pool,
113 "mep_folder",
114 "selectc",
115 false,
116 null,
117 null,
118 "create",
119 $this,
120 "insert"
121 );
122 if ($table_builder->getTable()->handleCommand()) {
123 return;
124 }
125
126 $html .= $table_builder->render();
127
128 $tpl->setContent($html);
129 } else {
130 $this->poolSelection();
131 }
132 }
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...
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(), 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 137 of file class.ilPCContentIncludeGUI.php.

137 : void
138 {
140 $ilCtrl = $this->ctrl;
141
142 $ilCtrl->setParameter($this, "subCmd", "poolSelection");
143 $exp = new ilPoolSelectorGUI($this, "insert");
144
145 // filter
146 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
147 $exp->setClickableTypes(array('mep'));
148
149 if (!$exp->handleCommand()) {
150 $tpl->setContent($exp->getHTML());
151 }
152 }
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 189 of file class.ilPCContentIncludeGUI.php.

189 : void
190 {
191 $ilCtrl = $this->ctrl;
192
193 $this->edit_repo->setMediaPool($this->request->getInt("pool_ref_id"));
194 $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
195 $ilCtrl->redirect($this, "insert");
196 }

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

◆ $media_pool_gui

ILIAS MediaPool InternalGUIService ilPCContentIncludeGUI::$media_pool_gui
protected

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

◆ $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: