ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPCPluggedGUI 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 ilPCPluggedGUI:
+ Collaboration diagram for ilPCPluggedGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_plugin_name="", string $a_pc_id="")
 
 setPluginName (string $a_pluginname)
 
 getPluginName ()
 
 executeCommand ()
 
 insert ()
 
 edit (bool $a_insert=false)
 
 createElement (array $a_properties)
 
 updateElement (array $a_properties)
 
 returnToParent ()
 
- 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

string $pluginname = ""
 
ilTabsGUI $tabs
 
ilPageComponentPlugin $current_plugin = null
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 
- 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 User Interface for plugged page component

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 32 of file class.ilPCPluggedGUI.php.

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

38  {
39  global $DIC;
40 
41  $this->ctrl = $DIC->ctrl();
42  $this->component_repository = $DIC["component.repository"];
43  $this->component_factory = $DIC["component.factory"];
44  $this->tabs = $DIC->tabs();
45  $this->lng = $DIC->language();
46  $this->tpl = $DIC["tpl"];
47 
48  $this->setPluginName($a_plugin_name);
49  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
50  }
setPluginName(string $a_pluginname)
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ createElement()

ilPCPluggedGUI::createElement ( array  $a_properties)

Definition at line 142 of file class.ilPCPluggedGUI.php.

References ilPageContentGUI\getPage().

142  : bool
143  {
144  $this->content_obj = new ilPCPlugged($this->getPage());
145  $this->content_obj->create(
146  $this->pg_obj,
147  $this->hier_id,
148  $this->pc_id,
149  $this->current_plugin->getPluginName(),
150  $this->current_plugin->getVersion()
151  );
152  $this->content_obj->setProperties($a_properties);
153  $this->updated = $this->pg_obj->update();
154  if ($this->updated === true) {
155  return true;
156  }
157  return false;
158  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ edit()

ilPCPluggedGUI::edit ( bool  $a_insert = false)

Definition at line 109 of file class.ilPCPluggedGUI.php.

References ilPageContentGUI\$ctrl, XapiProxy\$plugin, ilPageContentGUI\$tpl, ilPageComponentPlugin\CMD_EDIT, ilPageComponentPlugin\CMD_INSERT, ilPageContentGUI\displayValidationError(), ilPageContentGUI\getPage(), getPluginName(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by insert().

109  : void
110  {
111  $ilCtrl = $this->ctrl;
112  $tpl = $this->tpl;
113  $html = "";
114 
115  $this->displayValidationError();
116 
117  // edit form
118  if ($a_insert) {
119  $plugin_name = $this->getPluginName();
120  } else {
121  $plugin_name = $this->content_obj->getPluginName();
122  }
123  $plugin = $this->component_repository->getPluginByName($plugin_name);
124  if ($plugin->isActive()) {
125  $plugin_obj = $this->component_factory->getPlugin($plugin->getId());
126  $plugin_obj->setPageObj($this->getPage());
127  $gui_obj = $plugin_obj->getUIClassInstance();
128  $gui_obj->setPCGUI($this);
129  if ($a_insert) {
130  $gui_obj->setMode(ilPageComponentPlugin::CMD_INSERT);
131  } else {
132  $gui_obj->setMode(ilPageComponentPlugin::CMD_EDIT);
133  }
134  $html = $ilCtrl->getHTML($gui_obj);
135  }
136 
137  if ($html != "") {
138  $tpl->setContent($html);
139  }
140  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPCPluggedGUI::executeCommand ( )
Returns
mixed
Exceptions
ilCtrlException

Definition at line 66 of file class.ilPCPluggedGUI.php.

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

67  {
68  $ilTabs = $this->tabs;
69  $lng = $this->lng;
70  $ilCtrl = $this->ctrl;
71  $ret = "";
72 
73  $ilTabs->setBackTarget($lng->txt("pg"), $ilCtrl->getLinkTarget($this, "returnToParent"));
74 
75  // get next class that processes or forwards current command
76  $next_class = $this->ctrl->getNextClass($this);
77 
78  // get all plugins and check, whether next class belongs to one
79  // of them, then forward
80  $plugins = $this->component_repository->getPluginSlotById("pgcp")->getActivePlugins();
81  foreach ($plugins as $pl) {
82  $pl_name = $pl->getName();
83  if ($next_class == strtolower("il" . $pl_name . "plugingui")) {
84  $plugin = $this->component_factory->getPlugin($pl->getId());
85  $plugin->setPageObj($this->getPage());
86  $this->current_plugin = $plugin;
87  $this->setPluginName($pl_name);
88  $gui_obj = $plugin->getUIClassInstance();
89  $gui_obj->setPCGUI($this);
90  $ret = $this->ctrl->forwardCommand($gui_obj);
91  }
92  }
93 
94  // get current command
95  $cmd = $this->ctrl->getCmd();
96 
97  if ($next_class == "" || $next_class == "ilpcpluggedgui") {
98  $ret = $this->$cmd();
99  }
100 
101  return $ret;
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...
setPluginName(string $a_pluginname)
+ Here is the call graph for this function:

◆ getPluginName()

ilPCPluggedGUI::getPluginName ( )

Definition at line 57 of file class.ilPCPluggedGUI.php.

References $pluginname.

Referenced by edit().

57  : string
58  {
59  return $this->pluginname;
60  }
+ Here is the caller graph for this function:

◆ insert()

ilPCPluggedGUI::insert ( )

Definition at line 104 of file class.ilPCPluggedGUI.php.

References edit().

104  : void
105  {
106  $this->edit(true);
107  }
edit(bool $a_insert=false)
+ Here is the call graph for this function:

◆ returnToParent()

ilPCPluggedGUI::returnToParent ( )

Definition at line 171 of file class.ilPCPluggedGUI.php.

References ILIAS\Repository\ctrl().

171  : void
172  {
173  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
174  }
+ Here is the call graph for this function:

◆ setPluginName()

ilPCPluggedGUI::setPluginName ( string  $a_pluginname)

Definition at line 52 of file class.ilPCPluggedGUI.php.

Referenced by __construct(), and executeCommand().

52  : void
53  {
54  $this->pluginname = $a_pluginname;
55  }
+ Here is the caller graph for this function:

◆ updateElement()

ilPCPluggedGUI::updateElement ( array  $a_properties)

Definition at line 160 of file class.ilPCPluggedGUI.php.

160  : bool
161  {
162  $this->content_obj->setProperties($a_properties);
163  $this->content_obj->setPluginVersion($this->current_plugin->getVersion());
164  $this->updated = $this->pg_obj->update();
165  if ($this->updated === true) {
166  return true;
167  }
168  return false;
169  }

Field Documentation

◆ $component_factory

ilComponentFactory ilPCPluggedGUI::$component_factory
protected

Definition at line 30 of file class.ilPCPluggedGUI.php.

◆ $component_repository

ilComponentRepository ilPCPluggedGUI::$component_repository
protected

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

◆ $current_plugin

ilPageComponentPlugin ilPCPluggedGUI::$current_plugin = null
protected

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

◆ $pluginname

string ilPCPluggedGUI::$pluginname = ""
protected

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

Referenced by getPluginName().

◆ $tabs

ilTabsGUI ilPCPluggedGUI::$tabs
protected

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

Referenced by executeCommand().


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