ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 setChildLimit ($a_val)
 Set child limit. More...
 
 getChildLimit ()
 Get child limit. More...
 
 setSearchTerm ($a_val)
 Set search term. More...
 
 getSearchTerm ()
 Get search term. More...
 
 setMainTemplate (ilTemplate $a_main_tpl=null)
 Set main template (that is responsible for adding js/css) 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...
 
 isNodeOpen ($node_id)
 Get all open nodes. 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
 $log
 
 $ctrl
 
 $tpl
 
 $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
 
 $search_term = ""
 
 $child_limit = 0
 

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 getLocalJsTreeCssPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ($a_main_tpl=null)
 Init JS. More...
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./libs/bower/bower_components/jstree/dist/jstree.js"
 
static $js_tree_path_css = "./libs/bower/bower_components/jstree/dist/themes/default/style.min.css"
 
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 87 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

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

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

References $key.

537  {
538  $this->js_conf[$key] = $value;
539  }
$key
Definition: croninfo.php:18

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

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

509  {
510  $checker = $this->access->checkAccess($permission, '', $ref_id);
511 
512  return $checker;
513  }
+ 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 524 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References checkAccess().

525  {
526  if (!$this->checkAccess($permission, $ref_id)) {
527  throw new ilException("You have no permission for " . $permission . " Object with ref_id " . $ref_id . "!");
528  }
529  }
checkAccess($permission, $ref_id)
Checks permission of current tree or certain child of it.
+ 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 475 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

476  {
477  if (in_array($node_id, $this->open_nodes)) {
478  $k = array_search($node_id, $this->open_nodes);
479  unset($this->open_nodes[$k]);
480  }
481  $this->store->set("on_" . $this->id, serialize($this->open_nodes));
482  }

◆ formatPointValue()

ilObjStudyProgrammeTreeExplorerGUI::formatPointValue (   $points)
protected

Returns formatted point value.

Parameters
$points
Returns
string

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

Referenced by getNodeContent().

267  {
268  return '(' . $points . " " . $this->lng->txt('prg_points') . ')';
269  }
+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilObjStudyProgrammeTreeExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
$a_parent_node_idilAccess

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

References $DIC, checkAccess(), and ilObjectFactoryWrapper\singleton().

377  {
378  global $DIC;
379  $ilAccess = $DIC['ilAccess'];
380 
381  $parent_obj = ilObjectFactoryWrapper::singleton()->getInstanceByRefId($a_parent_node_id);
382 
383  $children_with_permission = array();
384 
385  // its currently only possible to have children on StudyProgrammes
386  if ($parent_obj instanceof ilObjStudyProgramme) {
387  $children = ($parent_obj->hasChildren())? $parent_obj->getChildren() : $parent_obj->getLPChildren();
388 
389  if (is_array($children)) {
390  foreach ($children as $node) {
391  if ($this->checkAccess('visible', $node->getRefId())) {
392  $children_with_permission[] = $node;
393  }
394  }
395  }
396  }
397 
398  return $children_with_permission;
399  }
checkAccess($permission, $ref_id)
Checks permission of current tree or certain child of it.
global $DIC
Definition: saml.php:7
Class ilObjStudyProgramme.
+ 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

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

References ilExplorerBaseGUI\getContainerId().

459  {
460  $this->tpl->addJavascript($this->js_study_programme_path);
461  $this->tpl->addCss($this->css_study_programme_path);
462 
463  $this->tpl->addOnLoadCode('$("#' . $this->getContainerId() . '").study_programme_tree(' . json_encode($this->js_conf) . ');');
464 
465  return parent::getHTML();
466  }
getContainerId()
Get container id.
+ 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 546 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $key.

547  {
548  return $this->js_conf[$key];
549  }
$key
Definition: croninfo.php:18

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

References PHPMailer\PHPMailer\$params, $tpl, and getNodeTemplateInstance().

Referenced by parseLeafNodeButtons(), and parseStudyProgrammeNodeButtons().

283  {
284  foreach ($params as $param_name => $param_value) {
285  $this->ctrl->setParameterByClass($target_class, $param_name, $param_value);
286  }
287 
288  $tpl = $this->getNodeTemplateInstance();
289  //$tpl->free();
290  $tpl->setCurrentBlock('tree-button-block');
291 
292  $classes = array($this->class_configuration['node']['node_buttons']);
293  $classes[] = 'cmd_' . $cmd;
294 
295  $tpl->setVariable('LINK_HREF', $this->ctrl->getLinkTargetByClass($target_class, $cmd, '', true, false));
296  $tpl->setVariable('LINK_CLASSES', implode(' ', $classes));
297 
298  if ($async) {
299  $tpl->touchBlock('enable-async-link');
300  $tpl->setVariable('LINK_DATA_TARGET', '#' . $this->modal_id);
301  }
302 
303  $tpl->setVariable('LINK_CONTENT', $content);
304 
305  //$tpl->parseCurrentBlock('tree-button-block');
306 
307  return $tpl->get();
308  }
getNodeTemplateInstance()
Factory method for a new instance of a node template.
+ 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

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

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

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

◆ getNodeHref()

ilObjStudyProgrammeTreeExplorerGUI::getNodeHref (   $node)

Returns node link target.

Parameters
mixed$node
Returns
string

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

References $DIC, and $ilCtrl.

354  {
355  global $DIC;
356  $ilCtrl = $DIC['ilCtrl'];
357 
358  if ($ilCtrl->getCmd() == "performPaste") {
359  $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "target_node", $node->getRefId());
360  }
361 
362  $ilCtrl->setParameterByClass("ilObjStudyProgrammeGUI", "ref_id", $node->getRefId());
363 
364  return '#';
365  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

◆ getNodeIcon()

ilObjStudyProgrammeTreeExplorerGUI::getNodeIcon (   $a_node)

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

Parameters
array$a_node
Returns
string

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

References $DIC, and ilObject\_lookupObjId().

333  {
334  global $DIC;
335  $ilias = $DIC['ilias'];
336 
337  $obj_id = ilObject::_lookupObjId($a_node->getRefId());
338  if ($ilias->getSetting('custom_icons')) {
339  //TODO: implement custom icon functionality
340  }
341 
342  return ilObject::_getIcon($obj_id, "tiny");
343  }
global $DIC
Definition: saml.php:7
static _lookupObjId($a_id)
+ 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

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

Referenced by listItemStart().

423  {
424  if (!is_null($a_node)) {
425  return $a_node->getRefId();
426  }
427  return null;
428  }
+ 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 254 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by getNodeButtonActionLink(), and getNodeContent().

255  {
256  return new ilTemplate("tpl.tree_node_content.html", true, true, "Modules/StudyProgramme");
257  }
special template class to simplify handling of ITX/PEAR
+ 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 184 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

Referenced by getNodeContent().

185  {
186  $node_title_classes = array($this->class_configuration['node']['node_title']);
187  if ($node_config['is_study_programme']) {
188  if ($node_config['is_current_node']) {
189  array_push($node_title_classes, $this->class_configuration['node']['node_current']);
190  }
191  } else {
192  array_push($node_title_classes, $this->class_configuration['lp_object']);
193  }
194 
195  return $node_title_classes;
196  }
+ Here is the caller graph for this function:

◆ getRootNode()

ilObjStudyProgrammeTreeExplorerGUI::getRootNode ( )

Return root node of tree.

Returns
mixed

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

References ilObjStudyProgramme\getInstanceByRefId().

316  {
317  $node = ilObjStudyProgramme::getInstanceByRefId($this->tree_root_id);
318  if ($node->getRoot() != null) {
319  return $node->getRoot();
320  }
321  return $node;
322  }
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
+ Here is the call graph for this function:

◆ isNodeClickable()

ilObjStudyProgrammeTreeExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
mixed$a_nodenode object/array

ilAccessHandler $ilAccess

Returns
boolean node clickable true/false

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

410  {
411  return true;
412  }

◆ listItemStart()

ilObjStudyProgrammeTreeExplorerGUI::listItemStart (   $tpl,
  $a_node 
)

List item start.

Parameters

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

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

437  {
438  $tpl->setCurrentBlock("list_item_start");
439 
440  if ($this->getAjax() && $this->nodeHasVisibleChilds($a_node) || ($a_node instanceof ilStudyProgramme && $a_node->getParent() === null)) {
441  $tpl->touchBlock("li_closed");
442  }
443  $tpl->setVariable(
444  "DOM_NODE_ID",
445  $this->getDomNodeIdForNodeId($this->getNodeId($a_node))
446  );
447  $tpl->parseCurrentBlock();
448  $tpl->touchBlock("tag");
449  }
Class ilStudyProgramme.
getDomNodeIdForNodeId($a_node_id)
Get DOM node id for node id.
nodeHasVisibleChilds($a_node)
Node has childs?
+ 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 490 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

References $id, and ilExplorerBaseGUI\getNodeIdForDomNodeId().

491  {
492  $id = $this->getNodeIdForDomNodeId($node_id);
493  if (!in_array($id, $this->open_nodes)) {
494  $this->open_nodes[] = $id;
495  }
496  $this->store->set("on_" . $this->id, serialize($this->open_nodes));
497  }
if(!array_key_exists('StateId', $_REQUEST)) $id
getNodeIdForDomNodeId($a_dom_node_id)
Get node id for dom node id.
+ 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 236 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

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

Referenced by getNodeContent().

237  {
238  $tpl->setCurrentBlock('enable-tree-buttons');
239 
240  // only show delete button when its not the current node
241  if ($node_config['is_delete_enabled']) {
242  $delete_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'delete', array('ref_id' => $node->getRefId(), 'item_ref_id' => $node_config['current_ref_id']), ilGlyphGUI::get(ilGlyphGUI::REMOVE));
243  $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
244  }
245 
246  $tpl->parseCurrentBlock('enable-tree-buttons');
247  }
static get($a_glyph, $a_text="")
Get glyph html.
getNodeButtonActionLink($target_class, $cmd, $params, $content, $async=true)
Generate link-element.
+ 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 206 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

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

Referenced by getNodeContent().

207  {
208  $tpl->setCurrentBlock('enable-tree-buttons');
209 
210  // show info button only when it not the current node
211  $info_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeSettingsGUI', 'view', array('ref_id' => $node->getRefId(), 'currentNode' => $node_config['is_current_node']), ilGlyphGUI::get(ilGlyphGUI::INFO));
212  $tpl->setVariable('NODE_INFO_BUTTON', $info_button);
213 
214  // only show add button when create permission is set
215  if ($node_config['is_creation_enabled']) {
216  $create_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'create', array('ref_id' => $node->getRefId()), ilGlyphGUI::get(ilGlyphGUI::ADD));
217  $tpl->setVariable('NODE_CREATE_BUTTON', $create_button);
218  }
219 
220  // only show delete button when its not the current node, not the root-node and delete permissions are set
221  if ($node_config['is_delete_enabled']) {
222  $delete_button = $this->getNodeButtonActionLink('ilObjStudyProgrammeTreeGUI', 'delete', array('ref_id' => $node->getRefId(), 'item_ref_id' => $node_config['current_ref_id']), ilGlyphGUI::get(ilGlyphGUI::REMOVE));
223  $tpl->setVariable('NODE_DELETE_BUTTON', $delete_button);
224  }
225 
226  $tpl->parseCurrentBlock('enable-tree-buttons');
227  }
static get($a_glyph, $a_text="")
Get glyph html.
getNodeButtonActionLink($target_class, $cmd, $params, $content, $async=true)
Generate link-element.
+ 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 34 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 69 of file class.ilObjStudyProgrammeTreeExplorerGUI.php.

◆ $css_study_programme_path

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

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

◆ $ctrl

ilObjStudyProgrammeTreeExplorerGUI::$ctrl
protected

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

◆ $js_conf

ilObjStudyProgrammeTreeExplorerGUI::$js_conf
protected

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

◆ $js_study_programme_path

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

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

◆ $lng

ilObjStudyProgrammeTreeExplorerGUI::$lng
protected

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

Referenced by __construct(), and getNodeContent().

◆ $modal_id

ilObjStudyProgrammeTreeExplorerGUI::$modal_id
protected

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

Referenced by __construct().

◆ $node_template

ilObjStudyProgrammeTreeExplorerGUI::$node_template
protected

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

◆ $toolbar

ilObjStudyProgrammeTreeExplorerGUI::$toolbar
protected

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

◆ $tpl

◆ $tree_root_id

ilObjStudyProgrammeTreeExplorerGUI::$tree_root_id
protected

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


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