ILIAS  release_8 Revision v8.24
ilObjStudyProgrammeTreeExplorerGUI 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 ilObjStudyProgrammeTreeExplorerGUI:
+ Collaboration diagram for ilObjStudyProgrammeTreeExplorerGUI:

Public Member Functions

 __construct (int $tree_root_id, string $modal_id, string $expl_id, $parent_obj, string $parent_cmd)
 
 getNodeContent ($a_node)
 Return node element. More...
 
 getRootNode ()
 Return root node of tree. More...
 
 getNodeIcon ($node)
 Get node icon path. More...
 
 getNodeHref ($node)
 Get href for node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children of node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 getHTML ()
 Returns the output of the complete tree There are added some additional javascripts before output the parent::getHTML() More...
 
 closeCertainNode ($node_id)
 Closes certain node in the tree session The open nodes of a tree are stored in a session. More...
 
 openCertainNode ($node_id)
 Open certain node in the tree session The open nodes of a tree are stored in a session. More...
 
 addJsConf (string $key, string $value)
 Adds configuration to the study-programme-tree jquery plugin. More...
 
 getJsConf (string $key)
 Returns setting of the study-programme-tree. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 setChildLimit (int $a_val)
 
 getChildLimit ()
 
 setSearchTerm (string $a_val)
 
 getSearchTerm ()
 
 setMainTemplate (ilGlobalTemplateInterface $a_main_tpl=null)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has children Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible. More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode (bool $a_val)
 
 getSkipRootNode ()
 
 setAjax (bool $a_val)
 
 getAjax ()
 
 setSecondaryHighlightedNodes (array $a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode (string $a_postvar, bool $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode (bool $a_val)
 
 getOfflineMode ()
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 
 renderNode ($a_node, ilTemplate $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, ilTemplate $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 listItemEnd (ilTemplate $tpl)
 
 listStart (ilTemplate $tpl)
 
 listEnd (ilTemplate $tpl)
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled (bool $nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd (bool $enable_dnd)
 

Protected Member Functions

 getNodeTitleClasses (array $node_config)
 Returns array with all css classes of the title node element. More...
 
 parseStudyProgrammeNodeButtons (ilObjStudyProgramme $node, array $node_config, ilTemplate $tpl)
 Generates the buttons for a study-programme node. More...
 
 parseLeafNodeButtons (ilObject $node, array $node_config, ilTemplate $tpl)
 Generates the buttons for a study programme leaf. More...
 
 getNodeTemplateInstance ()
 Factory method for a new instance of a node template. More...
 
 formatPointValue (int $points)
 Returns formatted point value. More...
 
 getNodeButtonActionLink (string $target_class, string $cmd, array $params, string $content, bool $async=true)
 Generate link-element. More...
 
 checkAccess (string $permission, int $ref_id)
 Checks permission of current tree or certain child of it. More...
 
 checkAccessOrFail (string $permission, int $ref_id)
 Checks permission of a object and throws an exception if they are not granted. More...
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 
 isNodeRequested (string $a_node_id)
 

Protected Attributes

ilAccessHandler $access
 
ilLanguage $lng
 
ilToolbarGUI $toolbar
 
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
 
ILIAS Refinery Factory $refinery
 
int $tree_root_id
 
string $modal_id
 
array $js_conf
 
array $class_configuration
 default classes of the tree [key=>class_name] More...
 
string $js_study_programme_path = "./Modules/StudyProgramme/templates/js/ilStudyProgramme.js"
 
string $css_study_programme_path = "./Modules/StudyProgramme/templates/css/ilStudyProgrammeTree.css"
 
- Protected Attributes inherited from ilExplorerBaseGUI
string $node_parameter_name
 
ilLogger $log
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
bool $skip_root_node = false
 
bool $ajax = false
 
array $custom_open_nodes = array()
 
array $selected_nodes = array()
 
string $select_postvar = ""
 
bool $offline_mode = false
 
array $sec_highl_nodes = array()
 
bool $enable_dnd = false
 
string $search_term = ""
 
array $open_nodes = []
 
ilSessionIStorage $store
 
bool $select_multi = false
 
 $parent_obj
 
int $child_limit = 0
 
string $parent_cmd = ''
 
string $requested_exp_cmd = ""
 
string $requested_exp_cont = ""
 
string $requested_searchterm = ""
 
string $requested_node_id = ""
 
string $id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 
static getLocalJsTreeJsPath ()
 
static getLocalJsTreeCssPath ()
 
static createHTMLExportDirs (string $a_target_dir)
 
static init (ilGlobalTemplateInterface $a_main_tpl=null)
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static string $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static string $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static string $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

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 ilStudyProgrammeTreeGUI ilObjStudyProgrammeTreeExplorerGUI generates the tree output for StudyProgrammes This class builds the tree with drag & drop functionality and some additional buttons which triggers bootstrap-modals

Author
Michael Herren mh@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

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

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeTreeExplorerGUI::__construct ( int  $tree_root_id,
string  $modal_id,
string  $expl_id,
  $parent_obj,
string  $parent_cmd 
)
Parameters
$parent_objstring|object|array

Definition at line 68 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

69 {
71
72 global $DIC;
73 $this->access = $DIC['ilAccess'];
74 $this->lng = $DIC['lng'];
75 $this->tpl = $DIC['tpl'];
76 $this->toolbar = $DIC['ilToolbar'];
77 $this->ctrl = $DIC['ilCtrl'];
78 $this->request_wrapper = $DIC->http()->wrapper()->query();
79 $this->refinery = $DIC->refinery();
80
81 $this->tree_root_id = $tree_root_id;
82 $this->modal_id = $modal_id;
83
84 $this->js_conf = array();
85
86 $this->lng->loadLanguageModule("prg");
87
88 $this->setAjax(true);
89
90 if ($this->checkAccess('write', $tree_root_id)) {
91 $this->setEnableDnd(true);
92 }
93 }
setEnableDnd(bool $enable_dnd)
checkAccess(string $permission, int $ref_id)
Checks permission of current tree or certain child of it.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, $modal_id, ilExplorerBaseGUI\$parent_cmd, ilExplorerBaseGUI\$parent_obj, $tree_root_id, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilExplorerBaseGUI\setAjax(), ilExplorerBaseGUI\setEnableDnd(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ addJsConf()

ilObjStudyProgrammeTreeExplorerGUI::addJsConf ( string  $key,
string  $value 
)

Adds configuration to the study-programme-tree jquery plugin.

Definition at line 450 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

450 : void
451 {
452 $this->js_conf[$key] = $value;
453 }
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key.

◆ checkAccess()

ilObjStudyProgrammeTreeExplorerGUI::checkAccess ( string  $permission,
int  $ref_id 
)
protected

Checks permission of current tree or certain child of it.

Definition at line 432 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

432 : bool
433 {
434 return $this->access->checkAccess($permission, '', $ref_id);
435 }
$ref_id
Definition: ltiauth.php:67

References $ref_id, and ILIAS\Repository\access().

Referenced by __construct(), and getNodeContent().

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

◆ checkAccessOrFail()

ilObjStudyProgrammeTreeExplorerGUI::checkAccessOrFail ( string  $permission,
int  $ref_id 
)
protected

Checks permission of a object and throws an exception if they are not granted.

Definition at line 440 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

440 : void
441 {
442 if (!$this->checkAccess($permission, $ref_id)) {
443 throw new ilException("You have no permission for " . $permission . " Object with ref_id " . $ref_id . "!");
444 }
445 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ref_id.

◆ closeCertainNode()

ilObjStudyProgrammeTreeExplorerGUI::closeCertainNode (   $node_id)

Closes certain node in the tree session The open nodes of a tree are stored in a session.

This function closes a certain node by its id.

Parameters
mixed$node_id

Definition at line 404 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

404 : void
405 {
406 if (in_array($node_id, $this->open_nodes)) {
407 $k = array_search($node_id, $this->open_nodes);
408 unset($this->open_nodes[$k]);
409 }
410 $this->store->set("on_" . $this->id, serialize($this->open_nodes));
411 }

◆ formatPointValue()

ilObjStudyProgrammeTreeExplorerGUI::formatPointValue ( int  $points)
protected

Returns formatted point value.

Definition at line 254 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

254 : string
255 {
256 return '(' . $points . " " . $this->lng->txt('prg_points') . ')';
257 }

References ILIAS\Repository\lng().

Referenced by getNodeContent().

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

◆ getChildsOfNode()

ilObjStudyProgrammeTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get children of node.

Parameters
string$a_parent_node_id
Returns
array

Reimplemented from ilExplorerBaseGUI.

Definition at line 328 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

328 : array
329 {
330 $parent_obj = ilObjectFactoryWrapper::singleton()->getInstanceByRefId((int) $a_parent_node_id);
331
332 $children_with_permission = array();
333
334 // its currently only possible to have children on StudyProgrammes
335 if ($parent_obj instanceof ilObjStudyProgramme) {
336 $children = ($parent_obj->hasChildren()) ? $parent_obj->getChildren() : $parent_obj->getLPChildren();
337
338 if (is_array($children)) {
339 foreach ($children as $node) {
340 if ($this->checkAccess('visible', $node->getRefId())) {
341 $children_with_permission[] = $node;
342 }
343 }
344 }
345 }
346
347 return $children_with_permission;
348 }

References ilObjectFactoryWrapper\singleton().

+ Here is the call graph for this function:

◆ getHTML()

ilObjStudyProgrammeTreeExplorerGUI::getHTML ( )

Returns the output of the complete tree There are added some additional javascripts before output the parent::getHTML()

Reimplemented from ilExplorerBaseGUI.

Definition at line 382 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

382 : string
383 {
384 $this->tpl->addJavascript($this->js_study_programme_path);
385 $this->tpl->addCss($this->css_study_programme_path);
386
387 $this->tpl->addOnLoadCode(
388 '$("#' . $this->getContainerId() . '").study_programme_tree(' . json_encode(
389 $this->js_conf,
390 JSON_THROW_ON_ERROR
391 ) . ');'
392 );
393
394 return parent::getHTML();
395 }

◆ getJsConf()

ilObjStudyProgrammeTreeExplorerGUI::getJsConf ( string  $key)

Returns setting of the study-programme-tree.

Definition at line 458 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

458 : string
459 {
460 return $this->js_conf[$key];
461 }

References ILIAS\LTI\ToolProvider\$key.

◆ getNodeButtonActionLink()

ilObjStudyProgrammeTreeExplorerGUI::getNodeButtonActionLink ( string  $target_class,
string  $cmd,
array  $params,
string  $content,
bool  $async = true 
)
protected

Generate link-element.

Definition at line 262 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

268 : string {
269 foreach ($params as $param_name => $param_value) {
270 $this->ctrl->setParameterByClass($target_class, $param_name, $param_value);
271 }
272
273 $tpl = $this->getNodeTemplateInstance();
274 $tpl->setCurrentBlock('tree-button-block');
275
276 $classes = array($this->class_configuration['node']['node_buttons']);
277 $classes[] = 'cmd_' . $cmd;
278
279 $tpl->setVariable('LINK_HREF', $this->ctrl->getLinkTargetByClass($target_class, $cmd, '', true, false));
280 $tpl->setVariable('LINK_CLASSES', implode(' ', $classes));
281
282 if ($async) {
283 $tpl->touchBlock('enable-async-link');
284 $tpl->setVariable('LINK_DATA_TARGET', '#' . $this->modal_id);
285 }
286
287 $tpl->setVariable('LINK_CONTENT', $content);
288
289 return $tpl->get();
290 }
ilGlobalTemplateInterface $tpl
getNodeTemplateInstance()
Factory method for a new instance of a node template.
touchBlock(string $block)
overwrites ITX::touchBlock.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getNodeContent()

ilObjStudyProgrammeTreeExplorerGUI::getNodeContent (   $a_node)

Return node element.

Parameters
ilObjStudyProgramme | ilObject$a_node
Returns
string

Reimplemented from ilExplorerBaseGUI.

Definition at line 101 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

101 : string
102 {
103 $current_ref_id = -1;
104 if ($this->request_wrapper->has("ref_id")) {
105 $current_ref_id = $this->request_wrapper->retrieve("ref_id", $this->refinery->kindlyTo()->int());
106 }
107
108 $is_current_node = ($a_node->getRefId() == $current_ref_id);
109 $is_study_programme = ($a_node instanceof ilObjStudyProgramme);
110 $is_root_node = ($is_study_programme && $a_node->getRoot() == null);
111
112 // show delete only on not current elements and not root
113 $is_delete_enabled = ($is_study_programme && ($is_current_node || $is_root_node)) ? false : $this->checkAccess("delete", $current_ref_id);
114
115 $is_creation_enabled = ($this->checkAccess("create", $current_ref_id));
116
117 $node_config = array(
118 'current_ref_id' => $current_ref_id,
119 'is_current_node' => $is_current_node,
120 'is_delete_enabled' => $is_delete_enabled,
121 'is_creation_enabled' => $is_creation_enabled,
122 'is_study_programme' => $is_study_programme,
123 'is_root_node' => $is_root_node
124 );
125
126 // TODO: find way to remove a-tag around the content, to create valid html
127 $tpl = $this->getNodeTemplateInstance();
128
129 // add the tree buttons
130 if ($this->checkAccess('write', $a_node->getRefId())) {
131 if ($is_study_programme) {
132 $this->parseStudyProgrammeNodeButtons($a_node, $node_config, $tpl);
133 } else {
134 $this->parseLeafNodeButtons($a_node, $node_config, $tpl);
135 }
136 }
137
138 $tpl->setCurrentBlock('node-content-block');
139 $tpl->setVariable('NODE_TITLE_CLASSES', implode(' ', $this->getNodeTitleClasses($node_config)));
140 $tpl->setVariable('NODE_TITLE', $a_node->getTitle());
141
142 if ($is_study_programme) {
143 $tpl->setVariable('NODE_POINT_CLASSES', $this->class_configuration['node']['node_point']);
144 $tpl->setVariable('NODE_POINTS', $this->formatPointValue($a_node->getPoints()));
145 }
146
147 $tpl->parseCurrentBlock('node-content-block');
148
149 return $tpl->get();
150 }
getNodeTitleClasses(array $node_config)
Returns array with all css classes of the title node element.
parseStudyProgrammeNodeButtons(ilObjStudyProgramme $node, array $node_config, ilTemplate $tpl)
Generates the buttons for a study-programme node.
parseLeafNodeButtons(ilObject $node, array $node_config, ilTemplate $tpl)
Generates the buttons for a study programme leaf.
formatPointValue(int $points)
Returns formatted point value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.

References ilExplorerBaseGUI\$tpl, checkAccess(), formatPointValue(), ilGlobalTemplateInterface\get(), getNodeTemplateInstance(), getNodeTitleClasses(), ilGlobalTemplateInterface\parseCurrentBlock(), parseLeafNodeButtons(), parseStudyProgrammeNodeButtons(), ILIAS\Repository\refinery(), ilGlobalTemplateInterface\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

+ Here is the call graph for this function:

◆ getNodeHref()

ilObjStudyProgrammeTreeExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
object | array$a_node
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

Definition at line 314 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

314 : string
315 {
316 global $DIC;
317 $ilCtrl = $DIC['ilCtrl'];
318
319 if ($ilCtrl->getCmd() === "performPaste") {
320 $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "target_node", $node->getRefId());
321 }
322
323 $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "ref_id", $node->getRefId());
324
325 return '#';
326 }

References $DIC, and ilObject\getRefId().

+ Here is the call graph for this function:

◆ getNodeIcon()

ilObjStudyProgrammeTreeExplorerGUI::getNodeIcon (   $a_node)

Get node icon path.

Parameters
object | array$a_node
Returns
string image file path

Reimplemented from ilExplorerBaseGUI.

Definition at line 301 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

301 : string
302 {
303 global $DIC;
304 $ilias = $DIC['ilias'];
305
306 $obj_id = ilObject::_lookupObjId($node->getRefId());
307 if ($ilias->getSetting('custom_icons')) {
308 //TODO: implement custom icon functionality
309 }
310
311 return ilObject::_getIcon($obj_id, "tiny");
312 }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)

References $DIC, ilObject\_getIcon(), ilObject\_lookupObjId(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ getNodeId()

ilObjStudyProgrammeTreeExplorerGUI::getNodeId (   $a_node)

Get id of a node.

Parameters
object | array$a_nodenode array or object
Returns
string id of node

Reimplemented from ilExplorerBaseGUI.

Definition at line 350 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

350 : ?int
351 {
352 if (!is_null($a_node)) {
353 return $a_node->getRefId();
354 }
355 return null;
356 }

◆ getNodeTemplateInstance()

ilObjStudyProgrammeTreeExplorerGUI::getNodeTemplateInstance ( )
protected

Factory method for a new instance of a node template.

Definition at line 246 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

246 : ilTemplate
247 {
248 return new ilTemplate("tpl.tree_node_content.html", true, true, "Modules/StudyProgramme");
249 }
special template class to simplify handling of ITX/PEAR

Referenced by getNodeContent().

+ Here is the caller graph for this function:

◆ getNodeTitleClasses()

ilObjStudyProgrammeTreeExplorerGUI::getNodeTitleClasses ( array  $node_config)
protected

Returns array with all css classes of the title node element.

Definition at line 155 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

155 : array
156 {
157 $node_title_classes = array($this->class_configuration['node']['node_title']);
158 if ($node_config['is_study_programme']) {
159 if ($node_config['is_current_node']) {
160 $node_title_classes[] = $this->class_configuration['node']['node_current'];
161 }
162 } else {
163 $node_title_classes[] = $this->class_configuration['lp_object'];
164 }
165
166 return $node_title_classes;
167 }

Referenced by getNodeContent().

+ Here is the caller graph for this function:

◆ getRootNode()

ilObjStudyProgrammeTreeExplorerGUI::getRootNode ( )

Return root node of tree.

Reimplemented from ilExplorerBaseGUI.

Definition at line 295 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

296 {
297 $node = ilObjStudyProgramme::getInstanceByRefId($this->tree_root_id);
298 return $node;
299 }

References ilObjStudyProgramme\getInstanceByRefId().

+ Here is the call graph for this function:

◆ listItemStart()

ilObjStudyProgrammeTreeExplorerGUI::listItemStart ( ilTemplate  $tpl,
  $a_node 
)

List item start.

Parameters
object | array$a_node

Reimplemented from ilExplorerBaseGUI.

Definition at line 358 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

358 : void
359 {
360 $tpl->setCurrentBlock("list_item_start");
361
362 if (
363 ($this->getAjax() && $this->nodeHasVisibleChilds($a_node)) ||
364 ($a_node instanceof ilObjStudyProgramme && $a_node->getParent() === null)
365 ) {
366 $tpl->touchBlock("li_closed");
367 }
368
370 "DOM_NODE_ID",
371 $this->getDomNodeIdForNodeId($this->getNodeId($a_node))
372 );
374 $tpl->touchBlock("tag");
375 }
getDomNodeIdForNodeId($a_node_id)
Get DOM node id for node id.
nodeHasVisibleChilds($a_node)
Node has children Please note that this standard method may not be optimal depending on what a derive...
getParent()
Get the parent ilObjStudyProgramme of this object.

References $tpl, and ilObjStudyProgramme\getParent().

+ Here is the call graph for this function:

◆ openCertainNode()

ilObjStudyProgrammeTreeExplorerGUI::openCertainNode (   $node_id)

Open certain node in the tree session The open nodes of a tree are stored in a session.

This function opens a certain node by its id.

Parameters
mixed$node_id

Definition at line 419 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

419 : void
420 {
421 $id = $this->getNodeIdForDomNodeId($node_id);
422 if (!in_array($id, $this->open_nodes)) {
423 $this->open_nodes[] = $id;
424 }
425 $this->store->set("on_" . $this->id, serialize($this->open_nodes));
426 }
getNodeIdForDomNodeId(string $a_dom_node_id)
Get node id for dom node id.

References $id.

◆ parseLeafNodeButtons()

ilObjStudyProgrammeTreeExplorerGUI::parseLeafNodeButtons ( ilObject  $node,
array  $node_config,
ilTemplate  $tpl 
)
protected

Generates the buttons for a study programme leaf.

Parameters
ilObject$nodeparsed node
array$node_configconfiguration of current node
ilTemplate$tplcurrent node template

Definition at line 225 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

225 : void
226 {
227 $tpl->setCurrentBlock('enable-tree-buttons');
228
229 // only show delete button when its not the current node
230 if ($node_config['is_delete_enabled']) {
231 $delete_button = $this->getNodeButtonActionLink(
232 'ilObjStudyProgrammeTreeGUI',
233 'delete',
234 array('ref_id' => $node->getRefId(), 'item_ref_id' => $node_config['current_ref_id']),
236 );
237 $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
238 }
239
240 $tpl->parseCurrentBlock('enable-tree-buttons');
241 }
static get(string $a_glyph, string $a_text="")
getNodeButtonActionLink(string $target_class, string $cmd, array $params, string $content, bool $async=true)
Generate link-element.

References $tpl, ilGlyphGUI\get(), ilObject\getRefId(), and ilGlyphGUI\REMOVE.

Referenced by getNodeContent().

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

◆ parseStudyProgrammeNodeButtons()

ilObjStudyProgrammeTreeExplorerGUI::parseStudyProgrammeNodeButtons ( ilObjStudyProgramme  $node,
array  $node_config,
ilTemplate  $tpl 
)
protected

Generates the buttons for a study-programme node.

Parameters
ilObjStudyProgramme$nodeparsed node
array$node_configconfiguration of current node
ilTemplate$tplcurrent node template

Definition at line 177 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

181 : void {
182 $tpl->setCurrentBlock('enable-tree-buttons');
183
184 // show info button only when it not the current node
185 $info_button = $this->getNodeButtonActionLink(
186 'ilObjStudyProgrammeSettingsGUI',
187 'view',
188 array('ref_id' => $node->getRefId(), 'currentNode' => $node_config['is_current_node']),
190 );
191 $tpl->setVariable('NODE_INFO_BUTTON', $info_button);
192
193 // only show add button when create permission is set
194 if ($node_config['is_creation_enabled']) {
195 $create_button = $this->getNodeButtonActionLink(
196 'ilObjStudyProgrammeTreeGUI',
197 'create',
198 array('ref_id' => $node->getRefId()),
200 );
201 $tpl->setVariable('NODE_CREATE_BUTTON', $create_button);
202 }
203
204 // only show delete button when its not the current node, not the root-node and delete permissions are set
205 if ($node_config['is_delete_enabled']) {
206 $delete_button = $this->getNodeButtonActionLink(
207 'ilObjStudyProgrammeTreeGUI',
208 'delete',
209 array('ref_id' => $node->getRefId(), 'item_ref_id' => $node_config['current_ref_id']),
211 );
212 $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
213 }
214
215 $tpl->parseCurrentBlock('enable-tree-buttons');
216 }

Referenced by getNodeContent().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilObjStudyProgrammeTreeExplorerGUI::$access
protected

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

◆ $class_configuration

array ilObjStudyProgrammeTreeExplorerGUI::$class_configuration
protected
Initial value:
= [
'node' => [
'node_title' => 'title',
'node_point' => 'points',
'node_current' => 'ilHighlighted current_node',
'node_buttons' => 'tree_button'
],
'lp_object' => 'lp-object',
]

default classes of the tree [key=>class_name]

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

◆ $css_study_programme_path

string ilObjStudyProgrammeTreeExplorerGUI::$css_study_programme_path = "./Modules/StudyProgramme/templates/css/ilStudyProgrammeTree.css"
protected

Definition at line 63 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $js_conf

array ilObjStudyProgrammeTreeExplorerGUI::$js_conf
protected

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

◆ $js_study_programme_path

string ilObjStudyProgrammeTreeExplorerGUI::$js_study_programme_path = "./Modules/StudyProgramme/templates/js/ilStudyProgramme.js"
protected

Definition at line 62 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $lng

ilLanguage ilObjStudyProgrammeTreeExplorerGUI::$lng
protected

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

◆ $modal_id

string ilObjStudyProgrammeTreeExplorerGUI::$modal_id
protected

Definition at line 42 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by __construct().

◆ $refinery

ILIAS Refinery Factory ilObjStudyProgrammeTreeExplorerGUI::$refinery
protected

Definition at line 35 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $request_wrapper

ILIAS HTTP Wrapper RequestWrapper ilObjStudyProgrammeTreeExplorerGUI::$request_wrapper
protected

Definition at line 34 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $toolbar

ilToolbarGUI ilObjStudyProgrammeTreeExplorerGUI::$toolbar
protected

Definition at line 33 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $tree_root_id

int ilObjStudyProgrammeTreeExplorerGUI::$tree_root_id
protected

Definition at line 37 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by __construct().


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