ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilRepositoryExplorer Class Reference
+ Inheritance diagram for ilRepositoryExplorer:
+ Collaboration diagram for ilRepositoryExplorer:

Public Member Functions

 setForceOpenPath (array $a_path)
 set force open path More...
 
 buildLinkTarget ($a_node_id, string $a_type)
 note: most of this stuff is used by ilCourseContentInterface too More...
 
 getImage (string $a_name, string $a_type="", $a_obj_id="")
 
 isClickable (string $type, int $ref_id=0)
 
 showChilds ($a_parent_id, int $a_obj_id=0)
 
 isVisible ($a_ref_id, string $a_type)
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 sortNodes (array $a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
- Public Member Functions inherited from ilExplorer
 setId (string $a_val)
 
 getId ()
 
 setAsynchExpanding (bool $a_val)
 
 getAsynchExpanding ()
 
 initItemCounter (int $a_number)
 
 setTitle (string $a_val)
 
 setTitleLength (int $a_length)
 
 getTitleLength ()
 
 getTitle ()
 
 setRoot ($a_root_id)
 
 getRoot ()
 
 setOrderColumn (string $a_column)
 
 setOrderDirection (string $a_direction)
 
 setTargetGet (string $a_target_get)
 
 setParamsGet (array $a_params_get)
 
 setExpandTarget (string $a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater (string $a_up_frame, string $a_up_script, string $a_params="")
 
 highlightNode (string $a_id)
 
 checkPermissions (bool $a_check)
 
 setSessionExpandVariable (string $a_var_name="expand")
 
 outputIcons (bool $a_icons)
 
 setClickable (string $a_type, bool $a_clickable)
 
 isVisible ( $a_ref_id, string $a_type)
 
 setTreeLead (string $a_val)
 
 getTreeLead ()
 
 isClickable (string $type, int $ref_id=0)
 
 setPostSort (bool $a_sort)
 
 setFilterMode (int $a_mode=IL_FM_NEGATIVE)
 
 getFilterMode ()
 
 setUseStandardFrame (bool $a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 
 getChildsOfNode ($a_parent_id)
 
 setOutput ( $a_parent_id, int $a_depth=1, int $a_obj_id=0, bool $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method. More...
 
 modifyChilds ( $a_parent_id, array $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 
 getOutput ()
 
 handleListEndTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 formatObject (ilTemplate $tpl, $a_node_id, array $a_option, $a_obj_id=0)
 
 getImage (string $a_name, string $a_type="", $a_obj_id="")
 
 getImageAlt (string $a_default_text, string $a_type="", $a_obj_id="")
 
 getNodeStyleClass ( $a_id, string $a_type)
 
 buildLinkTarget ( $a_node_id, string $a_type)
 
 buildOnClick ( $a_node_id, string $a_type, string $a_title)
 
 buildTitle (string $a_title, $a_id, string $a_type)
 
 buildDescription (string $a_desc, $a_id, string $a_type)
 
 buildSelect ($a_node_id, string $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget (string $a_type, $a_child=0, $a_obj_id=0)
 
 createTarget (string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
 
 setFrameTarget (string $a_target)
 
 createLines (int $a_depth)
 
 is_in_array (int $a_start, int $a_depth)
 
 getIndex (array $a_data)
 
 addFilter (string $a_item)
 
 delFilter (string $a_item)
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) More...
 
 forceExpandAll (bool $a_mode, bool $a_show_minus=true)
 force expandAll. More...
 
 setFiltered (bool $a_bool)
 
 checkFilter (string $a_item)
 
 sortNodes (array $a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array More...
 

Protected Attributes

ilSetting $settings
 
ilDBInterface $db
 
ilObjUser $user
 
ilAccessHandler $access
 
ilCtrl $ctrl
 
array $force_open_path
 
StandardGUIRequest $request
 
array $session_materials
 
array $item_group_items
 
array $type_grps
 
- Protected Attributes inherited from ilExplorer
ilObjectDefinition $obj_definition
 
ilErrorHandling $error
 
ilRbacSystem $rbacsystem
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
 $filter = []
 
string $highlighted = ""
 
bool $show_minus = true
 
int $counter = 0
 
bool $asnch_expanding = false
 
int $textwidth = 0
 
string $title = ""
 
string $up_frame = ""
 
string $a_up_script = ""
 
string $up_params = ""
 
string $frame_target = ""
 
string $up_script = ""
 
string $tree_lead = ""
 
array $iconList = []
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper WrapperFactory $wrapper
 

Additional Inherited Members

- Data Fields inherited from ilExplorer
string $id = ""
 
string $output = ""
 
array $format_options = []
 
ilTree $tree
 
string $target = ""
 
string $target_get = ""
 
string $params_get = ""
 
array $expanded = []
 
string $order_column = ""
 
string $order_direction = "asc"
 
string $expand_target = null
 
bool $rbac_check = false
 
bool $output_icons = false
 
string $expand_variable = ""
 
array $is_clickable = []
 
bool $post_sort = false
 
bool $filtered = false
 
bool $filter_mode
 
bool $expand_all = false
 
 $root_id = null
 
bool $use_standard_frame = false
 
- Protected Member Functions inherited from ilExplorer
 requestStr (string $key)
 

Detailed Description

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

Member Function Documentation

◆ buildLinkTarget()

ilRepositoryExplorer::buildLinkTarget (   $a_node_id,
string  $a_type 
)

note: most of this stuff is used by ilCourseContentInterface too

Reimplemented from ilExplorer.

Definition at line 102 of file class.ilRepositoryExplorer.php.

102 : string
103 {
104 $ilCtrl = $this->ctrl;
105
106 $ref_id = $this->request->getRefId();
107
108 switch ($a_type) {
109 case "cat":
110 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
111 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
112 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
113 return $link;
114
115 case "grpr":
116 case "crsr":
117 case "catr":
118 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
119 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
120 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
121 return $link;
122
123 case "grp":
124 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $a_node_id);
125 $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilobjgroupgui"], "");
126 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $ref_id);
127 return $link;
128
129 case "crs":
130 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $a_node_id);
131 $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilobjcoursegui"], "view");
132 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $ref_id);
133 return $link;
134
135 case 'rcrs':
136 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
137 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
138 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
139 return $link;
140
141 case 'prg':
142 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $a_node_id);
143 $link = $ilCtrl->getLinkTargetByClass("ilobjstudyprogrammegui", "view");
144 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $ref_id);
145 return $link;
146
147 default:
148 return ilLink::_getStaticLink($a_node_id, $a_type, true);
149 }
150 }
$ref_id
Definition: ltiauth.php:66

References $ctrl, $ref_id, and ilLink\_getStaticLink().

+ Here is the call graph for this function:

◆ forceExpanded()

ilRepositoryExplorer::forceExpanded (   $a_obj_id)

force expansion of node

Reimplemented from ilExplorer.

Definition at line 393 of file class.ilRepositoryExplorer.php.

393 : bool
394 {
395 if (in_array($a_obj_id, $this->force_open_path)) {
396 return true;
397 }
398 return false;
399 }

◆ formatHeader()

ilRepositoryExplorer::formatHeader ( ilTemplate  $tpl,
  $a_obj_id,
array  $a_option 
)

Reimplemented from ilExplorer.

Reimplemented in ilPasteIntoMultipleItemsExplorer.

Definition at line 313 of file class.ilRepositoryExplorer.php.

313 : void
314 {
317 $ilCtrl = $this->ctrl;
318
319 // custom icons
320 $path = ilObject::_getIcon((int) $a_obj_id, "tiny", "root");
321
322 $tpl->setCurrentBlock("icon");
324 $title = $nd["title"];
325 if ($title === "ILIAS") {
326 $title = $lng->txt("repository");
327 }
328
329 $tpl->setVariable("ICON_IMAGE", $path);
330 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("icon") . " " . $title);
332
333 $tpl->setCurrentBlock("link");
334 $tpl->setVariable("TITLE", $title);
335 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", "1");
337 "LINK_TARGET",
338 $ilCtrl->getLinkTargetByClass("ilrepositorygui", "")
339 );
340 $ilCtrl->setParameterByClass(
341 "ilrepositorygui",
342 "ref_id",
343 $this->request->getRefId()
344 );
345 $tpl->setVariable("TARGET", " target=\"_top\"");
347
348 $tpl->setCurrentBlock("element");
350 }
ilLanguage $lng
ilGlobalTemplateInterface $tpl
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
const ROOT_FOLDER_ID
Definition: constants.php:32
$nd
Definition: error.php:30
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$path
Definition: ltiservices.php:30

References $ctrl, ilExplorer\$lng, $nd, $path, ilExplorer\$title, ilExplorer\$tpl, ilExplorer\$tree, ilObject\_getIcon(), ilTree\getNodeData(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ROOT_FOLDER_ID, ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ILIAS\UICore\GlobalTemplate\setVariable(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getImage()

ilRepositoryExplorer::getImage ( string  $a_name,
string  $a_type = "",
  $a_obj_id = "" 
)

Reimplemented from ilExplorer.

Definition at line 152 of file class.ilRepositoryExplorer.php.

152 : string
153 {
154 if ($a_type !== "") {
155 return ilObject::_getIcon((int) $a_obj_id, "tiny", $a_type);
156 }
157
158 return parent::getImage($a_name);
159 }

References ilObject\_getIcon().

+ Here is the call graph for this function:

◆ isClickable()

ilRepositoryExplorer::isClickable ( string  $type,
int  $ref_id = 0 
)

Reimplemented from ilExplorer.

Reimplemented in ilPasteIntoMultipleItemsExplorer.

Definition at line 161 of file class.ilRepositoryExplorer.php.

161 : bool
162 {
165
168 $ref_id,
169 $obj_id
170 )) {
171 return false;
172 }
173
174 switch ($type) {
175 case 'tst':
176 if (!$rbacsystem->checkAccess("read", $ref_id)) {
177 return false;
178 }
179
180 $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
181 $res = $ilDB->query($query);
182 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
183 return (bool) $row->complete;
184 }
185 return false;
186
187 case 'svy':
188 if (!$rbacsystem->checkAccess("read", $ref_id)) {
189 return false;
190 }
191
192 $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
193 $res = $ilDB->query($query);
194 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
195 return (bool) $row->complete;
196 }
197 return false;
198
199 // media pools can only be edited
200 case "mep":
201 if ($rbacsystem->checkAccess("read", $ref_id)) {
202 return true;
203 }
204 return false;
205 case 'grpr':
206 case 'crsr':
207 case 'catr':
209 case 'prg':
210 return $rbacsystem->checkAccess("visible", $ref_id);
211
212
213
214 // all other types are only clickable, if read permission is given
215 default:
216 if ($rbacsystem->checkAccess("read", $ref_id)) {
217 // check if lm is online
218 if ($type === "lm") {
219 $lm_obj = new ilObjLearningModule($ref_id);
220 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $ref_id))) {
221 return false;
222 }
223 }
224 // check if fblm is online
225 if ($type === "htlm") {
226 $lm_obj = new ilObjFileBasedLM($ref_id);
227 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $ref_id))) {
228 return false;
229 }
230 }
231 // check if fblm is online
232 if ($type === "sahs") {
233 $lm_obj = new ilObjSAHSLearningModule($ref_id);
234 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $ref_id))) {
235 return false;
236 }
237 }
238 // check if glossary is online
239 if ($type === "glo") {
241 if ((!ilObjGlossary::_lookupOnline($obj_id)) &&
242 (!$rbacsystem->checkAccess('write', $ref_id))) {
243 return false;
244 }
245 }
246
247 return true;
248 }
249 return false;
250 }
251 }
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
static _isAccessible(int $a_ref_id)
Check if target is accessible and not deleted.
ilRbacSystem $rbacsystem
File Based Learning Module (HTML) object.
static _lookupOnline(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjSCORMLearningModule.
static _lookupObjectId(int $ref_id)
static _lookupObjId(int $ref_id)
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
$res
Definition: ltiservices.php:69

References $db, $ilDB, ilExplorer\$rbacsystem, $ref_id, $res, ilConditionHandler\_checkAllConditionsOfTarget(), ilContainerReferenceAccess\_isAccessible(), ilObject\_lookupObjectId(), ilObject\_lookupObjId(), ilObjGlossary\_lookupOnline(), ilRbacSystem\checkAccess(), and ilDBConstants\FETCHMODE_OBJECT.

+ Here is the call graph for this function:

◆ isVisible()

ilRepositoryExplorer::isVisible (   $a_ref_id,
string  $a_type 
)

Reimplemented from ilExplorer.

Reimplemented in ilPasteIntoMultipleItemsExplorer.

Definition at line 273 of file class.ilRepositoryExplorer.php.

273 : bool
274 {
275 $ilAccess = $this->access;
278
279 if (!$ilAccess->checkAccess('visible', '', $a_ref_id)) {
280 return false;
281 }
282
283 $is_course = false;
284 $container_parent_id = $tree->checkForParentType($a_ref_id, 'grp');
285 if (!$container_parent_id) {
286 $is_course = true;
287 $container_parent_id = $tree->checkForParentType($a_ref_id, 'crs');
288 }
289 if ($container_parent_id) {
290 // do not display session materials for container course/group
291 if ($container_parent_id !== $a_ref_id && $ilSetting->get("repository_tree_pres") === "all_types") {
292 // get container event items only once
293 if (!isset($this->session_materials[$container_parent_id])) {
294 $this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
295 }
296 // get item group items only once
297 if (!isset($this->item_group_items[$container_parent_id])) {
298 $this->item_group_items[$container_parent_id] = ilItemGroupItems::_getItemsOfContainer($container_parent_id);
299 }
300 if (in_array($a_ref_id, $this->session_materials[$container_parent_id])) {
301 return false;
302 }
303 if (in_array($a_ref_id, $this->item_group_items[$container_parent_id])) {
304 return false;
305 }
306 }
307 }
308
309 return true;
310 }
static _getItemsOfContainer(int $a_ref_id)
static _getItemsOfContainer(int $a_ref_id)
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
global $ilSetting
Definition: privfeed.php:31

References $access, $ilSetting, $settings, ilExplorer\$tree, ilItemGroupItems\_getItemsOfContainer(), ilEventItems\_getItemsOfContainer(), and ilTree\checkForParentType().

+ Here is the call graph for this function:

◆ setForceOpenPath()

ilRepositoryExplorer::setForceOpenPath ( array  $a_path)

set force open path

Definition at line 94 of file class.ilRepositoryExplorer.php.

94 : void
95 {
96 $this->force_open_path = $a_path;
97 }

◆ showChilds()

ilRepositoryExplorer::showChilds (   $a_parent_id,
int  $a_obj_id = 0 
)
Parameters
int | string$a_parent_id

Definition at line 256 of file class.ilRepositoryExplorer.php.

256 : bool
257 {
259
260 if ($a_parent_id == 0) {
261 return true;
262 }
263 if (!ilConditionHandler::_checkAllConditionsOfTarget((int) $a_parent_id, $a_obj_id)) {
264 return false;
265 }
266 if ($rbacsystem->checkAccess("read", (int) $a_parent_id)) {
267 return true;
268 }
269
270 return false;
271 }

References ilExplorer\$rbacsystem, ilConditionHandler\_checkAllConditionsOfTarget(), and ilRbacSystem\checkAccess().

+ Here is the call graph for this function:

◆ sortNodes()

ilRepositoryExplorer::sortNodes ( array  $a_nodes,
  $a_parent_obj_id 
)

sort nodes and put adm object to the end of sorted array

Reimplemented from ilExplorer.

Definition at line 352 of file class.ilRepositoryExplorer.php.

352 : array
353 {
354 $objDefinition = $this->obj_definition;
355
356 if ($a_parent_obj_id > 0) {
357 $parent_type = ilObject::_lookupType($a_parent_obj_id);
358 } else {
359 $parent_type = "dummy";
360 $this->type_grps["dummy"] = ["root" => "dummy"];
361 }
362
363 if (empty($this->type_grps[$parent_type])) {
364 $this->type_grps[$parent_type] = $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
365 }
366 $group = [];
367
368 foreach ($a_nodes as $node) {
369 $g = $objDefinition->getGroupOfObj($node["type"]);
370 if ($g == "") {
371 $g = $node["type"];
372 }
373 $group[$g][] = $node;
374 }
375
376 $nodes = [];
377 foreach ($this->type_grps[$parent_type] as $t => $g) {
378 if (array_key_exists($t, $group)
379 && is_array($group[$t])) {
380 // do we have to sort this group??
381 $sort = ilContainerSorting::_getInstance($a_parent_obj_id);
382 $group = $sort->sortItems($group);
383
384 foreach ($group[$t] as $k => $item) {
385 $nodes[] = $item;
386 }
387 }
388 }
389
390 return $nodes;
391 }
static _getInstance(int $a_obj_id)
ilObjectDefinition $obj_definition
static _lookupType(int $id, bool $reference=false)

References ilExplorer\$obj_definition, ilContainerSorting\_getInstance(), and ilObject\_lookupType().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilRepositoryExplorer::$access
protected

Definition at line 34 of file class.ilRepositoryExplorer.php.

Referenced by isVisible().

◆ $ctrl

ilCtrl ilRepositoryExplorer::$ctrl
protected

Definition at line 35 of file class.ilRepositoryExplorer.php.

Referenced by buildLinkTarget(), and formatHeader().

◆ $db

ilDBInterface ilRepositoryExplorer::$db
protected

Definition at line 32 of file class.ilRepositoryExplorer.php.

Referenced by isClickable().

◆ $force_open_path

array ilRepositoryExplorer::$force_open_path
protected

Definition at line 36 of file class.ilRepositoryExplorer.php.

◆ $item_group_items

array ilRepositoryExplorer::$item_group_items
protected

Definition at line 39 of file class.ilRepositoryExplorer.php.

◆ $request

StandardGUIRequest ilRepositoryExplorer::$request
protected

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

◆ $session_materials

array ilRepositoryExplorer::$session_materials
protected

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

◆ $settings

ilSetting ilRepositoryExplorer::$settings
protected

Definition at line 31 of file class.ilRepositoryExplorer.php.

Referenced by isVisible().

◆ $type_grps

array ilRepositoryExplorer::$type_grps
protected

Definition at line 40 of file class.ilRepositoryExplorer.php.

◆ $user

ilObjUser ilRepositoryExplorer::$user
protected

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


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