Go to the documentation of this file.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
00025
00026
00027
00028
00029
00030
00031
00032
00033 include_once "./classes/class.ilExplorer.php";
00034 include_once "./assessment/classes/inc.AssessmentConstants.php";
00035
00036 class ilSolutionExplorer extends ilExplorer
00037 {
00038
00044 var $root_id;
00045 var $output;
00046 var $ctrl;
00047
00048 var $selectable_type;
00049 var $ref_id;
00050 var $target_class;
00051
00057 function ilSolutionExplorer($a_target, $a_target_class)
00058 {
00059 global $tree,$ilCtrl;
00060
00061 $this->ctrl = $ilCtrl;
00062 $this->target_class = $a_target_class;
00063 parent::ilExplorer($a_target);
00064 $this->tree = $tree;
00065 $this->root_id = $this->tree->readRootId();
00066 $this->order_column = "title";
00067
00068 $this->setSessionExpandVariable("expand");
00069
00070
00071 $this->addFilter("root");
00072 $this->addFilter("cat");
00073 $this->addFilter("grp");
00074 $this->addFilter("fold");
00075 $this->addFilter("crs");
00076
00077 $this->setFilterMode(IL_FM_POSITIVE);
00078 $this->setFiltered(true);
00079 }
00080
00081 function setSelectableType($a_type)
00082 {
00083 $this->selectable_type = $a_type;
00084 }
00085 function setRefId($a_ref_id)
00086 {
00087 $this->ref_id = $a_ref_id;
00088 }
00089
00090
00091 function buildLinkTarget($a_node_id, $a_type)
00092 {
00093 if($a_type == $this->selectable_type)
00094 {
00095 $this->ctrl->setParameterByClass($this->target_class,'source_id',$a_node_id);
00096 return $this->ctrl->getLinkTargetByClass($this->target_class,'linkChilds');
00097 }
00098 else
00099 {
00100 $this->ctrl->setParameterByClass($this->target_class,"ref_id",$this->ref_id);
00101 return $this->ctrl->getLinkTargetByClass($this->target_class,'addSolutionHint');
00102 }
00103
00104 }
00105
00106 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
00107 {
00108 return '';
00109 }
00110
00111 function isClickable($a_type, $a_ref_id)
00112 {
00113 return $a_type == $this->selectable_type and $a_ref_id != $this->ref_id;
00114 }
00115
00116 function showChilds($a_ref_id)
00117 {
00118 global $rbacsystem;
00119
00120 if ($a_ref_id == 0)
00121 {
00122 return true;
00123 }
00124
00125 if ($rbacsystem->checkAccess("read", $a_ref_id))
00126 {
00127 return true;
00128 }
00129 else
00130 {
00131 return false;
00132 }
00133 }
00134
00135
00143 function formatHeader($a_obj_id,$a_option)
00144 {
00145 global $lng, $ilias;
00146
00147 include_once "./classes/class.ilTemplate.php";
00148 $tpl = new ilTemplate("tpl.tree.html", true, true);
00149
00150 $tpl->setCurrentBlock("text");
00151 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
00152 $tpl->parseCurrentBlock();
00153
00154 $tpl->setCurrentBlock("row");
00155 $tpl->parseCurrentBlock();
00156
00157 $this->output[] = $tpl->get();
00158 }
00159
00160 }
00161 ?>