Go to the documentation of this file.00001 <?php
00002
00003
00004 require_once("classes/class.ilExplorer.php");
00005 require_once("content/classes/AICC/class.ilAICCTree.php");
00006 require_once("content/classes/AICC/class.ilAICCExplorer.php");
00007
00008 class ilHACPExplorer extends ilAICCExplorer
00009 {
00010
00017 function ilHACPExplorer($a_target, &$a_slm_obj)
00018 {
00019 parent::ilExplorer($a_target);
00020 $this->slm_obj =& $a_slm_obj;
00021 $this->tree = new ilAICCTree($a_slm_obj->getId());
00022 $this->root_id = $this->tree->readRootId();
00023 $this->checkPermissions(false);
00024 $this->outputIcons(true);
00025 $this->setOrderColumn("");
00026 }
00027
00036 function formatObject($a_node_id,$a_option)
00037 {
00038 global $lng;
00039
00040
00041 if (!isset($a_node_id) or !is_array($a_option))
00042 {
00043 $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
00044 "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
00045 }
00046
00047 $tpl = new ilTemplate("tpl.sahs_tree.html", true, true, true);
00048
00049 if ($a_option["type"]=="sos")
00050 return;
00051
00052 if ($a_option["type"]=="srs")
00053 return;
00054
00055 if (is_array($a_option["tab"])) {
00056 foreach ($a_option["tab"] as $picture)
00057 {
00058 if ($picture == 'plus')
00059 {
00060 $target = $this->createTarget('+',$a_node_id);
00061 $tpl->setCurrentBlock("expander");
00062 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
00063 $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/plus.gif"));
00064 $tpl->parseCurrentBlock();
00065 }
00066
00067 if ($picture == 'minus' && $this->show_minus)
00068 {
00069 $target = $this->createTarget('-',$a_node_id);
00070 $tpl->setCurrentBlock("expander");
00071 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
00072 $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/minus.gif"));
00073 $tpl->parseCurrentBlock();
00074 }
00075
00076 if ($picture == 'blank' or $picture == 'winkel'
00077 or $picture == 'hoch' or $picture == 'quer' or $picture == 'ecke'
00078 or ($picture == 'minus' && !$this->show_minus))
00079 {
00080 $picture = 'blank';
00081 $tpl->setCurrentBlock("lines");
00082 $tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".gif"));
00083 $tpl->parseCurrentBlock();
00084 }
00085 }
00086 }
00087
00088 if ($this->output_icons) {
00089 if ($this->isClickable($a_option["type"], $a_node_id) && $a_option["type"]!="sbl")
00090 $this->getOutputIcons($tpl, $a_option, $a_node_id);
00091 }
00092
00093
00094 if ($this->isClickable($a_option["type"], $a_node_id))
00095 {
00096 $tpl->setCurrentBlock("link");
00097
00098
00099
00100
00101 $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
00102 if ($frame_target != "")
00103 {
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 if ($a_option["type"]=="sbl") {
00114 $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
00115 $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
00116 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
00117
00118 } else {
00119 include_once("content/classes/AICC/class.ilAICCUnit.php");
00120 $unit =& new ilAICCUnit($a_node_id);
00121
00122
00123 $url=$unit->getCommand_line();
00124 if (strlen($url)==0)
00125 $url=$unit->getFilename();
00126
00127
00128
00129 if (substr($url,0,7)!="http://")
00130 $url=$this->slm_obj->getDataDirectory("output")."/".$url;
00131
00132 if (strlen($unit->getWebLaunch())>0)
00133 $url.="?".$unit->getWebLaunch();
00134
00135 $hacpURL=ILIAS_HTTP_PATH."/content/sahs_server.php";
00136
00137
00138
00139 $aicc_sid=implode("_", array(session_id(), $this->slm_obj->ref_id, $a_node_id));
00140 if (strlen($unit->getWebLaunch())>0)
00141 $url.="&";
00142 else
00143 $url.="?";
00144 $url.="aicc_url=$hacpURL&aicc_sid=$aicc_sid";
00145
00146
00147
00148
00149
00150
00151 $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
00152 $tpl->setVariable("LINK_TARGET", "javascript:void(0);");
00153 $tpl->setVariable("ONCLICK", " onclick=\"parent.$frame_target.location.href='$url'\"");
00154
00155
00156
00157 }
00158
00159 }
00160 $tpl->parseCurrentBlock();
00161 }
00162 else
00163 {
00164 $tpl->setCurrentBlock("text");
00165 $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
00166 $tpl->parseCurrentBlock();
00167 }
00168 $this->formatItemTable($tpl, $a_node_id, $a_option["type"]);
00169
00170 $tpl->setCurrentBlock("row");
00171 $tpl->parseCurrentBlock();
00172
00173 $this->output[] = $tpl->get();
00174 }
00175 }
00176 ?>