ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExplorer Class Reference

Class ilExplorer class for explorer view in admin frame. More...

+ Inheritance diagram for ilExplorer:
+ Collaboration diagram for ilExplorer:

Public Member Functions

 __construct ($a_target)
 Constructor @access public. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAsynchExpanding ($a_val)
 Set asynch expanding. More...
 
 getAsynchExpanding ()
 Get asynch expanding. More...
 
 initItemCounter ($a_number)
 Init item counter. More...
 
 setTitle ($a_val)
 Set title. More...
 
 setTitleLength ($a_length)
 Set max title length. More...
 
 getTitleLength ()
 Get max title length. More...
 
 getTitle ()
 Get title. More...
 
 setRoot ($a_root_id)
 Set root node. More...
 
 getRoot ()
 get root id More...
 
 setOrderColumn ($a_column)
 set the order column @access public More...
 
 setOrderDirection ($a_direction)
 set the order direction @access public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string @access public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string @access public More...
 
 setExpandTarget ($a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater ($a_up_frame, $a_up_script, $a_params="")
 Set Explorer Updater. More...
 
 highlightNode ($a_id)
 set highlighted node More...
 
 checkPermissions ($a_check)
 check permissions via rbac More...
 
 setSessionExpandVariable ($a_var_name="expand")
 set name of expand session variable More...
 
 outputIcons ($a_icons)
 output icons More...
 
 setClickable ($a_type, $a_clickable)
 (de-)activates links for a certain object type More...
 
 isVisible ($a_ref_id, $a_type)
 
 setTreeLead ($a_val)
 Set tree leading content. More...
 
 getTreeLead ()
 Get tree leading content. More...
 
 isClickable ($a_type, $a_ref_id=0)
 check if links for certain object type are activated More...
 
 setPostSort ($a_sort)
 process post sorting More...
 
 setFilterMode ($a_mode=IL_FM_NEGATIVE)
 set filter mode More...
 
 getFilterMode ()
 get filter mode More...
 
 setUseStandardFrame ($a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 Get use standard explorer frame. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 setOutput ($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method @access public. More...
 
 modifyChilds ($a_parent_id, $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 ()
 Get maximum tree depth. More...
 
 getOutput ()
 Creates output recursive method @access public. More...
 
 handleListEndTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list start tags ( More...
 
 formatHeader ($tpl, $a_obj_id, $a_option)
 Creates output for header (is empty here but can be overwritten in derived classes) More...
 
 formatObject ($tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method @access private. More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path (may be overwritten by derived classes) More...
 
 getImageAlt ($a_default_text, $a_type="", $a_obj_id="")
 get image alt text More...
 
 getNodeStyleClass ($a_id, $a_type)
 get style class for node More...
 
 buildLinkTarget ($a_node_id, $a_type)
 get link target (may be overwritten by derived classes) More...
 
 buildOnClick ($a_node_id, $a_type, $a_title)
 get onclick event handling (may be overwritten by derived classes) More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, may be overwritten by derived classes More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 standard implementation for description, may be overwritten by derived classes More...
 
 buildSelect ($a_node_id, $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get frame target (may be overwritten by derived classes) More...
 
 createTarget ($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter @access private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view @access private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING @access private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id @access private More...
 
 addFilter ($a_item)
 adds item to the filter @access public More...
 
 delFilter ($a_item)
 removes item from the filter @access public More...
 
 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,...) @access private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter @access public More...
 
 checkFilter ($a_item)
 check if item is in filter @access private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array @access private More...
 

Data Fields

 $id
 
 $output
 
 $format_options
 
 $tree
 
 $target
 
 $target_get
 
 $params_get
 
 $expanded
 
 $order_column
 
 $order_direction = "asc"
 
 $expand_target
 
 $rbac_check
 
 $output_icons
 
 $expand_variable
 
 $is_clickable
 
 $post_sort
 
 $filtered = false
 
 $filter_mode
 
 $expand_all = false
 
 $root_id = null
 
 $use_standard_frame = false
 

Protected Attributes

 $obj_definition
 
 $error
 
 $rbacsystem
 
 $tpl
 
 $lng
 

Detailed Description

Class ilExplorer class for explorer view in admin frame.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 16 of file class.ilExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilExplorer::__construct (   $a_target)

Constructor @access public.

Parameters
stringscriptname

Reimplemented in ilAsyncContainerSelectionExplorer, ilContainerSelectionExplorer, and ilSearchRootSelector.

Definition at line 186 of file class.ilExplorer.php.

187 {
188 global $DIC;
189
190 $this->obj_definition = $DIC["objDefinition"];
191 $this->error = $DIC["ilErr"];
192 $this->rbacsystem = $DIC->rbac()->system();
193 $this->tpl = $DIC["tpl"];
194 $this->lng = $DIC->language();
195 $objDefinition = $DIC["objDefinition"];
196 $ilErr = $DIC["ilErr"];
197
198 if (!isset($a_target) or !is_string($a_target)) {
199 $ilErr->raiseError(get_class($this) . "::Constructor(): No target given!", $ilErr->WARNING);
200 }
201
202 // autofilter object types in devmode
203 $devtypes = $objDefinition->getDevModeAll();
204
205 if (count($devtypes) > 0) {
206 // activate filter if objects found in devmode
207 $this->setFiltered(true);
208
209 foreach ($devtypes as $type) {
210 $this->addFilter($type);
211 }
212 }
213
214 $this->ilias = $DIC["ilias"];
215 $this->output = array();
216 $this->expanded = array();
217 $this->target = $a_target;
218 $this->target_get = 'ref_id';
219 $this->frame_target = "content";
220 $this->order_column = "title";
221 $this->tree = new ilTree(ROOT_FOLDER_ID);
222 $this->tree->initLangCode();
223 $this->expand_target = $_SERVER["PATH_INFO"];
224 $this->rbac_check = true;
225 $this->output_icons = true;
226 $this->expand_variable = "expand";
227 $this->setTitleLength(50);
228 $this->post_sort = true;
230 $this->highlighted = "";
231 $this->show_minus = true;
232 $this->counter = 0;
233 $this->asnch_expanding = false;
234 }
const IL_FM_NEGATIVE
error($a_errmsg)
set error message @access public
addFilter($a_item)
adds item to the filter @access public
setTitleLength($a_length)
Set max title length.
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
setFiltered($a_bool)
active/deactivate the filter @access public
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
redirection script todo: (a better solution should control the processing via a xml file)
$type
$ilErr
Definition: raiseError.php:18
global $DIC
Definition: saml.php:7
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_SERVER, $DIC, $ilErr, $type, addFilter(), error(), IL_FM_NEGATIVE, setFiltered(), setFilterMode(), and setTitleLength().

+ Here is the call graph for this function:

Member Function Documentation

◆ addFilter()

ilExplorer::addFilter (   $a_item)

adds item to the filter @access public

Parameters
stringobject type to add
Returns
boolean

Definition at line 1281 of file class.ilExplorer.php.

1282 {
1283 $ispresent = 0;
1284
1285 if (is_array($this->filter)) {
1286 //run through filter
1287 foreach ($this->filter as $item) {
1288 if ($item == $a_item) {
1289 $is_present = 1;
1290
1291 return false;
1292 }
1293 }
1294 } else {
1295 $this->filter = array();
1296 }
1297 if ($is_present == 0) {
1298 $this->filter[] = $a_item;
1299 }
1300
1301 return true;
1302 }

Referenced by ilContainerSelectionExplorer\__construct(), ilSearchRootSelector\__construct(), __construct(), ilECSNodeMappingLocalExplorer\__construct(), ilSolutionExplorer\__construct(), ilSurveySkillExplorer\__construct(), ilRepositoryExplorer\__construct(), ilRoleDesktopItemSelector\__construct(), ilLMMenuObjectSelector\__construct(), ilPasteIntoMultipleItemsExplorer\__construct(), and ilWorkspaceExplorer\__construct().

+ Here is the caller graph for this function:

◆ buildDescription()

ilExplorer::buildDescription (   $a_desc,
  $a_id,
  $a_type 
)

standard implementation for description, may be overwritten by derived classes

Reimplemented in ilWorkspaceFolderExplorer.

Definition at line 1130 of file class.ilExplorer.php.

1131 {
1132 return "";
1133 }

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ buildFrameTarget()

ilExplorer::buildFrameTarget (   $a_type,
  $a_child = 0,
  $a_obj_id = 0 
)

get frame target (may be overwritten by derived classes)

Reimplemented in ilLMMenuObjectSelector, ilSurveySkillExplorer, ilSolutionExplorer, ilWorkspaceFolderExplorer, ilRoleDesktopItemSelector, ilRepositoryExplorer, and ilSearchRootSelector.

Definition at line 1147 of file class.ilExplorer.php.

1148 {
1149 return $this->frame_target;
1150 }

Referenced by formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), ilECSNodeMappingLocalExplorer\formatObject(), and ilSCORMExplorer\insertObject().

+ Here is the caller graph for this function:

◆ buildLinkTarget()

ilExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

get link target (may be overwritten by derived classes)

Reimplemented in ilLMMenuObjectSelector, ilGlossarySelectorGUI, ilAsyncContainerSelectionExplorer, ilSurveySkillExplorer, ilSolutionExplorer, ilWorkspaceFolderExplorer, ilRoleDesktopItemSelector, ilWorkspaceExplorer, ilRepositoryExplorer, and ilSearchRootSelector.

Definition at line 1103 of file class.ilExplorer.php.

1104 {
1105 $target = (strpos($this->target, "?") === false)
1106 ? $this->target . "?"
1107 : $this->target . "&";
1108 return $target . $this->target_get . "=" . $a_node_id . $this->params_get;
1109 }

References $params_get, and $target.

Referenced by formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ buildOnClick()

ilExplorer::buildOnClick (   $a_node_id,
  $a_type,
  $a_title 
)

get onclick event handling (may be overwritten by derived classes)

Reimplemented in ilAsyncContainerSelectionExplorer.

Definition at line 1114 of file class.ilExplorer.php.

1115 {
1116 return "";
1117 }

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ buildSelect()

ilExplorer::buildSelect (   $a_node_id,
  $a_type 
)

standard implementation for adding an option select box between image and title

Definition at line 1138 of file class.ilExplorer.php.

1139 {
1140 return "";
1141 }

Referenced by formatObject().

+ Here is the caller graph for this function:

◆ buildTitle()

ilExplorer::buildTitle (   $a_title,
  $a_id,
  $a_type 
)

standard implementation for title, may be overwritten by derived classes

Reimplemented in ilSurveySkillExplorer, ilECSNodeMappingCmsExplorer, and ilECSNodeMappingLocalExplorer.

Definition at line 1122 of file class.ilExplorer.php.

1123 {
1124 return $a_title;
1125 }

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), and formatObject().

+ Here is the caller graph for this function:

◆ checkFilter()

ilExplorer::checkFilter (   $a_item)

check if item is in filter @access private

Parameters
string
Returns
integer

Definition at line 1391 of file class.ilExplorer.php.

1392 {
1393 if (is_array($this->filter)) {
1394 if (in_array($a_item, $this->filter)) {
1395 $ret = true;
1396 } else {
1397 $ret = false;
1398 }
1399 } else {
1400 $ret = false;
1401 }
1402
1403 if ($this->getFilterMode() == IL_FM_NEGATIVE) {
1404 return $ret;
1405 } else {
1406 return !$ret;
1407 }
1408 }
getFilterMode()
get filter mode
$ret
Definition: parser.php:6

References $ret, getFilterMode(), and IL_FM_NEGATIVE.

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermissions()

ilExplorer::checkPermissions (   $a_check)

check permissions via rbac

Parameters
boolean$a_checkcheck true/false

Definition at line 452 of file class.ilExplorer.php.

453 {
454 $this->rbac_check = $a_check;
455 }

Referenced by ilContainerSelectionExplorer\__construct(), ilSurveySkillExplorer\__construct(), and ilSCORMExplorer\__construct().

+ Here is the caller graph for this function:

◆ createLines()

ilExplorer::createLines (   $a_depth)

Creates lines for explorer view @access private.

Parameters
integer

Definition at line 1208 of file class.ilExplorer.php.

1209 {
1210 for ($i = 0; $i < count($this->format_options); ++$i) {
1211 if ($this->format_options[$i]["depth"] == $a_depth + 1
1212 and !$this->format_options[$i]["container"]
1213 and $this->format_options[$i]["depth"] != 1) {
1214 $this->format_options[$i]["tab"]["$a_depth"] = "quer";
1215 }
1216
1217 if ($this->format_options[$i]["depth"] == $a_depth + 2) {
1218 if ($this->is_in_array($i + 1, $this->format_options[$i]["depth"])) {
1219 $this->format_options[$i]["tab"]["$a_depth"] = "winkel";
1220 } else {
1221 $this->format_options[$i]["tab"]["$a_depth"] = "ecke";
1222 }
1223 }
1224
1225 if ($this->format_options[$i]["depth"] > $a_depth + 2) {
1226 if ($this->is_in_array($i + 1, $a_depth + 2)) {
1227 $this->format_options[$i]["tab"]["$a_depth"] = "hoch";
1228 }
1229 }
1230 }
1231 }
is_in_array($a_start, $a_depth)
DESCRIPTION MISSING @access private.
$i
Definition: disco.tpl.php:19

References $i, and is_in_array().

Referenced by getOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTarget()

ilExplorer::createTarget (   $a_type,
  $a_node_id,
  $a_highlighted_subtree = false,
  $a_append_anch = true 
)

Creates Get Parameter @access private.

Parameters
string
integer
Returns
string

Reimplemented in ilSCORMExplorer.

Definition at line 1160 of file class.ilExplorer.php.

1161 {
1163
1164 if (!isset($a_type) or !is_string($a_type) or !isset($a_node_id)) {
1165 $ilErr->raiseError(get_class($this) . "::createTarget(): Missing parameter or wrong datatype! " .
1166 "type: " . $a_type . " node_id:" . $a_node_id, $ilErr->WARNING);
1167 }
1168
1169 // SET expand parameter:
1170 // positive if object is expanded
1171 // negative if object is compressed
1172 $a_node_id = $a_type == '+' ? $a_node_id : -(int) $a_node_id;
1173
1174 $sep = (is_int(strpos($this->expand_target, "?")))
1175 ? "&"
1176 : "?";
1177
1178 // in current tree flag
1179 $ict_str = ($a_highlighted_subtree || $this->highlighted == "")
1180 ? "&ict=1"
1181 : "";
1182 if ($this->getAsynchExpanding()) {
1183 $ict_str .= "&cmdMode=asynch";
1184 }
1185 if ($a_append_anch) {
1186 return $this->expand_target . $sep . $this->expand_variable . "=" . $a_node_id . $this->params_get . $ict_str . "#" . abs($a_node_id);
1187 } else {
1188 return $this->expand_target . $sep . $this->expand_variable . "=" . $a_node_id . $this->params_get . $ict_str;
1189 }
1190 }
getAsynchExpanding()
Get asynch expanding.
$a_type
Definition: workflow.php:92

References $a_type, $error, $ilErr, and getAsynchExpanding().

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delFilter()

ilExplorer::delFilter (   $a_item)

removes item from the filter @access public

Parameters
stringobject type to remove
Returns
boolean

Definition at line 1310 of file class.ilExplorer.php.

1311 {
1312 //check if a filter exists
1313 if (is_array($this->filter)) {
1314 //build copy of the existing filter without the given item
1315 $tmp = array();
1316
1317 foreach ($this->filter as $item) {
1318 if ($item != $a_item) {
1319 $tmp[] = $item;
1320 } else {
1321 $deleted = 1;
1322 }
1323 }
1324
1325 $this->filter = $tmp;
1326 } else {
1327 return false;
1328 }
1329
1330 if ($deleted == 1) {
1331 return true;
1332 } else {
1333 return false;
1334 }
1335 }

◆ forceExpandAll()

ilExplorer::forceExpandAll (   $a_mode,
  $a_show_minus = true 
)

force expandAll.

if true all nodes are expanded regardless of the values in $expanded (default: false) @access public

Parameters
boolean

Definition at line 1367 of file class.ilExplorer.php.

1368 {
1369 $this->expand_all = (bool) $a_mode;
1370 $this->show_minus = $a_show_minus;
1371 }

◆ forceExpanded()

ilExplorer::forceExpanded (   $a_obj_id)

force expansion of node

Reimplemented in ilRepositoryExplorer, and ilSurveySkillExplorer.

Definition at line 749 of file class.ilExplorer.php.

750 {
751 return false;
752 }

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ formatHeader()

ilExplorer::formatHeader (   $tpl,
  $a_obj_id,
  $a_option 
)

Creates output for header (is empty here but can be overwritten in derived classes)

@access public

Parameters
integerobj_id
integerarray options

Reimplemented in ilLMMenuObjectSelector, ilContainerSelectionExplorer, ilGlossarySelectorGUI, ilSCORMExplorer, ilWorkspaceFolderExplorer, ilRoleDesktopItemSelector, ilPasteIntoMultipleItemsExplorer, ilWorkspaceExplorer, ilRepositoryExplorer, ilSearchRootSelector, ilECSNodeMappingCmsExplorer, and ilECSNodeMappingLocalExplorer.

Definition at line 925 of file class.ilExplorer.php.

926 {
927 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ formatObject()

ilExplorer::formatObject (   $tpl,
  $a_node_id,
  $a_option,
  $a_obj_id = 0 
)

Creates output recursive method @access private.

Parameters
integer
array
Returns
string

Reimplemented in ilPasteIntoMultipleItemsExplorer, ilWorkspaceExplorer, ilECSNodeMappingCmsExplorer, and ilECSNodeMappingLocalExplorer.

Definition at line 937 of file class.ilExplorer.php.

938 {
941
942 if (!isset($a_node_id) or !is_array($a_option)) {
943 $ilErr->raiseError(get_class($this) . "::formatObject(): Missing parameter or wrong datatype! " .
944 "node_id: " . $a_node_id . " options:" . var_dump($a_option), $ilErr->WARNING);
945 }
946
947 $pic = false;
948 foreach ((array) $a_option["tab"] as $picture) {
949 if ($picture == 'plus') {
950 $tpl->setCurrentBlock("expander");
951 $tpl->setVariable("EXP_DESC", $lng->txt("collapsed"));
952 $tpl->setVariable("LINK_NAME", $a_node_id);
953 if (!$this->getAsynchExpanding()) {
954 $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"]);
955 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
956 } else {
957 $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"], false);
958 $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
959 $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
960 }
961 $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
962 $tpl->parseCurrentBlock();
963 $pic = true;
964 }
965
966 if ($picture == 'forceexp') {
967 $tpl->setCurrentBlock("expander");
968 $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
969 $target = $this->createTarget('+', $a_node_id);
970 $tpl->setVariable("LINK_NAME", $a_node_id);
971 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
972 $tpl->setVariable("IMGPATH", $this->getImage("browser/forceexp.png"));
973 $tpl->parseCurrentBlock();
974 $pic = true;
975 }
976
977 if ($picture == 'minus' && $this->show_minus) {
978 $tpl->setCurrentBlock("expander");
979 $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
980 $tpl->setVariable("LINK_NAME", $a_node_id);
981 if (!$this->getAsynchExpanding()) {
982 $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"]);
983 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
984 } else {
985 $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"], false);
986 $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
987 $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
988 }
989 $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
990 $tpl->parseCurrentBlock();
991 $pic = true;
992 }
993 }
994
995 if (!$pic) {
996 $tpl->setCurrentBlock("blank");
997 $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
998 $tpl->parseCurrentBlock();
999 }
1000
1001 if ($this->output_icons) {
1002 $tpl->setCurrentBlock("icon");
1003 $tpl->setVariable("ICON_IMAGE", $this->getImage("icon_" . $a_option["type"] . ".svg", $a_option["type"], $a_obj_id));
1004
1005 $tpl->setVariable("TARGET_ID", "iconid_" . $a_node_id);
1006 $this->iconList[] = "iconid_" . $a_node_id;
1007 $tpl->setVariable(
1008 "TXT_ALT_IMG",
1009 $this->getImageAlt($lng->txt("icon") . " " . $lng->txt($a_option["desc"]), $a_option["type"], $a_obj_id)
1010 );
1011 $tpl->parseCurrentBlock();
1012 }
1013
1014 if (strlen($sel = $this->buildSelect($a_node_id, $a_option['type']))) {
1015 $tpl->setCurrentBlock('select');
1016 $tpl->setVariable('OBJ_SEL', $sel);
1017 $tpl->parseCurrentBlock();
1018 }
1019
1020 if ($this->isClickable($a_option["type"], $a_node_id, $a_obj_id)) { // output link
1021 $tpl->setCurrentBlock("link");
1022 //$target = (strpos($this->target, "?") === false) ?
1023 // $this->target."?" : $this->target."&";
1024 //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
1025 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
1026
1027 $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
1028
1029 if ($style_class != "") {
1030 $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
1031 }
1032
1033 if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) != "") {
1034 $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
1035 }
1036
1037 //$tpl->setVariable("LINK_NAME", $a_node_id);
1038 $tpl->setVariable("TITLE", ilUtil::shortenText(
1039 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
1040 $this->textwidth,
1041 true
1042 ));
1043 $tpl->setVariable("DESC", ilUtil::shortenText(
1044 $this->buildDescription($a_option["description"], $a_node_id, $a_option["type"]),
1045 $this->textwidth,
1046 true
1047 ));
1048 $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
1049 if ($frame_target != "") {
1050 $tpl->setVariable("TARGET", " target=\"" . $frame_target . "\"");
1051 }
1052 $tpl->parseCurrentBlock();
1053 } else { // output text only
1054 $tpl->setCurrentBlock("text");
1055 $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText(
1056 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
1057 $this->textwidth,
1058 true
1059 ));
1060 $tpl->setVariable("OBJ_DESC", ilUtil::shortenText(
1061 $this->buildDescription($a_option["desc"], $a_node_id, $a_option["type"]),
1062 $this->textwidth,
1063 true
1064 ));
1065 $tpl->parseCurrentBlock();
1066 }
1067
1068 $tpl->setCurrentBlock("list_item");
1069 $tpl->parseCurrentBlock();
1070 $tpl->touchBlock("element");
1071 }
getNodeStyleClass($a_id, $a_type)
get style class for node
buildOnClick($a_node_id, $a_type, $a_title)
get onclick event handling (may be overwritten by derived classes)
buildSelect($a_node_id, $a_type)
standard implementation for adding an option select box between image and title
getImageAlt($a_default_text, $a_type="", $a_obj_id="")
get image alt text
getImage($a_name, $a_type="", $a_obj_id="")
get image path (may be overwritten by derived classes)
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
createTarget($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
Creates Get Parameter @access private.
isClickable($a_type, $a_ref_id=0)
check if links for certain object type are activated
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.

References $error, $ilErr, $lng, $target, $tpl, buildDescription(), buildFrameTarget(), buildLinkTarget(), buildOnClick(), buildSelect(), buildTitle(), createTarget(), getAsynchExpanding(), getImage(), getImageAlt(), getNodeStyleClass(), isClickable(), and ilUtil\shortenText().

Referenced by getOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAsynchExpanding()

ilExplorer::getAsynchExpanding ( )

Get asynch expanding.

Returns
boolean

Definition at line 271 of file class.ilExplorer.php.

272 {
273 return $this->asnch_expanding;
274 }

Referenced by createTarget(), and formatObject().

+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilExplorer::getChildsOfNode (   $a_parent_id)

Get childs of node.

Parameters
int$a_parent_idparent id
Returns
array childs

Definition at line 602 of file class.ilExplorer.php.

603 {
604 return $this->tree->getChilds($a_parent_id, $this->order_column);
605 }

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ getFilterMode()

ilExplorer::getFilterMode ( )

get filter mode

Returns
int filter mode IL_FM_NEGATIVE | IL_FM_NEGATIVE

Definition at line 570 of file class.ilExplorer.php.

571 {
572 return $this->filter_mode;
573 }

References $filter_mode.

Referenced by checkFilter().

+ Here is the caller graph for this function:

◆ getId()

ilExplorer::getId ( )

Get id.

Returns
string id

Definition at line 251 of file class.ilExplorer.php.

252 {
253 return $this->id;
254 }

References $id.

Referenced by getOutput(), and ilAsyncContainerSelectionExplorer\initJs().

+ Here is the caller graph for this function:

◆ getImage()

ilExplorer::getImage (   $a_name,
  $a_type = "",
  $a_obj_id = "" 
)

get image path (may be overwritten by derived classes)

Reimplemented in ilSurveySkillExplorer, and ilRepositoryExplorer.

Definition at line 1076 of file class.ilExplorer.php.

1077 {
1078 return ilUtil::getImagePath($a_name);
1079 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath().

Referenced by formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageAlt()

ilExplorer::getImageAlt (   $a_default_text,
  $a_type = "",
  $a_obj_id = "" 
)

get image alt text

Reimplemented in ilWorkspaceFolderExplorer.

Definition at line 1084 of file class.ilExplorer.php.

1085 {
1086 return $a_default_text;
1087 }

Referenced by formatObject().

+ Here is the caller graph for this function:

◆ getIndex()

ilExplorer::getIndex (   $a_data)

get index of format_options array from specific ref_id,parent_id @access private

Parameters
arrayobject data
Returns
integer index

Definition at line 1260 of file class.ilExplorer.php.

1261 {
1262 if (!is_array($this->format_options)) {
1263 return -1;
1264 }
1265
1266 foreach ($this->format_options as $key => $value) {
1267 if (($value["child"] == $a_data["parent"])) {
1268 return $key;
1269 }
1270 }
1271
1272 return -1;
1273 }
$key
Definition: croninfo.php:18

References $key.

Referenced by ilWorkspaceFolderExplorer\setOutput(), and setOutput().

+ Here is the caller graph for this function:

◆ getMaximumTreeDepth()

ilExplorer::getMaximumTreeDepth ( )

Get maximum tree depth.

Parameters

return

Definition at line 760 of file class.ilExplorer.php.

761 {
762 $this->tree->getMaximumDepth();
763 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ getNodeStyleClass()

ilExplorer::getNodeStyleClass (   $a_id,
  $a_type 
)

get style class for node

Definition at line 1092 of file class.ilExplorer.php.

1093 {
1094 if ($a_id == $this->highlighted) {
1095 return "il_HighlightedNode";
1096 }
1097 return "";
1098 }

Referenced by ilWorkspaceFolderExplorer\formatHeader(), ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ getOutput()

ilExplorer::getOutput ( )

Creates output recursive method @access public.

Returns
string

Reimplemented in ilAsyncContainerSelectionExplorer, and ilWorkspaceFolderExplorer.

Definition at line 772 of file class.ilExplorer.php.

773 {
776
777 $this->format_options[0]["tab"] = array();
778
779 $depth = $this->getMaximumTreeDepth();
780
781 for ($i = 0;$i < $depth;++$i) {
782 $this->createLines($i);
783 }
784
785 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
787 $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
788
789 //echo "hh";
790 // set global body class
791 // $tpl->setBodyClass("il_Explorer");
792
793 $tpl_tree = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
794
795 // updater
796 if (($_GET["ict"] || $_POST["collapseAll"] != "" || $_POST["expandAll"] != "") && $this->up_frame != "") {
797 $tpl_tree->setCurrentBlock("updater");
798 $tpl_tree->setVariable("UPDATE_FRAME", $this->up_frame);
799 $tpl_tree->setVariable("UPDATE_SCRIPT", $this->up_script);
800 if (is_array($this->up_params)) {
801 $up_str = $lim = "";
802 foreach ($this->up_params as $p) {
803 $up_str .= $lim . "'" . $p . "'";
804 $lim = ",";
805 }
806 $tpl_tree->setVariable("UPDATE_PARAMS", $up_str);
807 }
808 $tpl_tree->parseCurrentBlock();
809 }
810
811 $cur_depth = -1;
812 foreach ($this->format_options as $key => $options) {
813 //echo "-".$options["depth"]."-";
814 if (!$options["visible"]) {
815 continue;
816 }
817
818 // end tags
819 $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]);
820
821 // start tags
822 $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]);
823
824 $cur_depth = $options["depth"];
825
826 if ($options["visible"] and $key != 0) {
827 $this->formatObject($tpl_tree, $options["child"], $options, $options['obj_id']);
828 }
829 if ($key == 0) {
830 $this->formatHeader($tpl_tree, $options["child"], $options);
831 }
832 }
833
834 $this->handleListEndTags($tpl_tree, $cur_depth, -1);
835
836 $tpl_tree->setVariable("TREE_LEAD", "");
837 if ($this->tree_lead != "") {
838 $tpl_tree->setCurrentBlock("tree_lead");
839 $tpl_tree->setVariable("TREE_LEAD", $this->tree_lead);
840 $tpl_tree->parseCurrentBlock();
841 }
842 if ($this->getId() != "") {
843 $tpl_tree->setVariable("TREE_ID", 'id="' . $this->getId() . '_tree"');
844 }
845
846 $html = $tpl_tree->get();
847
848 if ($this->getUseStandardFrame()) {
849 $mtpl = new ilTemplate("tpl.main.html", true, true);
850 $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
851 $mtpl->setVariable("BODY_CLASS", "il_Explorer");
852 $mtpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
853 if ($this->getTitle() != "") {
854 $mtpl->setVariable("TXT_EXPLORER_HEADER", $this->getTitle());
855 }
856 if ($this->getId() != "") {
857 $mtpl->setVariable("ID", 'id="' . $this->getId() . '"');
858 }
859 $mtpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
860 $mtpl->setCurrentBlock("content");
861 $mtpl->setVariable("EXPLORER", $html);
862 $mtpl->setVariable("EXP_REFRESH", $lng->txt("refresh"));
863 $mtpl->parseCurrentBlock();
864 $html = $mtpl->get();
865 }
866
867 return $html;
868 }
$_GET["client_id"]
$_POST["username"]
handleListEndTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list end tags ( and )
handleListStartTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list start tags (
getUseStandardFrame()
Get use standard explorer frame.
getTitle()
Get title.
createLines($a_depth)
Creates lines for explorer view @access private.
formatObject($tpl, $a_node_id, $a_option, $a_obj_id=0)
Creates output recursive method @access private.
formatHeader($tpl, $a_obj_id, $a_option)
Creates output for header (is empty here but can be overwritten in derived classes)
getMaximumTreeDepth()
Get maximum tree depth.
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static initConnection(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
$html
Definition: example_001.php:87

References $_GET, $_POST, $html, $i, $key, $lng, PHPMailer\PHPMailer\$options, $tpl, createLines(), formatHeader(), formatObject(), getId(), ilUtil\getImagePath(), getMaximumTreeDepth(), ilUtil\getStyleSheetLocation(), getTitle(), getUseStandardFrame(), handleListEndTags(), handleListStartTags(), and ilYuiUtil\initConnection().

+ Here is the call graph for this function:

◆ getRoot()

ilExplorer::getRoot ( )

get root id

@access public

Parameters

Definition at line 347 of file class.ilExplorer.php.

348 {
349 return $this->root_id == null ?
350 $this->tree->getRootId() :
352 }

References $root_id.

Referenced by ilECSNodeMappingCmsExplorer\formatHeader(), setExpand(), and setOutput().

+ Here is the caller graph for this function:

◆ getTitle()

ilExplorer::getTitle ( )

Get title.

Returns
title

Definition at line 322 of file class.ilExplorer.php.

323 {
324 return $this->title;
325 }

References $title.

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ getTitleLength()

ilExplorer::getTitleLength ( )

Get max title length.

Returns

Definition at line 312 of file class.ilExplorer.php.

313 {
314 return $this->textwidth;
315 }

◆ getTreeLead()

ilExplorer::getTreeLead ( )

Get tree leading content.

Returns
string tree leading content

Definition at line 521 of file class.ilExplorer.php.

522 {
523 return $this->tree_lead;
524 }

◆ getUseStandardFrame()

ilExplorer::getUseStandardFrame ( )

Get use standard explorer frame.

Returns
boolean use standard explorer frame

Definition at line 591 of file class.ilExplorer.php.

592 {
594 }

References $use_standard_frame.

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ handleListEndTags()

ilExplorer::handleListEndTags ( $a_tpl_tree,
  $a_cur_depth,
  $a_item_depth 
)

handle list end tags ( and )

Definition at line 875 of file class.ilExplorer.php.

876 {
877 if ($a_item_depth < $a_cur_depth) {
878 // </li></ul> for ending lists
879 for ($i = 0; $i < ($a_cur_depth - $a_item_depth); $i++) {
880 $a_tpl_tree->touchBlock("end_list_item");
881 $a_tpl_tree->touchBlock("element");
882
883 $a_tpl_tree->touchBlock("end_list");
884 $a_tpl_tree->touchBlock("element");
885 }
886 } elseif ($a_item_depth == $a_cur_depth) {
887 // </li> for ending list items
888 $a_tpl_tree->touchBlock("end_list_item");
889 $a_tpl_tree->touchBlock("element");
890 }
891 }

References $i.

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ handleListStartTags()

ilExplorer::handleListStartTags ( $a_tpl_tree,
  $a_cur_depth,
  $a_item_depth 
)

handle list start tags (

)

Definition at line 896 of file class.ilExplorer.php.

897 {
898 // start tags
899 if ($a_item_depth > $a_cur_depth) {
900 // <ul><li> for new lists
901 if ($a_item_depth > 1) {
902 $a_tpl_tree->touchBlock("start_list");
903 } else {
904 $a_tpl_tree->touchBlock("start_list_no_indent");
905 }
906 $a_tpl_tree->touchBlock("element");
907
908 $a_tpl_tree->touchBlock("start_list_item");
909 $a_tpl_tree->touchBlock("element");
910 } else {
911 // <li> items
912 $a_tpl_tree->touchBlock("start_list_item");
913 $a_tpl_tree->touchBlock("element");
914 }
915 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ highlightNode()

ilExplorer::highlightNode (   $a_id)

set highlighted node

Definition at line 442 of file class.ilExplorer.php.

443 {
444 $this->highlighted = $a_id;
445 }

◆ initItemCounter()

ilExplorer::initItemCounter (   $a_number)

Init item counter.

@access public

Parameters
intnumber

Definition at line 283 of file class.ilExplorer.php.

284 {
285 $this->counter = $a_number;
286 }

◆ is_in_array()

ilExplorer::is_in_array (   $a_start,
  $a_depth 
)

DESCRIPTION MISSING @access private.

Parameters
integer
integer
Returns
boolean

Definition at line 1240 of file class.ilExplorer.php.

1241 {
1242 for ($i = $a_start;$i < count($this->format_options);++$i) {
1243 if ($this->format_options[$i]["depth"] < $a_depth) {
1244 break;
1245 }
1246
1247 if ($this->format_options[$i]["depth"] == $a_depth) {
1248 return true;
1249 }
1250 }
1251 return false;
1252 }

References $i.

Referenced by createLines().

+ Here is the caller graph for this function:

◆ isClickable()

ilExplorer::isClickable (   $a_type,
  $a_ref_id = 0 
)

check if links for certain object type are activated

Parameters
string$a_typeobject type
Returns
boolean true if linking is activated

Reimplemented in ilContainerSelectionExplorer, ilSurveySkillExplorer, ilLMMenuObjectSelector, ilGlossarySelectorGUI, ilSolutionExplorer, ilRoleDesktopItemSelector, and ilSearchRootSelector.

Definition at line 533 of file class.ilExplorer.php.

534 {
535 // in this standard implementation
536 // only the type determines, wether an object should be clickable or not
537 // but this method can be overwritten and make $exp->setFilterMode(IL_FM_NEGATIVE);use of the ref id
538 // (this happens e.g. in class ilRepositoryExplorerGUI)
539 if ($this->is_clickable[$a_type] == "n") {
540 return false;
541 } else {
542 return true;
543 }
544 }

References $a_type.

Referenced by formatObject().

+ Here is the caller graph for this function:

◆ isVisible()

ilExplorer::isVisible (   $a_ref_id,
  $a_type 
)

Reimplemented in ilSCORMExplorer, ilContainerSelectionExplorer, ilPasteIntoMultipleItemsExplorer, ilWorkspaceExplorer, and ilRepositoryExplorer.

Definition at line 493 of file class.ilExplorer.php.

494 {
496
497 if (!$this->rbac_check) {
498 return true;
499 }
500
501 $visible = $rbacsystem->checkAccess('visible', $a_ref_id);
502
503 return $visible;
504 }

References $rbacsystem.

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ modifyChilds()

ilExplorer::modifyChilds (   $a_parent_id,
  $a_objects 
)

Definition at line 731 of file class.ilExplorer.php.

732 {
733 return $a_objects;
734 }

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ outputIcons()

ilExplorer::outputIcons (   $a_icons)

output icons

Parameters
boolean$a_iconsoutput icons true/false

Definition at line 472 of file class.ilExplorer.php.

473 {
474 $this->output_icons = $a_icons;
475 }

Referenced by ilSCORMExplorer\__construct().

+ Here is the caller graph for this function:

◆ setAsynchExpanding()

ilExplorer::setAsynchExpanding (   $a_val)

Set asynch expanding.

Parameters
boolean

Definition at line 261 of file class.ilExplorer.php.

262 {
263 $this->asnch_expanding = $a_val;
264 }

◆ setClickable()

ilExplorer::setClickable (   $a_type,
  $a_clickable 
)

(de-)activates links for a certain object type

Parameters
string$a_typeobject type
boolean$a_clickabletrue/false

Definition at line 484 of file class.ilExplorer.php.

485 {
486 if ($a_clickable) {
487 $this->is_clickable[$a_type] = "";
488 } else {
489 $this->is_clickable[$a_type] = "n";
490 }
491 }

References $a_type.

◆ setExpand()

ilExplorer::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,...) @access private

Parameters
stringpipe-separated integer

Reimplemented in ilWorkspaceFolderExplorer.

Definition at line 1343 of file class.ilExplorer.php.

1344 {
1345 // IF ISN'T SET CREATE SESSION VARIABLE
1346 if (!is_array($_SESSION[$this->expand_variable])) {
1347 $_SESSION[$this->expand_variable] = array($this->getRoot());
1348 }
1349 // IF $_GET["expand"] is positive => expand this node
1350 if ($a_node_id > 0 && !in_array($a_node_id, $_SESSION[$this->expand_variable])) {
1351 array_push($_SESSION[$this->expand_variable], $a_node_id);
1352 }
1353 // IF $_GET["expand"] is negative => compress this node
1354 if ($a_node_id < 0) {
1355 $key = array_keys($_SESSION[$this->expand_variable], -(int) $a_node_id);
1356 unset($_SESSION[$this->expand_variable][$key[0]]);
1357 }
1358 $this->expanded = $_SESSION[$this->expand_variable];
1359 }
$_SESSION["AccountId"]
getRoot()
get root id

References $_SESSION, $expand_variable, $key, and getRoot().

+ Here is the call graph for this function:

◆ setExpandTarget()

ilExplorer::setExpandTarget (   $a_exp_target)

target script for expand icons

Parameters
string$a_exp_targetscript name of target script(may include parameters) initially set to $_SERVER["PATH_INFO"]

Definition at line 421 of file class.ilExplorer.php.

422 {
423 $this->expand_target = $a_exp_target;
424 }

◆ setFiltered()

ilExplorer::setFiltered (   $a_bool)

active/deactivate the filter @access public

Parameters
boolean
Returns
boolean

Definition at line 1379 of file class.ilExplorer.php.

1380 {
1381 $this->filtered = $a_bool;
1382 return true;
1383 }

Referenced by ilContainerSelectionExplorer\__construct(), ilSearchRootSelector\__construct(), __construct(), ilECSNodeMappingLocalExplorer\__construct(), ilSolutionExplorer\__construct(), ilRepositoryExplorer\__construct(), ilRoleDesktopItemSelector\__construct(), ilPasteIntoMultipleItemsExplorer\__construct(), and ilWorkspaceExplorer\__construct().

+ Here is the caller graph for this function:

◆ setFilterMode()

ilExplorer::setFilterMode (   $a_mode = IL_FM_NEGATIVE)

◆ setFrameTarget()

ilExplorer::setFrameTarget (   $a_target)

set target frame or not frame?

Parameters
string@access public

Definition at line 1198 of file class.ilExplorer.php.

1199 {
1200 $this->frame_target = $a_target;
1201 }

◆ setFrameUpdater()

ilExplorer::setFrameUpdater (   $a_up_frame,
  $a_up_script,
  $a_params = "" 
)

Set Explorer Updater.

Parameters
object$a_treeTree Object

Definition at line 431 of file class.ilExplorer.php.

432 {
433 $this->up_frame = $a_up_frame;
434 $this->up_script = $a_up_script;
435 $this->up_params = $a_params;
436 }

◆ setId()

ilExplorer::setId (   $a_val)

Set id.

Parameters
string$a_valid

Definition at line 241 of file class.ilExplorer.php.

242 {
243 $this->id = $a_val;
244 }

Referenced by ilPasteIntoMultipleItemsExplorer\__construct().

+ Here is the caller graph for this function:

◆ setOrderColumn()

ilExplorer::setOrderColumn (   $a_column)

set the order column @access public

Parameters
stringname of order column

Definition at line 359 of file class.ilExplorer.php.

360 {
361 $this->order_column = $a_column;
362 }

Referenced by ilECSNodeMappingCmsExplorer\__construct(), ilECSNodeMappingLocalExplorer\__construct(), ilSurveySkillExplorer\__construct(), and ilSCORMExplorer\__construct().

+ Here is the caller graph for this function:

◆ setOrderDirection()

ilExplorer::setOrderDirection (   $a_direction)

set the order direction @access public

Parameters
stringname of order column

Definition at line 369 of file class.ilExplorer.php.

370 {
371 if ($a_direction == "desc") {
372 $this->order_direction = $a_direction;
373 } else {
374 $this->order_direction = "asc";
375 }
376 }

◆ setOutput()

ilExplorer::setOutput (   $a_parent_id,
  $a_depth = 1,
  $a_obj_id = 0,
  $a_highlighted_subtree = false 
)

Creates output for explorer view in admin menue recursive method @access public.

Parameters
integerparent_node_id where to start from (default=0, 'root')
integerdepth level where to start (default=1)
Returns
string

Reimplemented in ilWorkspaceFolderExplorer, and ilSCORMExplorer.

Definition at line 616 of file class.ilExplorer.php.

617 {
619
620 if (!isset($a_parent_id)) {
621 $ilErr->raiseError(get_class($this) . "::setOutput(): No node_id given!", $ilErr->WARNING);
622 }
623
624 if ($this->showChilds($a_parent_id, $a_obj_id)) {
625 $objects = $this->getChildsOfNode($a_parent_id);
626 } else {
627 $objects = array();
628 }
629
630 $objects = $this->modifyChilds($a_parent_id, $objects);
631
632 // force expansion (of single nodes)
633 if ($this->forceExpanded($a_parent_id) && !in_array($a_parent_id, $this->expanded)) {
634 $this->expanded[] = $a_parent_id;
635 }
636
637 if (count($objects) > 0) {
638 // Maybe call a lexical sort function for the child objects
639 $tab = ++$a_depth - 2;
640 if ($this->post_sort) {
641 $objects = $this->sortNodes($objects, $a_obj_id);
642 }
643 $skip_rest = false;
644 foreach ($objects as $key => $object) {
645 // skip childs, if parent is not expanded
646 if (!$this->forceExpanded($object["child"]) && $skip_rest) {
647 continue;
648 }
649 //echo "<br>-".$object["child"]."-".$this->forceExpanded($object["child"])."-";
650 //ask for FILTER
651 if ($this->filtered == false or $this->checkFilter($object["type"]) == false) {
652 if ($this->isVisible($object['child'], $object['type'])) {
653 #echo 'CHILD getIndex() '.$object['child'].' parent: '.$this->getRoot();
654 if ($object["child"] != $this->getRoot()) {
655 $parent_index = $this->getIndex($object);
656 }
657 $this->format_options["$this->counter"]["parent"] = $object["parent"];
658 $this->format_options["$this->counter"]["child"] = $object["child"];
659 $this->format_options["$this->counter"]["title"] = $object["title"];
660 $this->format_options["$this->counter"]["type"] = $object["type"];
661 $this->format_options["$this->counter"]["obj_id"] = $object["obj_id"];
662 $this->format_options["$this->counter"]["desc"] = "obj_" . $object["type"];
663 $this->format_options["$this->counter"]["depth"] = $tab;
664 $this->format_options["$this->counter"]["container"] = false;
665 $this->format_options["$this->counter"]["visible"] = true;
666 $this->format_options["$this->counter"]["highlighted_subtree"] = $a_highlighted_subtree;
667
668 // Create prefix array
669 for ($i = 0; $i < $tab; ++$i) {
670 $this->format_options["$this->counter"]["tab"][] = 'blank';
671 }
672
673 // fix explorer (sometimes explorer disappears)
674 if ($parent_index == 0) {
675 if (!$this->expand_all and !in_array($object["parent"], $this->expanded)) {
676 $this->expanded[] = $object["parent"];
677 }
678 }
679
680 // only if parent is expanded and visible, object is visible
681 if ($object["child"] != $this->getRoot() and ((!$this->expand_all and !in_array($object["parent"], $this->expanded))
682 or !$this->format_options["$parent_index"]["visible"])) {
683 if (!$this->forceExpanded($object["child"])) {
684 // if parent is not expanded, and one child is
685 // visible we don't need more information and
686 // can skip the rest of the childs
687 if ($this->format_options["$this->counter"]["visible"]) {
688 //echo "-setSkipping";
689 $skip_rest = true;
690 }
691 $this->format_options["$this->counter"]["visible"] = false;
692 }
693 }
694
695 // if object exists parent is container
696 if ($object["child"] != $this->getRoot()) {
697 $this->format_options["$parent_index"]["container"] = true;
698
699 if ($this->expand_all or in_array($object["parent"], $this->expanded)) {
700 //echo "<br>-".$object["child"]."-".$this->forceExpanded($object["child"])."-";
701 if ($this->forceExpanded($object["parent"])) {
702 $this->format_options["$parent_index"]["tab"][($tab - 2)] = 'forceexp';
703 } else {
704 $this->format_options["$parent_index"]["tab"][($tab - 2)] = 'minus';
705 }
706 } else {
707 $this->format_options["$parent_index"]["tab"][($tab - 2)] = 'plus';
708 }
709 }
710 //echo "-"."$parent_index"."-";
711 //var_dump($this->format_options["$parent_index"]);
712 ++$this->counter;
713
714 // stop recursion if 2. level beyond expanded nodes is reached
715 if ($this->expand_all or in_array($object["parent"], $this->expanded) or ($object["parent"] == 0)
716 or $this->forceExpanded($object["child"])) {
717 $highlighted_subtree = ($a_highlighted_subtree ||
718 ($object["child"] == $this->highlighted))
719 ? true
720 : false;
721
722 // recursive
723 $this->setOutput($object["child"], $a_depth, $object['obj_id'], $highlighted_subtree);
724 }
725 } //if
726 } //if FILTER
727 } //foreach
728 } //if
729 } //function
showChilds($a_parent_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
sortNodes($a_nodes, $a_parent_obj_id)
sort nodes and put adm object to the end of sorted array @access private
checkFilter($a_item)
check if item is in filter @access private
setOutput($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
Creates output for explorer view in admin menue recursive method @access public.
getIndex($a_data)
get index of format_options array from specific ref_id,parent_id @access private
modifyChilds($a_parent_id, $a_objects)
getChildsOfNode($a_parent_id)
Get childs of node.
isVisible($a_ref_id, $a_type)
forceExpanded($a_obj_id)
force expansion of node

References $error, $i, $ilErr, $key, $tab, checkFilter(), forceExpanded(), getChildsOfNode(), getIndex(), getRoot(), isVisible(), modifyChilds(), setOutput(), showChilds(), and sortNodes().

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParamsGet()

ilExplorer::setParamsGet (   $a_params_get)

set additional params to be passed in Get-string @access public

Parameters
array

Definition at line 399 of file class.ilExplorer.php.

400 {
402
403 if (!isset($a_params_get) or !is_array($a_params_get)) {
404 $ilErr->raiseError(get_class($this) . "::setTargetGet(): No target given!", $ilErr->WARNING);
405 }
406 $str = "";
407 foreach ($a_params_get as $key => $val) {
408 $str .= "&" . $key . "=" . $val;
409 }
410
411 $this->params_get = $str;
412 }

References $error, $ilErr, and $key.

◆ setPostSort()

ilExplorer::setPostSort (   $a_sort)

process post sorting

Parameters
boolean$a_sorttrue / false

Definition at line 550 of file class.ilExplorer.php.

551 {
552 $this->post_sort = $a_sort;
553 }

Referenced by ilSurveySkillExplorer\__construct().

+ Here is the caller graph for this function:

◆ setRoot()

ilExplorer::setRoot (   $a_root_id)

Set root node.

@access public

Parameters
intref id of root node

Definition at line 334 of file class.ilExplorer.php.

335 {
336 #$this->tree = new ilTree(ROOT_FOLDER_ID,$a_root_id);
337 $this->root_id = $a_root_id;
338 }

Referenced by ilECSNodeMappingLocalExplorer\__construct().

+ Here is the caller graph for this function:

◆ setSessionExpandVariable()

ilExplorer::setSessionExpandVariable (   $a_var_name = "expand")

set name of expand session variable

Parameters
string$a_var_namevariable name

Definition at line 462 of file class.ilExplorer.php.

463 {
464 $this->expand_variable = $a_var_name;
465 }

Referenced by ilContainerSelectionExplorer\__construct(), ilSearchRootSelector\__construct(), ilSolutionExplorer\__construct(), ilSurveySkillExplorer\__construct(), ilRepositoryExplorer\__construct(), ilRoleDesktopItemSelector\__construct(), ilLMMenuObjectSelector\__construct(), ilPasteIntoMultipleItemsExplorer\__construct(), and ilWorkspaceExplorer\__construct().

+ Here is the caller graph for this function:

◆ setTargetGet()

ilExplorer::setTargetGet (   $a_target_get)

set the varname in Get-string @access public

Parameters
stringvarname containing Ids to be used in GET-string

Definition at line 383 of file class.ilExplorer.php.

384 {
386
387 if (!isset($a_target_get) or !is_string($a_target_get)) {
388 $ilErr->raiseError(get_class($this) . "::setTargetGet(): No target given!", $ilErr->WARNING);
389 }
390
391 $this->target_get = $a_target_get;
392 }

References $error, and $ilErr.

◆ setTitle()

ilExplorer::setTitle (   $a_val)

Set title.

Parameters
title

Definition at line 293 of file class.ilExplorer.php.

294 {
295 $this->title = $a_val;
296 }

Referenced by ilRepositoryExplorer\__construct().

+ Here is the caller graph for this function:

◆ setTitleLength()

ilExplorer::setTitleLength (   $a_length)

Set max title length.

Parameters
object$a_length
Returns

Definition at line 303 of file class.ilExplorer.php.

304 {
305 $this->textwidth = $a_length;
306 }

Referenced by ilContainerSelectionExplorer\__construct(), ilSearchRootSelector\__construct(), __construct(), ilECSNodeMappingCmsExplorer\__construct(), ilSurveySkillExplorer\__construct(), and ilRoleDesktopItemSelector\__construct().

+ Here is the caller graph for this function:

◆ setTreeLead()

ilExplorer::setTreeLead (   $a_val)

Set tree leading content.

Parameters
string$a_valtree leading content

Definition at line 511 of file class.ilExplorer.php.

512 {
513 $this->tree_lead = $a_val;
514 }

◆ setUseStandardFrame()

ilExplorer::setUseStandardFrame (   $a_val)

Set use standard frame.

If true, the standard explorer frame (like in the repository) is put around the tree.

Parameters
booleanuse standard explorer frame

Definition at line 581 of file class.ilExplorer.php.

582 {
583 $this->use_standard_frame = $a_val;
584 }

◆ showChilds()

ilExplorer::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.

ilRepositoryExplorerGUI)

Reimplemented in ilLMMenuObjectSelector, ilGlossarySelectorGUI, ilSolutionExplorer, ilRoleDesktopItemSelector, and ilSearchRootSelector.

Definition at line 741 of file class.ilExplorer.php.

742 {
743 return true;
744 }

Referenced by ilSCORMExplorer\createOutputArray(), and setOutput().

+ Here is the caller graph for this function:

◆ sortNodes()

ilExplorer::sortNodes (   $a_nodes,
  $a_parent_obj_id 
)

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

Parameters
arraynode list as returned by iltree::getChilds();
Returns
array sorted nodes

Reimplemented in ilWorkspaceExplorer, and ilRepositoryExplorer.

Definition at line 1416 of file class.ilExplorer.php.

1417 {
1418 foreach ($a_nodes as $key => $node) {
1419 if ($node["type"] == "adm") {
1420 $match = $key;
1421 $adm_node = $node;
1422 break;
1423 }
1424 }
1425
1426 // cut off adm node
1427 isset($match) ? array_splice($a_nodes, $match, 1) : "";
1428
1429 $a_nodes = ilUtil::sortArray($a_nodes, $this->order_column, $this->order_direction);
1430
1431 // append adm node to end of list
1432 isset($match) ? array_push($a_nodes, $adm_node) : "";
1433
1434 return $a_nodes;
1435 }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray

References $key, and ilUtil\sortArray().

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $error

ilExplorer::$error
protected

◆ $expand_all

ilExplorer::$expand_all = false

Definition at line 170 of file class.ilExplorer.php.

◆ $expand_target

ilExplorer::$expand_target

Definition at line 113 of file class.ilExplorer.php.

◆ $expand_variable

ilExplorer::$expand_variable

Definition at line 135 of file class.ilExplorer.php.

Referenced by ilWorkspaceFolderExplorer\setExpand(), and setExpand().

◆ $expanded

ilExplorer::$expanded

Definition at line 92 of file class.ilExplorer.php.

◆ $filter_mode

ilExplorer::$filter_mode

Definition at line 163 of file class.ilExplorer.php.

Referenced by getFilterMode().

◆ $filtered

ilExplorer::$filtered = false

Definition at line 156 of file class.ilExplorer.php.

◆ $format_options

ilExplorer::$format_options

Definition at line 57 of file class.ilExplorer.php.

◆ $id

ilExplorer::$id

Definition at line 43 of file class.ilExplorer.php.

Referenced by ilAsyncContainerSelectionExplorer\addOnLoadCode(), and getId().

◆ $is_clickable

ilExplorer::$is_clickable

Definition at line 142 of file class.ilExplorer.php.

◆ $lng

◆ $obj_definition

ilExplorer::$obj_definition
protected

Definition at line 21 of file class.ilExplorer.php.

◆ $order_column

ilExplorer::$order_column

Definition at line 99 of file class.ilExplorer.php.

◆ $order_direction

ilExplorer::$order_direction = "asc"

Definition at line 106 of file class.ilExplorer.php.

◆ $output

ilExplorer::$output

Definition at line 50 of file class.ilExplorer.php.

Referenced by ilSCORMExplorer\getOutput().

◆ $output_icons

ilExplorer::$output_icons

Definition at line 128 of file class.ilExplorer.php.

◆ $params_get

ilExplorer::$params_get

Definition at line 85 of file class.ilExplorer.php.

Referenced by buildLinkTarget().

◆ $post_sort

ilExplorer::$post_sort

Definition at line 149 of file class.ilExplorer.php.

◆ $rbac_check

ilExplorer::$rbac_check

Definition at line 120 of file class.ilExplorer.php.

◆ $rbacsystem

◆ $root_id

ilExplorer::$root_id = null

Definition at line 177 of file class.ilExplorer.php.

Referenced by getRoot().

◆ $target

◆ $target_get

ilExplorer::$target_get

Definition at line 78 of file class.ilExplorer.php.

◆ $tpl

◆ $tree

◆ $use_standard_frame

ilExplorer::$use_standard_frame = false

Definition at line 179 of file class.ilExplorer.php.

Referenced by getUseStandardFrame().


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