3 declare(strict_types=1);
    54             'node_title' => 
'title',
    55             'node_point' => 
'points',
    56             'node_current' => 
'ilHighlighted current_node',
    57             'node_buttons' => 
'tree_button'    59         'lp_object' => 
'lp-object',
    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();
    84         $this->js_conf = array();
    86         $this->
lng->loadLanguageModule(
"prg");
   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());
   108         $is_current_node = ($a_node->getRefId() == $current_ref_id);
   110         $is_root_node = ($is_study_programme && $a_node->getRoot() == null);
   113         $is_delete_enabled = ($is_study_programme && ($is_current_node || $is_root_node)) ? false : $this->
checkAccess(
"delete", $current_ref_id);
   115         $is_creation_enabled = ($this->
checkAccess(
"create", $current_ref_id));
   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
   130         if ($this->
checkAccess(
'write', $a_node->getRefId())) {
   131             if ($is_study_programme) {
   142         if ($is_study_programme) {
   143             $tpl->
setVariable(
'NODE_POINT_CLASSES', $this->class_configuration[
'node'][
'node_point']);
   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'];
   163             $node_title_classes[] = $this->class_configuration[
'lp_object'];
   166         return $node_title_classes;
   186             'ilObjStudyProgrammeSettingsGUI',
   188             array(
'ref_id' => $node->
getRefId(), 
'currentNode' => $node_config[
'is_current_node']),
   191         $tpl->
setVariable(
'NODE_INFO_BUTTON', $info_button);
   194         if ($node_config[
'is_creation_enabled']) {
   196                 'ilObjStudyProgrammeTreeGUI',
   198                 array(
'ref_id' => $node->
getRefId()),
   201             $tpl->
setVariable(
'NODE_CREATE_BUTTON', $create_button);
   205         if ($node_config[
'is_delete_enabled']) {
   207                 'ilObjStudyProgrammeTreeGUI',
   209                 array(
'ref_id' => $node->
getRefId(), 
'item_ref_id' => $node_config[
'current_ref_id']),
   212             $tpl->
setVariable(
'NODE_DELETE_BUTTON', $delete_button);
   230         if ($node_config[
'is_delete_enabled']) {
   232                 'ilObjStudyProgrammeTreeGUI',
   234                 array(
'ref_id' => $node->
getRefId(), 
'item_ref_id' => $node_config[
'current_ref_id']),
   237             $tpl->
setVariable(
'NODE_DELETE_BUTTON', $delete_button);
   248         return new ilTemplate(
"tpl.tree_node_content.html", 
true, 
true, 
"Modules/StudyProgramme");
   256         return '(' . $points . 
" " . $this->
lng->txt(
'prg_points') . 
')';
   263         string $target_class,
   269         foreach ($params as $param_name => $param_value) {
   270             $this->
ctrl->setParameterByClass($target_class, $param_name, $param_value);
   276         $classes = array($this->class_configuration[
'node'][
'node_buttons']);
   277         $classes[] = 
'cmd_' . $cmd;
   279         $tpl->
setVariable(
'LINK_HREF', $this->
ctrl->getLinkTargetByClass($target_class, $cmd, 
'', 
true, 
false));
   304         $ilias = $DIC[
'ilias'];
   307         if ($ilias->getSetting(
'custom_icons')) {
   317         $ilCtrl = $DIC[
'ilCtrl'];
   319         if ($ilCtrl->getCmd() === 
"performPaste") {
   320             $ilCtrl->setParameterByClass(
"ilObjStudyProgrammeGUI", 
"target_node", $node->getRefId());
   323         $ilCtrl->setParameterByClass(
"ilObjStudyProgrammeGUI", 
"ref_id", $node->getRefId());
   332         $children_with_permission = array();
   338             if (is_array($children)) {
   339                 foreach ($children as $node) {
   340                     if ($this->
checkAccess(
'visible', $node->getRefId())) {
   341                         $children_with_permission[] = $node;
   347         return $children_with_permission;
   352         if (!is_null($a_node)) {
   353             return $a_node->getRefId();
   384         $this->tpl->addJavascript($this->js_study_programme_path);
   385         $this->tpl->addCss($this->css_study_programme_path);
   387         $this->tpl->addOnLoadCode(
   388             '$("#' . $this->
getContainerId() . 
'").study_programme_tree(' . json_encode(
   394         return parent::getHTML();
   406         if (in_array($node_id, $this->open_nodes)) {
   407             $k = array_search($node_id, $this->open_nodes);
   408             unset($this->open_nodes[$k]);
   410         $this->store->set(
"on_" . $this->
id, serialize($this->open_nodes));
   422         if (!in_array(
$id, $this->open_nodes)) {
   423             $this->open_nodes[] = 
$id;
   425         $this->store->set(
"on_" . $this->
id, serialize($this->open_nodes));
   434         return $this->
access->checkAccess($permission, 
'', $ref_id);
   443             throw new ilException(
"You have no permission for " . $permission . 
" Object with ref_id " . $ref_id . 
"!");
   452         $this->js_conf[
$key] = $value;
   460         return $this->js_conf[
$key];
 
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
 
getRootNode()
Return root node of tree. 
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
getParent()
Get the parent ilObjStudyProgramme of this object. 
 
static get(string $a_glyph, string $a_text="")
 
touchBlock(string $block)
overwrites ITX::touchBlock. 
 
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
 
getNodeButtonActionLink(string $target_class, string $cmd, array $params, string $content, bool $async=true)
Generate link-element. 
 
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string. 
 
static getInstanceByRefId($ref_id)
 
setVariable(string $variable, $value='')
Sets the given variable to the given value. 
 
addJsConf(string $key, string $value)
Adds configuration to the study-programme-tree jquery plugin. 
 
listItemStart(ilTemplate $tpl, $a_node)
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
 
parseLeafNodeButtons(ilObject $node, array $node_config, ilTemplate $tpl)
Generates the buttons for a study programme leaf. 
 
checkAccess(string $permission, int $ref_id)
Checks permission of current tree or certain child of it. 
 
static _lookupObjId(int $ref_id)
 
ilGlobalTemplateInterface $tpl
 
setEnableDnd(bool $enable_dnd)
 
string $css_study_programme_path
 
touchBlock(string $block)
 
getNodeTemplateInstance()
Factory method for a new instance of a node template. 
 
setVariable($variable, $value='')
Sets a variable value. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getHTML()
Returns the output of the complete tree There are added some additional javascripts before output the...
 
getNodeIdForDomNodeId(string $a_dom_node_id)
Get node id for dom node id. 
 
openCertainNode($node_id)
Open certain node in the tree session The open nodes of a tree are stored in a session. 
 
parseStudyProgrammeNodeButtons(ilObjStudyProgramme $node, array $node_config, ilTemplate $tpl)
Generates the buttons for a study-programme node. 
 
closeCertainNode($node_id)
Closes certain node in the tree session The open nodes of a tree are stored in a session. 
 
array $class_configuration
default classes of the tree [key=>class_name] 
 
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block. 
 
getChildsOfNode($a_parent_node_id)
 
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
 
checkAccessOrFail(string $permission, int $ref_id)
Checks permission of a object and throws an exception if they are not granted. 
 
getNodeTitleClasses(array $node_config)
Returns array with all css classes of the title node element. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(int $tree_root_id, string $modal_id, string $expl_id, $parent_obj, string $parent_cmd)
 
formatPointValue(int $points)
Returns formatted point value. 
 
getDomNodeIdForNodeId($a_node_id)
Get DOM node id for node id. 
 
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block. 
 
nodeHasVisibleChilds($a_node)
Node has children Please note that this standard method may not be optimal depending on what a derive...
 
getNodeContent($a_node)
Return node element. 
 
array string $js_study_programme_path
 
getJsConf(string $key)
Returns setting of the study-programme-tree.