00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 define("IL_FM_POSITIVE", 1);
00025 define("IL_FM_NEGATIVE", 2);
00026
00037 class ilExplorer
00038 {
00044 var $ilias;
00045
00051 var $output;
00052
00058 var $format_options;
00059
00065 var $tree;
00066
00072 var $target;
00073
00079 var $target_get;
00080
00086 var $params_get;
00087
00093 var $expanded;
00094
00100 var $order_column;
00101
00107 var $order_direction = "asc";
00108
00114 var $expand_target;
00115
00121 var $rbac_check;
00122
00123
00129 var $output_icons;
00130
00136 var $expand_variable;
00137
00143 var $is_clickable;
00144
00150 var $post_sort;
00151
00157 var $filtered = false;
00158
00164 var $filter_mode;
00165
00171 var $expand_all = false;
00172
00178 function ilExplorer($a_target)
00179 {
00180 global $ilias, $objDefinition;
00181
00182 if (!isset($a_target) or !is_string($a_target))
00183 {
00184 $this->ilias->raiseError(get_class($this)."::Constructor(): No target given!",$this->ilias->error_obj->WARNING);
00185 }
00186
00187
00188 $devtypes = $objDefinition->getDevModeAll();
00189
00190 if (count($devtypes > 0))
00191 {
00192
00193 $this->setFiltered(true);
00194
00195 foreach ($devtypes as $type)
00196 {
00197 $this->addFilter($type);
00198 }
00199 }
00200
00201 $this->ilias =& $ilias;
00202 $this->output = array();
00203 $this->expanded = array();
00204 $this->target = $a_target;
00205 $this->target_get = 'ref_id';
00206 $this->frame_target = "content";
00207 $this->order_column = "title";
00208 $this->tree = new ilTree(ROOT_FOLDER_ID);
00209 $this->expand_target = $_SERVER["PATH_INFO"];
00210 $this->rbac_check = true;
00211 $this->output_icons = true;
00212 $this->expand_variable = "expand";
00213 $this->textwidth=50;
00214 $this->post_sort=true;
00215 $this->setFilterMode(IL_FM_NEGATIVE);
00216 $this->highlighted = "";
00217 $this->show_minus = true;
00218 }
00219
00225 function setOrderColumn($a_column)
00226 {
00227 $this->order_column = $a_column;
00228 }
00229
00235 function setOrderDirection($a_direction)
00236 {
00237 if ($a_direction == "desc")
00238 {
00239 $this->order_direction = $a_direction;
00240 }
00241 else
00242 {
00243 $this->order_direction = "asc";
00244 }
00245 }
00246
00252 function setTargetGet($a_target_get)
00253 {
00254 if (!isset($a_target_get) or !is_string($a_target_get))
00255 {
00256 $this->ilias->raiseError(get_class($this)."::setTargetGet(): No target given!",$this->ilias->error_obj->WARNING);
00257 }
00258
00259 $this->target_get = $a_target_get;
00260 }
00261
00267 function setParamsGet($a_params_get)
00268 {
00269 if (!isset($a_params_get) or !is_array($a_params_get))
00270 {
00271 $this->ilias->raiseError(get_class($this)."::setTargetGet(): No target given!",$this->ilias->error_obj->WARNING);
00272 }
00273
00274 foreach ($a_params_get as $key => $val)
00275 {
00276 $str .= "&".$key."=".$val;
00277 }
00278
00279 $this->params_get = $str;
00280 }
00281
00282
00289 function setExpandTarget($a_exp_target)
00290 {
00291 $this->expand_target = $a_exp_target;
00292 }
00293
00297 function highlightNode($a_id)
00298 {
00299 $this->highlighted = $a_id;
00300 }
00301
00307 function checkPermissions($a_check)
00308 {
00309 $this->rbac_check = $a_check;
00310 }
00311
00317 function setSessionExpandVariable($a_var_name = "expand")
00318 {
00319 $this->expand_variable = $a_var_name;
00320 }
00321
00327 function outputIcons($a_icons)
00328 {
00329 $this->output_icons = $a_icons;
00330 }
00331
00332
00339 function setClickable($a_type, $a_clickable)
00340 {
00341 if($a_clickable)
00342 {
00343 $this->is_clickable[$a_type] = "";
00344 }
00345 else
00346 {
00347 $this->is_clickable[$a_type] = "n";
00348 }
00349 }
00350
00351 function isVisible($a_ref_id,$a_type)
00352 {
00353 global $rbacsystem, $ilBench;
00354
00355 if (!$this->rbac_check)
00356 {
00357 return true;
00358 }
00359
00360 $ilBench->start("Explorer", "setOutput_isVisible");
00361 $visible = $rbacsystem->checkAccess('visible',$a_ref_id);
00362 $ilBench->stop("Explorer", "setOutput_isVisible");
00363
00364 return $visible;
00365 }
00366
00374 function isClickable($a_type, $a_ref_id = 0)
00375 {
00376
00377
00378
00379
00380 if ($this->is_clickable[$a_type] == "n")
00381 {
00382 return false;
00383 }
00384 else
00385 {
00386 return true;
00387 }
00388 }
00389
00394 function setPostSort($a_sort)
00395 {
00396 $this->post_sort = $a_sort;
00397 }
00398
00404 function setFilterMode($a_mode = IL_FM_NEGATIVE)
00405 {
00406 $this->filter_mode = $a_mode;
00407 }
00408
00414 function getFilterMode()
00415 {
00416 return $this->filter_mode;
00417 }
00418
00427 function setOutput($a_parent_id, $a_depth = 1,$a_obj_id = 0)
00428 {
00429 global $rbacadmin, $rbacsystem, $ilBench;
00430 static $counter = 0;
00431
00432 if (!isset($a_parent_id))
00433 {
00434 $this->ilias->raiseError(get_class($this)."::setOutput(): No node_id given!",$this->ilias->error_obj->WARNING);
00435 }
00436
00437 if ($this->showChilds($a_parent_id,$a_obj_id))
00438 {
00439
00440 $ilBench->start("Explorer", "setOutput_getChilds");
00441 $objects = $this->tree->getChilds($a_parent_id, $this->order_column);
00442 $ilBench->stop("Explorer", "setOutput_getChilds");
00443 }
00444 else
00445 {
00446 $objects = array();
00447 }
00448
00449 $objects = $this->modifyChilds($a_parent_id, $objects);
00450
00451
00452 if ($this->forceExpanded($a_obj_id) && !in_array($a_obj_id, $this->expanded))
00453 {
00454 $this->expanded[] = $a_obj_id;
00455 }
00456
00457 if (count($objects) > 0)
00458 {
00459
00460 $ilBench->start("Explorer", "setOutput_sortNodes");
00461 $tab = ++$a_depth - 2;
00462 if ($this->post_sort)
00463 {
00464 $objects = $this->sortNodes($objects);
00465 }
00466 $ilBench->stop("Explorer", "setOutput_sortNodes");
00467
00468 $skip_rest = false;
00469
00470 foreach ($objects as $key => $object)
00471 {
00472
00473 if (!$this->forceExpanded($object["child"]) && $skip_rest)
00474 {
00475 continue;
00476 }
00477
00478 if ($this->filtered == false or $this->checkFilter($object["type"]) == false)
00479 {
00480 if ($this->isVisible($object['child'],$object['type']))
00481 {
00482 $ilBench->start("Explorer", "setOutput_setFormatOptions");
00483 if ($object["child"] != $this->tree->getRootId())
00484 {
00485 $parent_index = $this->getIndex($object);
00486 }
00487 $this->format_options["$counter"]["parent"] = $object["parent"];
00488 $this->format_options["$counter"]["child"] = $object["child"];
00489 $this->format_options["$counter"]["title"] = $object["title"];
00490 $this->format_options["$counter"]["type"] = $object["type"];
00491 $this->format_options["$counter"]["obj_id"] = $object["obj_id"];
00492 $this->format_options["$counter"]["desc"] = "obj_".$object["type"];
00493 $this->format_options["$counter"]["depth"] = $tab;
00494 $this->format_options["$counter"]["container"] = false;
00495 $this->format_options["$counter"]["visible"] = true;
00496
00497
00498 for ($i = 0; $i < $tab; ++$i)
00499 {
00500 $this->format_options["$counter"]["tab"][] = 'blank';
00501 }
00502
00503
00504 if ($parent_index == 0)
00505 {
00506 if (!$this->expand_all and !in_array($object["parent"], $this->expanded))
00507 {
00508 $this->expanded[] = $object["parent"];
00509 }
00510 }
00511
00512
00513 if ($object["child"] != $this->tree->getRootId() and ((!$this->expand_all and !in_array($object["parent"],$this->expanded))
00514 or !$this->format_options["$parent_index"]["visible"]))
00515 {
00516 if (!$this->forceExpanded($object["child"]))
00517 {
00518
00519
00520
00521 if ($this->format_options["$counter"]["visible"])
00522 {
00523
00524 $skip_rest = true;
00525 }
00526 $this->format_options["$counter"]["visible"] = false;
00527 }
00528 }
00529
00530
00531 if ($object["child"] != $this->tree->getRootId())
00532 {
00533 $this->format_options["$parent_index"]["container"] = true;
00534
00535 if ($this->expand_all or in_array($object["parent"],$this->expanded))
00536 {
00537 $this->format_options["$parent_index"]["tab"][($tab-2)] = 'minus';
00538 }
00539 else
00540 {
00541 $this->format_options["$parent_index"]["tab"][($tab-2)] = 'plus';
00542 }
00543 }
00544
00545 ++$counter;
00546 $ilBench->stop("Explorer", "setOutput_setFormatOptions");
00547
00548
00549 if ($this->expand_all or in_array($object["parent"],$this->expanded) or ($object["parent"] == 0)
00550 or $this->forceExpanded($object["child"]))
00551 {
00552
00553 $this->setOutput($object["child"],$a_depth,$object['obj_id']);
00554 }
00555 }
00556 }
00557 }
00558 }
00559 }
00560
00561 function modifyChilds($a_parent_id, $a_objects)
00562 {
00563 return $a_objects;
00564 }
00565
00571 function showChilds($a_parent_id)
00572 {
00573 return true;
00574 }
00575
00579 function forceExpanded($a_obj_id)
00580 {
00581 return false;
00582 }
00583
00590 function getOutput()
00591 {
00592 global $ilBench, $tpl;
00593
00594 $ilBench->start("Explorer", "getOutput");
00595
00596 $this->format_options[0]["tab"] = array();
00597
00598 $depth = $this->tree->getMaximumDepth();
00599
00600 for ($i=0;$i<$depth;++$i)
00601 {
00602 $this->createLines($i);
00603 }
00604
00605 $tpl->addBlockFile("EXPLORER_TOP", "exp_top", "tpl.explorer_top.html");
00606
00607
00608 $tpl->setVariable("BODY_CLASS", "il_Explorer");
00609
00610 $tpl_tree = new ilTemplate("tpl.tree.html", true, true);
00611
00612 $cur_depth = -1;
00613 foreach ($this->format_options as $key => $options)
00614 {
00615
00616 if (!$options["visible"])
00617 {
00618 continue;
00619 }
00620
00621
00622 $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]);
00623
00624
00625 $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]);
00626
00627 $cur_depth = $options["depth"];
00628
00629 if ($options["visible"] and $key != 0)
00630 {
00631 $this->formatObject($tpl_tree, $options["child"],$options,$options['obj_id']);
00632 }
00633 if ($key == 0)
00634 {
00635 $this->formatHeader($tpl_tree, $options["child"],$options);
00636 }
00637
00638 }
00639
00640 $this->handleListEndTags($tpl_tree, $cur_depth, -1);
00641
00642 $ilBench->stop("Explorer", "getOutput");
00643
00644 return $tpl_tree->get();
00645 }
00646
00650 function handleListEndTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
00651 {
00652 if ($a_item_depth < $a_cur_depth)
00653 {
00654
00655 for ($i = 0; $i < ($a_cur_depth - $a_item_depth); $i++)
00656 {
00657 $a_tpl_tree->touchBlock("end_list_item");
00658 $a_tpl_tree->touchBlock("element");
00659
00660 $a_tpl_tree->touchBlock("end_list");
00661 $a_tpl_tree->touchBlock("element");
00662 }
00663 }
00664 else if ($a_item_depth == $a_cur_depth)
00665 {
00666
00667 $a_tpl_tree->touchBlock("end_list_item");
00668 $a_tpl_tree->touchBlock("element");
00669 }
00670 }
00671
00675 function handleListStartTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
00676 {
00677
00678 if ($a_item_depth > $a_cur_depth)
00679 {
00680
00681 if ($a_item_depth > 1)
00682 {
00683 $a_tpl_tree->touchBlock("start_list");
00684 }
00685 else
00686 {
00687 $a_tpl_tree->touchBlock("start_list_no_indent");
00688 }
00689 $a_tpl_tree->touchBlock("element");
00690
00691 $a_tpl_tree->touchBlock("start_list_item");
00692 $a_tpl_tree->touchBlock("element");
00693 }
00694 else
00695 {
00696
00697 $a_tpl_tree->touchBlock("start_list_item");
00698 $a_tpl_tree->touchBlock("element");
00699 }
00700 }
00701
00710 function formatHeader(&$tpl,$a_obj_id,$a_option)
00711 {
00712 }
00713
00722 function formatObject(&$tpl, $a_node_id,$a_option,$a_obj_id = 0)
00723 {
00724 global $lng;
00725 if (!isset($a_node_id) or !is_array($a_option))
00726 {
00727 $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
00728 "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
00729 }
00730
00731 $pic = false;
00732 foreach ($a_option["tab"] as $picture)
00733 {
00734 if ($picture == 'plus')
00735 {
00736 $tpl->setCurrentBlock("exp_desc");
00737 $tpl->setVariable("EXP_DESC", $lng->txt("expand"));
00738 $tpl->parseCurrentBlock();
00739 $target = $this->createTarget('+',$a_node_id);
00740 $tpl->setCurrentBlock("expander");
00741 $tpl->setVariable("LINK_NAME", $a_node_id);
00742 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
00743 $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.gif"));
00744 $tpl->parseCurrentBlock();
00745 $pic = true;
00746 }
00747
00748 if ($picture == 'minus' && $this->show_minus)
00749 {
00750 $tpl->setCurrentBlock("exp_desc");
00751 $tpl->setVariable("EXP_DESC", $lng->txt("collapse"));
00752 $tpl->parseCurrentBlock();
00753 $target = $this->createTarget('-',$a_node_id);
00754 $tpl->setCurrentBlock("expander");
00755 $tpl->setVariable("LINK_NAME", $a_node_id);
00756 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
00757 $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.gif"));
00758 $tpl->parseCurrentBlock();
00759 $pic = true;
00760 }
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772 }
00773
00774 if (!$pic)
00775 {
00776 $tpl->setCurrentBlock("blank");
00777 $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.gif"));
00778 $tpl->parseCurrentBlock();
00779 }
00780
00781 if ($this->output_icons)
00782 {
00783 $tpl->setCurrentBlock("icon");
00784 $tpl->setVariable("ICON_IMAGE" , $this->getImage("icon_".$a_option["type"].".gif", $a_option["type"], $a_obj_id));
00785
00786 $tpl->setVariable("TARGET_ID" , "iconid_".$a_node_id);
00787 $this->iconList[] = "iconid_".$a_node_id;
00788 $tpl->setVariable("TXT_ALT_IMG", $lng->txt($a_option["desc"]));
00789 $tpl->parseCurrentBlock();
00790 }
00791
00792 if ($this->isClickable($a_option["type"], $a_node_id,$a_obj_id))
00793 {
00794 $tpl->setCurrentBlock("link");
00795
00796
00797
00798 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
00799
00800 $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
00801
00802 if ($style_class != "")
00803 {
00804 $tpl->setVariable("A_CLASS", ' class="'.$style_class.'" ' );
00805 }
00806
00807 if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) != "")
00808 {
00809 $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
00810 }
00811
00812 $tpl->setVariable("LINK_NAME", $a_node_id);
00813 $tpl->setVariable("TITLE", ilUtil::shortenText(
00814 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
00815 $this->textwidth, true));
00816 $tpl->setVariable("DESC", ilUtil::shortenText(
00817 $this->buildDescription($a_option["description"], $a_node_id, $a_option["type"]), $this->textwidth, true));
00818 $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
00819 if ($frame_target != "")
00820 {
00821 $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
00822 }
00823 $tpl->parseCurrentBlock();
00824 }
00825 else
00826 {
00827 $tpl->setCurrentBlock("text");
00828 $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText(
00829 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]), $this->textwidth, true));
00830 $tpl->setVariable("OBJ_DESC", ilUtil::shortenText(
00831 $this->buildDescription($a_option["description"], $a_node_id, $a_option["type"]), $this->textwidth, true));
00832 $tpl->parseCurrentBlock();
00833 }
00834
00835 $tpl->setCurrentBlock("list_item");
00836 $tpl->parseCurrentBlock();
00837 $tpl->touchBlock("element");
00838 }
00839
00843 function getImage($a_name, $a_type = "", $a_obj_id = "")
00844 {
00845 return ilUtil::getImagePath($a_name);
00846 }
00847
00848
00852 function getNodeStyleClass($a_id, $a_type)
00853 {
00854 if ($a_id == $this->highlighted)
00855 {
00856 return "il_HighlightedNode";
00857 }
00858 return "";
00859 }
00860
00864 function buildLinkTarget($a_node_id, $a_type)
00865 {
00866 $target = (strpos($this->target, "?") === false)
00867 ? $this->target."?"
00868 : $this->target."&";
00869 return $target.$this->target_get."=".$a_node_id.$this->params_get;
00870 }
00871
00875 function buildOnClick($a_node_id, $a_type, $a_title)
00876 {
00877 return "";
00878 }
00879
00883 function buildTitle($a_title, $a_id, $a_type)
00884 {
00885 return $a_title;
00886 }
00887
00891 function buildDescription($a_desc, $a_id, $a_type)
00892 {
00893 return "";
00894 }
00895
00899 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00900 {
00901 return $this->frame_target;
00902 }
00903
00904
00912 function createTarget($a_type,$a_node_id)
00913 {
00914 if (!isset($a_type) or !is_string($a_type) or !isset($a_node_id))
00915 {
00916 $this->ilias->raiseError(get_class($this)."::createTarget(): Missing parameter or wrong datatype! ".
00917 "type: ".$a_type." node_id:".$a_node_id,$this->ilias->error_obj->WARNING);
00918 }
00919
00920
00921
00922
00923 $a_node_id = $a_type == '+' ? $a_node_id : -(int) $a_node_id;
00924
00925 $sep = (is_int(strpos($this->expand_target, "?")))
00926 ? "&"
00927 : "?";
00928 return $this->expand_target.$sep.$this->expand_variable."=".$a_node_id.$this->params_get."#".abs($a_node_id);
00929 }
00930
00937 function setFrameTarget($a_target)
00938 {
00939 $this->frame_target = $a_target;
00940 }
00941
00947 function createLines($a_depth)
00948 {
00949 for ($i = 0; $i < count($this->format_options); ++$i)
00950 {
00951 if ($this->format_options[$i]["depth"] == $a_depth+1
00952 and !$this->format_options[$i]["container"]
00953 and $this->format_options[$i]["depth"] != 1)
00954 {
00955 $this->format_options[$i]["tab"]["$a_depth"] = "quer";
00956 }
00957
00958 if ($this->format_options[$i]["depth"] == $a_depth+2)
00959 {
00960 if ($this->is_in_array($i+1,$this->format_options[$i]["depth"]))
00961 {
00962 $this->format_options[$i]["tab"]["$a_depth"] = "winkel";
00963 }
00964 else
00965 {
00966 $this->format_options[$i]["tab"]["$a_depth"] = "ecke";
00967 }
00968 }
00969
00970 if ($this->format_options[$i]["depth"] > $a_depth+2)
00971 {
00972 if ($this->is_in_array($i+1,$a_depth+2))
00973 {
00974 $this->format_options[$i]["tab"]["$a_depth"] = "hoch";
00975 }
00976 }
00977 }
00978 }
00979
00987 function is_in_array($a_start,$a_depth)
00988 {
00989 for ($i=$a_start;$i<count($this->format_options);++$i)
00990 {
00991 if ($this->format_options[$i]["depth"] < $a_depth)
00992 {
00993 break;
00994 }
00995
00996 if ($this->format_options[$i]["depth"] == $a_depth)
00997 {
00998 return true;
00999 }
01000 }
01001 return false;
01002 }
01003
01010 function getIndex($a_data)
01011 {
01012 foreach ($this->format_options as $key => $value)
01013 {
01014 if (($value["child"] == $a_data["parent"]))
01015 {
01016 return $key;
01017 }
01018 }
01019
01020
01021 $this->ilias->raiseError(get_class($this)."::getIndex(): Error in tree. No index found!",$this->ilias->error_obj->FATAL);
01022 }
01023
01030 function addFilter($a_item)
01031 {
01032 $ispresent = 0;
01033
01034 if (is_array($this->filter))
01035 {
01036
01037 foreach ($this->filter as $item)
01038 {
01039 if ($item == $a_item)
01040 {
01041 $is_present = 1;
01042
01043 return false;
01044 }
01045 }
01046 }
01047 else
01048 {
01049 $this->filter = array();
01050 }
01051 if ($is_present == 0)
01052 {
01053 $this->filter[] = $a_item;
01054 }
01055
01056 return true;
01057 }
01058
01065 function delFilter($a_item)
01066 {
01067
01068 if (is_array($this->filter))
01069 {
01070
01071 $tmp = array();
01072
01073 foreach ($this->filter as $item)
01074 {
01075 if ($item != $a_item)
01076 {
01077 $tmp[] = $item;
01078 }
01079 else
01080 {
01081 $deleted = 1;
01082 }
01083 }
01084
01085 $this->filter = $tmp;
01086 }
01087 else
01088 {
01089 return false;
01090 }
01091
01092 if ($deleted == 1)
01093 {
01094 return true;
01095 }
01096 else
01097 {
01098 return false;
01099 }
01100 }
01101
01108 function setExpand($a_node_id)
01109 {
01110
01111 if(!is_array($_SESSION[$this->expand_variable]))
01112 {
01113 $_SESSION[$this->expand_variable] = array($this->tree->getRootId());
01114 }
01115
01116 if ($a_node_id > 0 && !in_array($a_node_id,$_SESSION[$this->expand_variable]))
01117 {
01118 array_push($_SESSION[$this->expand_variable],$a_node_id);
01119 }
01120
01121 if ($a_node_id < 0)
01122 {
01123 $key = array_keys($_SESSION[$this->expand_variable],-(int) $a_node_id);
01124 unset($_SESSION[$this->expand_variable][$key[0]]);
01125 }
01126 $this->expanded = $_SESSION[$this->expand_variable];
01127 }
01128
01135 function forceExpandAll($a_mode, $a_show_minus = true)
01136 {
01137 $this->expand_all = (bool) $a_mode;
01138 $this->show_minus = $a_show_minus;
01139 }
01140
01147 function setFiltered($a_bool)
01148 {
01149 $this->filtered = $a_bool;
01150 return true;
01151 }
01152
01159 function checkFilter($a_item)
01160 {
01161 if (is_array($this->filter))
01162 {
01163 if (in_array($a_item, $this->filter))
01164 {
01165 $ret = true;
01166 }
01167 else
01168 {
01169 $ret = false;
01170 }
01171 }
01172 else
01173 {
01174 $ret = false;
01175 }
01176
01177 if ($this->getFilterMode() == IL_FM_NEGATIVE )
01178 {
01179 return $ret;
01180 }
01181 else
01182 {
01183 return !$ret;
01184 }
01185 }
01186
01193 function sortNodes($a_nodes)
01194 {
01195 foreach ($a_nodes as $key => $node)
01196 {
01197 if ($node["type"] == "adm")
01198 {
01199 $match = $key;
01200 $adm_node = $node;
01201 break;
01202 }
01203 }
01204
01205
01206 isset($match) ? array_splice($a_nodes,$match,1) : "";
01207
01208 $a_nodes = ilUtil::sortArray($a_nodes,$this->order_column,$this->order_direction);
01209
01210
01211 isset ($match) ? array_push($a_nodes,$adm_node) : "";
01212
01213 return $a_nodes;
01214 }
01215 }
01216 ?>