ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 $ilAccess, $lng, $tpl, $ilToolbar, $ilCtrl;
88
89 parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd);
90
91 $this->tree_root_id = $a_tree_root_id;
92
93 $this->access = $ilAccess;
94 $this->lng = $lng;
95 $this->tpl = $tpl;
96 $this->toolbar = $ilToolbar;
97 $this->ctrl = $ilCtrl;
98 $this->modal_id = $modal_id;
99 $this->js_conf = array();
100
101 $lng->loadLanguageModule("prg");
102
103 $this->setAjax(true);
104
105 if($this->checkAccess('write', $a_tree_root_id)) {
106 $this->setEnableDnd(true);
107 }
108 }
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

References $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 509 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

509 {
510 $this->js_conf[$key] = $value;
511 }

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

483 {
484 $checker = $this->access->checkAccess($permission, '', $ref_id);
485
486 return $checker;
487 }
$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 498 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

498 {
499 if(!$this->checkAccess($permission, $ref_id)) {
500 throw new ilException("You have no permission for ".$permission." Object with ref_id ".$ref_id."!");
501 }
502 }
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 450 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

450 {
451 if (in_array($node_id, $this->open_nodes))
452 {
453 $k = array_search($node_id, $this->open_nodes);
454 unset($this->open_nodes[$k]);
455 }
456 $this->store->set("on_".$this->id, serialize($this->open_nodes));
457 }

◆ formatPointValue()

ilObjStudyProgrammeTreeExplorerGUI::formatPointValue (   $points)
protected

Returns formatted point value.

Parameters
$points
Returns
string

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

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

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

357 {
358 global $ilAccess;
359
360 $parent_obj = ilObjectFactoryWrapper::singleton()->getInstanceByRefId($a_parent_node_id);
361
362 $children_with_permission = array();
363
364 // its currently only possible to have children on StudyProgrammes
365 if($parent_obj instanceof ilObjStudyProgramme) {
366 $children = ($parent_obj->hasChildren())? $parent_obj->getChildren() : $parent_obj->getLPChildren();
367
368 if(is_array($children)) {
369 foreach($children as $node) {
370 if($this->checkAccess('visible', $node->getRefId())) {
371 $children_with_permission[] = $node;
372 }
373 }
374 }
375 }
376
377 return $children_with_permission;
378 }
Class ilObjStudyProgramme.

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

434 {
435 $this->tpl->addJavascript($this->js_study_programme_path);
436 $this->tpl->addCss($this->css_study_programme_path);
437
438 $this->tpl->addOnLoadCode('$("#'.$this->getContainerId().'").study_programme_tree('.json_encode($this->js_conf).');');
439
440 return parent::getHTML();
441 }
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 518 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

518 {
519 return $this->js_conf[$key];
520 }

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

269 {
270 foreach($params as $param_name=>$param_value) {
271 $this->ctrl->setParameterByClass($target_class, $param_name, $param_value);
272 }
273
274 $tpl = $this->getNodeTemplateInstance();
275 //$tpl->free();
276 $tpl->setCurrentBlock('tree-button-block');
277
278 $classes = array($this->class_configuration['node']['node_buttons']);
279 $classes[] = 'cmd_'.$cmd;
280
281 $tpl->setVariable('LINK_HREF', $this->ctrl->getLinkTargetByClass($target_class, $cmd, '', true, false));
282 $tpl->setVariable('LINK_CLASSES', implode(' ', $classes));
283
284 if($async) {
285 $tpl->touchBlock('enable-async-link');
286 $tpl->setVariable('LINK_DATA_TARGET', '#'.$this->modal_id);
287 }
288
289 $tpl->setVariable('LINK_CONTENT', $content);
290
291 //$tpl->parseCurrentBlock('tree-button-block');
292
293 return $tpl->get();
294 }
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 118 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

118 {
119 global $lng, $ilAccess;
120
121 $current_ref_id = (isset($_GET["ref_id"]))? $_GET["ref_id"] : -1;
122
123 $is_current_node = ($node->getRefId() == $current_ref_id);
124 $is_study_programme = ($node instanceof ilObjStudyProgramme);
125 $is_root_node = ($is_study_programme && $node->getRoot() == null);
126
127 // show delete only on not current elements and not root
128 $is_delete_enabled = ($is_study_programme && ($is_current_node || $is_root_node))? false : $this->checkAccess("delete", $current_ref_id);
129
130 $is_creation_enabled = ($this->checkAccess("create", $current_ref_id));
131
132 $node_config = array(
133 'current_ref_id' =>$current_ref_id,
134 'is_current_node' => $is_current_node,
135 'is_delete_enabled' => $is_delete_enabled,
136 'is_creation_enabled' => $is_creation_enabled,
137 'is_study_programme' => $is_study_programme,
138 'is_root_node' => $is_root_node
139 );
140
141 // TODO: find way to remove a-tag around the content, to create valid html
142 $tpl = $this->getNodeTemplateInstance();
143
144 $tpl->setCurrentBlock('node-content-block');
145 $tpl->setVariable('NODE_TITLE_CLASSES', implode(' ', $this->getNodeTitleClasses($node_config)));
146 $tpl->setVariable('NODE_TITLE', $node->getTitle());
147
148 if($is_study_programme) {
149 $tpl->setVariable('NODE_POINT_CLASSES', $this->class_configuration['node']['node_point']);
150 $tpl->setVariable('NODE_POINTS', $this->formatPointValue($node->getPoints()));
151 }
152
153 $tpl->parseCurrentBlock('node-content-block');
154
155 // add the tree buttons
156 if($this->checkAccess('write', $node->getRefId())) {
157 if($is_study_programme) {
158 $this->parseStudyProgrammeNodeButtons($node, $node_config, $tpl);
159 } else {
160 $this->parseLeafNodeButtons($node, $node_config, $tpl);
161 }
162 }
163
164 return $tpl->get();
165 }
$_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, $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 336 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

336 {
337 global $ilCtrl;
338
339 if ($ilCtrl->getCmd() == "performPaste") {
340 $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "target_node", $node->getRefId());
341 }
342
343 $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "ref_id", $node->getRefId());
344
345 return '#';
346 }

References $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 317 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

317 {
318 global $ilias;
319
320 $obj_id = ilObject::_lookupObjId($a_node->getRefId());
321 if ($ilias->getSetting('custom_icons')) {
322 //TODO: implement custom icon functionality
323 }
324
325 return ilObject::_getIcon($obj_id, "tiny");
326 }
static _lookupObjId($a_id)
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.

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

400 {
401 if(!is_null($a_node)) {
402 return $a_node->getRefId();
403 }
404 return null;
405 }

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

243 {
244 return new ilTemplate("tpl.tree_node_content.html", true, true, "Modules/StudyProgramme");
245 }
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 174 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

174 {
175 $node_title_classes = array($this->class_configuration['node']['node_title']);
176 if($node_config['is_study_programme']){
177 if ($node_config['is_current_node']) {
178 array_push($node_title_classes, $this->class_configuration['node']['node_current']);
179 }
180 } else {
181 array_push($node_title_classes, $this->class_configuration['lp_object']);
182 }
183
184 return $node_title_classes;
185 }

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

301 {
302 $node = ilObjStudyProgramme::getInstanceByRefId($this->tree_root_id);
303 if($node->getRoot() != NULL) {
304 return $node->getRoot();
305 }
306 return $node;
307 }
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 388 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

388 {
389 return true;
390 }

◆ listItemStart()

ilObjStudyProgrammeTreeExplorerGUI::listItemStart (   $tpl,
  $a_node 
)

List item start.

Parameters

return

Reimplemented from ilExplorerBaseGUI.

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

414 {
415 $tpl->setCurrentBlock("list_item_start");
416
417 if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node) || ($a_node instanceof ilStudyProgramme && $a_node->getParent() === null))
418 {
419 $tpl->touchBlock("li_closed");
420 }
421 $tpl->setVariable("DOM_NODE_ID",
422 $this->getDomNodeIdForNodeId($this->getNodeId($a_node)));
423 $tpl->parseCurrentBlock();
424 $tpl->touchBlock("tag");
425 }
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 465 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

465 {
466 $id = $this->getNodeIdForDomNodeId($node_id);
467 if (!in_array($id, $this->open_nodes))
468 {
469 $this->open_nodes[] = $id;
470 }
471 $this->store->set("on_".$this->id, serialize($this->open_nodes));
472 }
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 225 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

225 {
226 $tpl->setCurrentBlock('enable-tree-buttons');
227 $tpl->touchBlock('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('ilObjStudyProgrammeTreeGUI', 'delete', array('ref_id'=>$node->getRefId(), 'item_ref_id'=>$node_config['current_ref_id']), ilGlyphGUI::get(ilGlyphGUI::REMOVE));
232 $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
233 }
234
235 $tpl->parseCurrentBlock('enable-tree-buttons');
236 }
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 195 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

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

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: