ILIAS  release_8 Revision v8.23
ilPublicSectionExplorerGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPublicSectionExplorerGUI:
+ Collaboration diagram for ilPublicSectionExplorerGUI:

Public Member Functions

 __construct (object $a_parent_obj, string $a_parent_cmd, ilObjLearningModule $a_lm, string $requested_transl="")
 
 getNodeContent ($a_node)
 
 getNodeIcon ($a_node)
 
 beforeRendering ()
 
 isNodeClickable ($a_node)
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct (string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
 
 getTree ()
 
 setOrderField (string $a_val, bool $a_numeric=false)
 
 getOrderField ()
 
 setTypeWhiteList (array $a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList (array $a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds (bool $a_val)
 
 getPreloadChilds ()
 
 getSuccessorNode ( $a_node_id, string $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ($new=false)
 Get HTML. More...
 
 getChildren ($record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 setChildLimit (int $a_val)
 
 getChildLimit ()
 
 setSearchTerm (string $a_val)
 
 getSearchTerm ()
 
 setMainTemplate (ilGlobalTemplateInterface $a_main_tpl=null)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has children Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible. More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode (bool $a_val)
 
 getSkipRootNode ()
 
 setAjax (bool $a_val)
 
 getAjax ()
 
 setSecondaryHighlightedNodes (array $a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode (string $a_postvar, bool $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode (bool $a_val)
 
 getOfflineMode ()
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 
 renderNode ($a_node, ilTemplate $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, ilTemplate $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 listItemEnd (ilTemplate $tpl)
 
 listStart (ilTemplate $tpl)
 
 listEnd (ilTemplate $tpl)
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled (bool $nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd (bool $enable_dnd)
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Data Fields

string $exp_id = "public_section"
 
string $requested_transl = ""
 

Protected Member Functions

 getAllNodes (?int $from_id=null)
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 
 isNodeRequested (string $a_node_id)
 

Protected Attributes

ilObjLearningModule $lm
 
- Protected Attributes inherited from ilTreeExplorerGUI
ilLanguage $lng
 
Psr Http Message ServerRequestInterface $httpRequest
 
ilTree $tree = null
 
string $tree_label = ""
 
string $order_field = ""
 
bool $order_field_numeric = false
 
array $type_white_list = array()
 
array $type_black_list = array()
 
array $childs = array()
 
bool $preloaded = false
 
bool $preload_childs = false
 
array $root_node_data = null
 
array $all_childs = array()
 
 $root_id = 0
 
ILIAS DI UIServices $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
string $node_parameter_name
 
ilLogger $log
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
bool $skip_root_node = false
 
bool $ajax = false
 
array $custom_open_nodes = array()
 
array $selected_nodes = array()
 
string $select_postvar = ""
 
bool $offline_mode = false
 
array $sec_highl_nodes = array()
 
bool $enable_dnd = false
 
string $search_term = ""
 
array $open_nodes = []
 
ilSessionIStorage $store
 
bool $select_multi = false
 
 $parent_obj
 
int $child_limit = 0
 
string $parent_cmd = ''
 
string $requested_exp_cmd = ""
 
string $requested_exp_cont = ""
 
string $requested_searchterm = ""
 
string $requested_node_id = ""
 
string $id
 

Additional Inherited Members

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

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning tree explorer lm public area

Author
Fabian Wolf wolf@.nosp@m.leif.nosp@m.os.co.nosp@m.m

Definition at line 23 of file class.ilPublicSectionExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPublicSectionExplorerGUI::__construct ( object  $a_parent_obj,
string  $a_parent_cmd,
ilObjLearningModule  $a_lm,
string  $requested_transl = "" 
)

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

References $requested_transl, ilTreeExplorerGUI\$tree, ILIAS\GlobalScreen\Provider\__construct(), and ilLMTree\getInstance().

34  {
35  $this->lm = $a_lm;
36  $this->requested_transl = $requested_transl;
37 
38  $tree = ilLMTree::getInstance($this->lm->getId());
39 
40  parent::__construct("lm_public_section_" . $this->lm->getId(), $a_parent_obj, $a_parent_cmd, $tree);
41  }
static getInstance(int $a_tree_id)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ beforeRendering()

ilPublicSectionExplorerGUI::beforeRendering ( )

Definition at line 105 of file class.ilPublicSectionExplorerGUI.php.

References getAllNodes(), ilExplorerBaseGUI\setNodeOpen(), and ilExplorerBaseGUI\setNodeSelected().

105  : void
106  {
107  //select public pages and open public chapters
108  foreach ($this->getAllNodes() as $node) {
109  if ($node["public_access"] == "y" && $node["type"] == "pg") {
110  $this->setNodeSelected($node["obj_id"]);
111  }
112  if ($node["public_access"] == "y" && $node["type"] == "st") {
113  $this->setNodeOpen($node["obj_id"]);
114  }
115  }
116  }
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour) ...
setNodeSelected($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour) ...
+ Here is the call graph for this function:

◆ getAllNodes()

ilPublicSectionExplorerGUI::getAllNodes ( ?int  $from_id = null)
protected

Definition at line 118 of file class.ilPublicSectionExplorerGUI.php.

References ilTreeExplorerGUI\getChildsOfNode(), ilTreeExplorerGUI\getNodeId(), and ilTreeExplorerGUI\getRootNode().

Referenced by beforeRendering().

118  : array
119  {
120  $nodes = array();
121 
122  if ($from_id === null) {
123  $from_id = $this->getNodeId($this->getRootNode());
124  }
125 
126  foreach ($this->getChildsOfNode($from_id) as $node) {
127  $nodes[] = $node;
128 
129  if ($node["type"] == "st") {
130  $nodes = array_merge($nodes, $this->getAllNodes($node["obj_id"]));
131  }
132  }
133  return $nodes;
134  }
getNodeId($a_node)
Get id for node.
getRootNode()
Get root node.
getChildsOfNode($a_parent_node_id)
Get childs of node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeContent()

ilPublicSectionExplorerGUI::getNodeContent (   $a_node)
Parameters
object | array$a_node

Definition at line 46 of file class.ilPublicSectionExplorerGUI.php.

References $lang, ilLMObject\_getNodePresentationTitle(), and ilLMObject\PAGE_TITLE.

46  : string
47  {
48  $lang = ($this->requested_transl != "")
49  ? $this->requested_transl
50  : "-";
52  $a_node,
54  $this->lm->isActiveNumbering(),
55  false,
56  false,
57  $this->lm->getId(),
58  $lang
59  );
60  }
$lang
Definition: xapiexit.php:26
static _getNodePresentationTitle(array $a_node, string $a_mode=self::PAGE_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-")
+ Here is the call graph for this function:

◆ getNodeIcon()

ilPublicSectionExplorerGUI::getNodeIcon (   $a_node)
Parameters
object | array$a_node

Definition at line 65 of file class.ilPublicSectionExplorerGUI.php.

References $lm_set, ilPageObject\_isScheduledActivation(), ilPageObject\_lookupActive(), ilPageObject\_lookupContainsDeactivatedElements(), ilUtil\getImagePath(), ilTreeExplorerGUI\getNodeId(), and ilTreeExplorerGUI\getRootNode().

65  : string
66  {
67  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
68  $icon = ilUtil::getImagePath("icon_lm.svg");
69  } else {
70  $a_name = "icon_" . $a_node["type"] . ".svg";
71  if ($a_node["type"] == "pg") {
72  $lm_set = new ilSetting("lm");
73  $active = ilLMPage::_lookupActive(
74  $a_node["child"],
75  $this->lm->getType(),
76  $lm_set->get("time_scheduled_page_activation")
77  );
78 
79  // is page scheduled?
80  $img_sc = ($lm_set->get("time_scheduled_page_activation") &&
81  ilLMPage::_isScheduledActivation($a_node["child"], $this->lm->getType()))
82  ? "_sc"
83  : "";
84 
85  $a_name = "icon_pg" . $img_sc . ".svg";
86 
87  if (!$active) {
88  $a_name = "icon_pg_d" . $img_sc . ".svg";
89  } else {
91  $a_node["child"],
92  $this->lm->getType()
93  );
94  if ($contains_dis) {
95  $a_name = "icon_pg_del" . $img_sc . ".svg";
96  }
97  }
98  }
99  $icon = ilUtil::getImagePath($a_name);
100  }
101 
102  return $icon;
103  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _isScheduledActivation(int $a_id, string $a_parent_type, string $a_lang="-")
Check whether page is activated by time schedule.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupContainsDeactivatedElements(int $a_id, string $a_parent_type, string $a_lang="-")
lookup whether page contains deactivated elements
getNodeId($a_node)
Get id for node.
getRootNode()
Get root node.
$lm_set
+ Here is the call graph for this function:

◆ isNodeClickable()

ilPublicSectionExplorerGUI::isNodeClickable (   $a_node)
Parameters
object | array$a_node
Returns
bool

Definition at line 140 of file class.ilPublicSectionExplorerGUI.php.

140  : bool
141  {
142  if ($a_node["type"] == "pg") {
143  return true;
144  }
145  return false;
146  }

Field Documentation

◆ $exp_id

string ilPublicSectionExplorerGUI::$exp_id = "public_section"

Definition at line 26 of file class.ilPublicSectionExplorerGUI.php.

◆ $lm

ilObjLearningModule ilPublicSectionExplorerGUI::$lm
protected

Definition at line 25 of file class.ilPublicSectionExplorerGUI.php.

◆ $requested_transl

string ilPublicSectionExplorerGUI::$requested_transl = ""

Definition at line 27 of file class.ilPublicSectionExplorerGUI.php.

Referenced by __construct().


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