ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjStudyProgrammeTreeExplorerGUI Class Reference

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. More...

+ Inheritance diagram for ilObjStudyProgrammeTreeExplorerGUI:
+ Collaboration diagram for ilObjStudyProgrammeTreeExplorerGUI:

Public Member Functions

 __construct ($a_tree_root_id, $modal_id, $a_expl_id, $a_parent_obj, $a_parent_cmd)
 
 getNodeContent ($node)
 Return node element. More...
 
 getRootNode ()
 Return root node of tree. More...
 
 getNodeIcon ($a_node)
 Get node icon Return custom icon of OrgUnit type if existing. More...
 
 getNodeHref ($node)
 Returns node link target. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 listItemStart ($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 ($key, $value)
 Adds configuration to the study-programme-tree jquery plugin. More...
 
 getJsConf ($key)
 Returns setting of the study-programme-tree. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs 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 childs? More...
 
 sortChilds ($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 ($a_val)
 Set skip root node. More...
 
 getSkipRootNode ()
 Get skip root node. More...
 
 setAjax ($a_val)
 Set ajax. More...
 
 getAjax ()
 Get ajax. More...
 
 setSecondaryHighlightedNodes ($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 ($a_postvar, $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 ($a_val)
 Set offline mode. More...
 
 getOfflineMode ()
 Get offline mode. More...
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 Get container id. More...
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 Get HTML. More...
 
 renderNode ($a_node, $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart ($tpl, $a_node)
 List item start. More...
 
 listItemEnd ($tpl)
 List item end. More...
 
 listStart ($tpl)
 List start. More...
 
 listEnd ($tpl)
 List end. More...
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled ($nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd ($enable_dnd)
 Enable Drag & Drop functionality. More...
 

Protected Member Functions

 getNodeTitleClasses ($node_config)
 Returns array with all css classes of the title node element. More...
 
 parseStudyProgrammeNodeButtons ($node, $node_config, $tpl)
 Generates the buttons for a study-programme node. More...
 
 parseLeafNodeButtons ($node, $node_config, $tpl)
 Generates the buttons for a study programme leaf. More...
 
 getNodeTemplateInstance ()
 Factory method for a new instance of a node template. More...
 
 formatPointValue ($points)
 Returns formatted point value. More...
 
 getNodeButtonActionLink ($target_class, $cmd, $params, $content, $async=true)
 Generate link-element. More...
 
 checkAccess ($permission, $ref_id)
 Checks permission of current tree or certain child of it. More...
 
 checkAccessOrFail ($permission, $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...
 
 getJSTreePlugins ()
 

Protected Attributes

 $js_study_programme_path = "./Modules/StudyProgramme/templates/js/ilStudyProgramme.js"
 
 $css_study_programme_path = "./Modules/StudyProgramme/templates/css/ilStudyProgrammeTree.css"
 
 $tree_root_id
 
 $access
 
 $lng
 
 $tpl
 
 $toolbar
 
 $ctrl
 
 $modal_id
 
 $js_conf
 
 $class_configuration
 
 $node_template
 
- Protected Attributes inherited from ilExplorerBaseGUI
 $skip_root_node = false
 
 $ajax = false
 
 $custom_open_nodes = array()
 
 $selected_nodes = array()
 
 $select_postvar = ""
 
 $offline_mode = false
 
 $sec_highl_nodes = array()
 
 $enable_dnd = false
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ()
 Init JS. More...
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./Services/UIComponent/Explorer2/lib/jstree-v.pre1.0/jquery.jstree.js"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

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 16 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeTreeExplorerGUI::__construct (   $a_tree_root_id,
  $modal_id,
  $a_expl_id,
  $a_parent_obj,
  $a_parent_cmd 
)
Parameters
$a_expl_id
$a_parent_obj
$a_parent_cmd
$a_tree

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

86 {
87 global $DIC;
88 $ilAccess = $DIC['ilAccess'];
89 $lng = $DIC['lng'];
90 $tpl = $DIC['tpl'];
91 $ilToolbar = $DIC['ilToolbar'];
92 $ilCtrl = $DIC['ilCtrl'];
93
94 parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd);
95
96 $this->tree_root_id = $a_tree_root_id;
97
98 $this->access = $ilAccess;
99 $this->lng = $lng;
100 $this->tpl = $tpl;
101 $this->toolbar = $ilToolbar;
102 $this->ctrl = $ilCtrl;
103 $this->modal_id = $modal_id;
104 $this->js_conf = array();
105
106 $lng->loadLanguageModule("prg");
107
108 $this->setAjax(true);
109
110 if($this->checkAccess('write', $a_tree_root_id)) {
111 $this->setEnableDnd(true);
112 }
113 }
setEnableDnd($enable_dnd)
Enable Drag & Drop functionality.
checkAccess($permission, $ref_id)
Checks permission of current tree or certain child of it.
global $ilCtrl
Definition: ilias.php:18
global $DIC

References $DIC, $ilCtrl, $lng, $modal_id, $tpl, checkAccess(), ilExplorerBaseGUI\setAjax(), and ilExplorerBaseGUI\setEnableDnd().

+ Here is the call graph for this function:

Member Function Documentation

◆ addJsConf()

ilObjStudyProgrammeTreeExplorerGUI::addJsConf (   $key,
  $value 
)

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

Parameters
array$js_conf

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

519 {
520 $this->js_conf[$key] = $value;
521 }

◆ checkAccess()

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

Checks permission of current tree or certain child of it.

Parameters
string$permission
null$ref_id
Returns
bool

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

493 {
494 $checker = $this->access->checkAccess($permission, '', $ref_id);
495
496 return $checker;
497 }
$ref_id
Definition: sahs_server.php:39

References $ref_id.

Referenced by __construct(), checkAccessOrFail(), getChildsOfNode(), and getNodeContent().

+ Here is the caller graph for this function:

◆ checkAccessOrFail()

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

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

Parameters
string$permission
null$ref_id
Exceptions
ilException

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

508 {
509 if(!$this->checkAccess($permission, $ref_id)) {
510 throw new ilException("You have no permission for ".$permission." Object with ref_id ".$ref_id."!");
511 }
512 }
Base class for ILIAS Exception handling.

References $ref_id, and checkAccess().

+ Here is the call graph for this function:

◆ 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
int$node_id

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

460 {
461 if (in_array($node_id, $this->open_nodes))
462 {
463 $k = array_search($node_id, $this->open_nodes);
464 unset($this->open_nodes[$k]);
465 }
466 $this->store->set("on_".$this->id, serialize($this->open_nodes));
467 }

◆ formatPointValue()

ilObjStudyProgrammeTreeExplorerGUI::formatPointValue (   $points)
protected

Returns formatted point value.

Parameters
$points
Returns
string

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

261 {
262 return '('. $points ." ".$this->lng->txt('prg_points').')';
263 }

Referenced by getNodeContent().

+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilObjStudyProgrammeTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
$a_parent_node_id

@global ilAccess

Reimplemented from ilExplorerBaseGUI.

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

366 {
367 global $DIC;
368 $ilAccess = $DIC['ilAccess'];
369
370 $parent_obj = ilObjectFactoryWrapper::singleton()->getInstanceByRefId($a_parent_node_id);
371
372 $children_with_permission = array();
373
374 // its currently only possible to have children on StudyProgrammes
375 if($parent_obj instanceof ilObjStudyProgramme) {
376 $children = ($parent_obj->hasChildren())? $parent_obj->getChildren() : $parent_obj->getLPChildren();
377
378 if(is_array($children)) {
379 foreach($children as $node) {
380 if($this->checkAccess('visible', $node->getRefId())) {
381 $children_with_permission[] = $node;
382 }
383 }
384 }
385 }
386
387 return $children_with_permission;
388 }
Class ilObjStudyProgramme.

References $DIC, checkAccess(), and 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()

Returns
string

Reimplemented from ilExplorerBaseGUI.

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

444 {
445 $this->tpl->addJavascript($this->js_study_programme_path);
446 $this->tpl->addCss($this->css_study_programme_path);
447
448 $this->tpl->addOnLoadCode('$("#'.$this->getContainerId().'").study_programme_tree('.json_encode($this->js_conf).');');
449
450 return parent::getHTML();
451 }
getContainerId()
Get container id.

References ilExplorerBaseGUI\getContainerId().

+ Here is the call graph for this function:

◆ getJsConf()

ilObjStudyProgrammeTreeExplorerGUI::getJsConf (   $key)

Returns setting of the study-programme-tree.

Parameters
array$js_conf

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

528 {
529 return $this->js_conf[$key];
530 }

◆ getNodeButtonActionLink()

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

Generate link-element.

Parameters
$target_class
$cmd
$paramsurl-params send to the
$content
bool$async
Returns
string

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

276 {
277 foreach($params as $param_name=>$param_value) {
278 $this->ctrl->setParameterByClass($target_class, $param_name, $param_value);
279 }
280
281 $tpl = $this->getNodeTemplateInstance();
282 //$tpl->free();
283 $tpl->setCurrentBlock('tree-button-block');
284
285 $classes = array($this->class_configuration['node']['node_buttons']);
286 $classes[] = 'cmd_'.$cmd;
287
288 $tpl->setVariable('LINK_HREF', $this->ctrl->getLinkTargetByClass($target_class, $cmd, '', true, false));
289 $tpl->setVariable('LINK_CLASSES', implode(' ', $classes));
290
291 if($async) {
292 $tpl->touchBlock('enable-async-link');
293 $tpl->setVariable('LINK_DATA_TARGET', '#'.$this->modal_id);
294 }
295
296 $tpl->setVariable('LINK_CONTENT', $content);
297
298 //$tpl->parseCurrentBlock('tree-button-block');
299
300 return $tpl->get();
301 }
getNodeTemplateInstance()
Factory method for a new instance of a node template.
$params
Definition: example_049.php:96
$cmd
Definition: sahs_server.php:35

References $cmd, $params, $tpl, and getNodeTemplateInstance().

Referenced by parseLeafNodeButtons(), and parseStudyProgrammeNodeButtons().

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

◆ getNodeContent()

ilObjStudyProgrammeTreeExplorerGUI::getNodeContent (   $node)

Return node element.

Parameters
ilObjStudyProgramme | ilObject$node
Returns
string

Reimplemented from ilExplorerBaseGUI.

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

123 {
124 global $DIC;
125 $lng = $DIC['lng'];
126 $ilAccess = $DIC['ilAccess'];
127
128 $current_ref_id = (isset($_GET["ref_id"]))? $_GET["ref_id"] : -1;
129
130 $is_current_node = ($node->getRefId() == $current_ref_id);
131 $is_study_programme = ($node instanceof ilObjStudyProgramme);
132 $is_root_node = ($is_study_programme && $node->getRoot() == null);
133
134 // show delete only on not current elements and not root
135 $is_delete_enabled = ($is_study_programme && ($is_current_node || $is_root_node))? false : $this->checkAccess("delete", $current_ref_id);
136
137 $is_creation_enabled = ($this->checkAccess("create", $current_ref_id));
138
139 $node_config = array(
140 'current_ref_id' =>$current_ref_id,
141 'is_current_node' => $is_current_node,
142 'is_delete_enabled' => $is_delete_enabled,
143 'is_creation_enabled' => $is_creation_enabled,
144 'is_study_programme' => $is_study_programme,
145 'is_root_node' => $is_root_node
146 );
147
148 // TODO: find way to remove a-tag around the content, to create valid html
149 $tpl = $this->getNodeTemplateInstance();
150
151 $tpl->setCurrentBlock('node-content-block');
152 $tpl->setVariable('NODE_TITLE_CLASSES', implode(' ', $this->getNodeTitleClasses($node_config)));
153 $tpl->setVariable('NODE_TITLE', $node->getTitle());
154
155 if($is_study_programme) {
156 $tpl->setVariable('NODE_POINT_CLASSES', $this->class_configuration['node']['node_point']);
157 $tpl->setVariable('NODE_POINTS', $this->formatPointValue($node->getPoints()));
158 }
159
160 $tpl->parseCurrentBlock('node-content-block');
161
162 // add the tree buttons
163 if($this->checkAccess('write', $node->getRefId())) {
164 if($is_study_programme) {
165 $this->parseStudyProgrammeNodeButtons($node, $node_config, $tpl);
166 } else {
167 $this->parseLeafNodeButtons($node, $node_config, $tpl);
168 }
169 }
170
171 return $tpl->get();
172 }
$_GET["client_id"]
parseStudyProgrammeNodeButtons($node, $node_config, $tpl)
Generates the buttons for a study-programme node.
formatPointValue($points)
Returns formatted point value.
getNodeTitleClasses($node_config)
Returns array with all css classes of the title node element.
parseLeafNodeButtons($node, $node_config, $tpl)
Generates the buttons for a study programme leaf.

References $_GET, $DIC, $lng, $tpl, checkAccess(), formatPointValue(), getNodeTemplateInstance(), getNodeTitleClasses(), parseLeafNodeButtons(), and parseStudyProgrammeNodeButtons().

+ Here is the call graph for this function:

◆ getNodeHref()

ilObjStudyProgrammeTreeExplorerGUI::getNodeHref (   $node)

Returns node link target.

Parameters
mixed$node
Returns
string

Reimplemented from ilExplorerBaseGUI.

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

344 {
345 global $DIC;
346 $ilCtrl = $DIC['ilCtrl'];
347
348 if ($ilCtrl->getCmd() == "performPaste") {
349 $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "target_node", $node->getRefId());
350 }
351
352 $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "ref_id", $node->getRefId());
353
354 return '#';
355 }

References $DIC, and $ilCtrl.

◆ getNodeIcon()

ilObjStudyProgrammeTreeExplorerGUI::getNodeIcon (   $a_node)

Get node icon Return custom icon of OrgUnit type if existing.

Parameters
array$a_node
Returns
string

Reimplemented from ilExplorerBaseGUI.

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

324 {
325 global $DIC;
326 $ilias = $DIC['ilias'];
327
328 $obj_id = ilObject::_lookupObjId($a_node->getRefId());
329 if ($ilias->getSetting('custom_icons')) {
330 //TODO: implement custom icon functionality
331 }
332
333 return ilObject::_getIcon($obj_id, "tiny");
334 }
static _lookupObjId($a_id)
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.

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

+ Here is the call graph for this function:

◆ getNodeId()

ilObjStudyProgrammeTreeExplorerGUI::getNodeId (   $a_node)

Get id of a node.

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

Reimplemented from ilExplorerBaseGUI.

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

410 {
411 if(!is_null($a_node)) {
412 return $a_node->getRefId();
413 }
414 return null;
415 }

Referenced by listItemStart().

+ Here is the caller graph for this function:

◆ getNodeTemplateInstance()

ilObjStudyProgrammeTreeExplorerGUI::getNodeTemplateInstance ( )
protected

Factory method for a new instance of a node template.

Returns
ilTemplate

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

250 {
251 return new ilTemplate("tpl.tree_node_content.html", true, true, "Modules/StudyProgramme");
252 }
special template class to simplify handling of ITX/PEAR

Referenced by getNodeButtonActionLink(), and getNodeContent().

+ Here is the caller graph for this function:

◆ getNodeTitleClasses()

ilObjStudyProgrammeTreeExplorerGUI::getNodeTitleClasses (   $node_config)
protected

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

Parameters
array$node_config
Returns
array

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

181 {
182 $node_title_classes = array($this->class_configuration['node']['node_title']);
183 if($node_config['is_study_programme']){
184 if ($node_config['is_current_node']) {
185 array_push($node_title_classes, $this->class_configuration['node']['node_current']);
186 }
187 } else {
188 array_push($node_title_classes, $this->class_configuration['lp_object']);
189 }
190
191 return $node_title_classes;
192 }

Referenced by getNodeContent().

+ Here is the caller graph for this function:

◆ getRootNode()

ilObjStudyProgrammeTreeExplorerGUI::getRootNode ( )

Return root node of tree.

Returns
mixed

Reimplemented from ilExplorerBaseGUI.

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

308 {
309 $node = ilObjStudyProgramme::getInstanceByRefId($this->tree_root_id);
310 if($node->getRoot() != NULL) {
311 return $node->getRoot();
312 }
313 return $node;
314 }
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.

References ilObjStudyProgramme\getInstanceByRefId().

+ Here is the call graph for this function:

◆ isNodeClickable()

ilObjStudyProgrammeTreeExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
mixed$a_nodenode object/array

@global ilAccessHandler $ilAccess

Returns
boolean node clickable true/false

Reimplemented from ilExplorerBaseGUI.

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

398 {
399 return true;
400 }

◆ listItemStart()

ilObjStudyProgrammeTreeExplorerGUI::listItemStart (   $tpl,
  $a_node 
)

List item start.

Parameters

return

Reimplemented from ilExplorerBaseGUI.

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

424 {
425 $tpl->setCurrentBlock("list_item_start");
426
427 if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node) || ($a_node instanceof ilStudyProgramme && $a_node->getParent() === null))
428 {
429 $tpl->touchBlock("li_closed");
430 }
431 $tpl->setVariable("DOM_NODE_ID",
432 $this->getDomNodeIdForNodeId($this->getNodeId($a_node)));
433 $tpl->parseCurrentBlock();
434 $tpl->touchBlock("tag");
435 }
getDomNodeIdForNodeId($a_node_id)
Get DOM node id for node id.
nodeHasVisibleChilds($a_node)
Node has childs?
Class ilStudyProgramme.

References $tpl, ilExplorerBaseGUI\getAjax(), ilExplorerBaseGUI\getDomNodeIdForNodeId(), getNodeId(), and ilExplorerBaseGUI\nodeHasVisibleChilds().

+ 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
int$node_id

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

475 {
476 $id = $this->getNodeIdForDomNodeId($node_id);
477 if (!in_array($id, $this->open_nodes))
478 {
479 $this->open_nodes[] = $id;
480 }
481 $this->store->set("on_".$this->id, serialize($this->open_nodes));
482 }
getNodeIdForDomNodeId($a_dom_node_id)
Get node id for dom node id.

References ilExplorerBaseGUI\getNodeIdForDomNodeId().

+ Here is the call graph for this function:

◆ parseLeafNodeButtons()

ilObjStudyProgrammeTreeExplorerGUI::parseLeafNodeButtons (   $node,
  $node_config,
  $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 232 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

232 {
233 $tpl->setCurrentBlock('enable-tree-buttons');
234 $tpl->touchBlock('enable-tree-buttons');
235
236 // only show delete button when its not the current node
237 if($node_config['is_delete_enabled']) {
238 $delete_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'delete', array('ref_id'=>$node->getRefId(), 'item_ref_id'=>$node_config['current_ref_id']), ilGlyphGUI::get(ilGlyphGUI::REMOVE));
239 $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
240 }
241
242 $tpl->parseCurrentBlock('enable-tree-buttons');
243 }
static get($a_glyph, $a_text="")
Get glyph html.
getNodeButtonActionLink($target_class, $cmd, $params, $content, $async=true)
Generate link-element.

References $tpl, ilGlyphGUI\get(), getNodeButtonActionLink(), 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 (   $node,
  $node_config,
  $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 202 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

202 {
203 $tpl->setCurrentBlock('enable-tree-buttons');
204 $tpl->touchBlock('enable-tree-buttons');
205
206 // show info button only when it not the current node
207 $info_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeSettingsGUI', 'view', array('ref_id'=>$node->getRefId(), 'currentNode'=>$node_config['is_current_node']), ilGlyphGUI::get(ilGlyphGUI::INFO));
208 $tpl->setVariable('NODE_INFO_BUTTON', $info_button);
209
210 // only show add button when create permission is set
211 if($node_config['is_creation_enabled']) {
212 $create_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'create', array('ref_id'=>$node->getRefId()), ilGlyphGUI::get(ilGlyphGUI::ADD));
213 $tpl->setVariable('NODE_CREATE_BUTTON', $create_button);
214 }
215
216 // only show delete button when its not the current node, not the root-node and delete permissions are set
217 if($node_config['is_delete_enabled']) {
218 $delete_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'delete', array('ref_id'=>$node->getRefId(), 'item_ref_id'=>$node_config['current_ref_id']), ilGlyphGUI::get(ilGlyphGUI::REMOVE));
219 $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
220 }
221
222 $tpl->parseCurrentBlock('enable-tree-buttons');
223 }

References $tpl, ilGlyphGUI\ADD, ilGlyphGUI\get(), getNodeButtonActionLink(), ilGlyphGUI\INFO, and ilGlyphGUI\REMOVE.

Referenced by getNodeContent().

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

Field Documentation

◆ $access

ilObjStudyProgrammeTreeExplorerGUI::$access
protected

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

◆ $class_configuration

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

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

◆ $css_study_programme_path

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

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

◆ $ctrl

ilObjStudyProgrammeTreeExplorerGUI::$ctrl
protected

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

◆ $js_conf

ilObjStudyProgrammeTreeExplorerGUI::$js_conf
protected

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

◆ $js_study_programme_path

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

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

◆ $lng

ilObjStudyProgrammeTreeExplorerGUI::$lng
protected

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

Referenced by __construct(), and getNodeContent().

◆ $modal_id

ilObjStudyProgrammeTreeExplorerGUI::$modal_id
protected

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

Referenced by __construct().

◆ $node_template

ilObjStudyProgrammeTreeExplorerGUI::$node_template
protected

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

◆ $toolbar

ilObjStudyProgrammeTreeExplorerGUI::$toolbar
protected

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

◆ $tpl

◆ $tree_root_id

ilObjStudyProgrammeTreeExplorerGUI::$tree_root_id
protected

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


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