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 require_once("classes/class.ilExplorer.php");
00034 require_once("content/classes/AICC/class.ilAICCTree.php");
00035 require_once("content/classes/SCORM/class.ilSCORMExplorer.php");
00036
00037 class ilAICCExplorer extends ilSCORMExplorer
00038 {
00039
00046 function ilAICCExplorer($a_target, &$a_slm_obj)
00047 {
00048 parent::ilExplorer($a_target);
00049 $this->slm_obj =& $a_slm_obj;
00050 $this->tree = new ilAICCTree($a_slm_obj->getId());
00051 $this->root_id = $this->tree->readRootId();
00052 $this->checkPermissions(false);
00053 $this->outputIcons(false);
00054 $this->setOrderColumn("");
00055 }
00056
00057 function getItem($a_node_id) {
00058 return new ilAICCUnit($a_node_id);
00059 }
00060
00061 function getIconImagePathPrefix() {
00062 return "scorm/";
00063 }
00064
00065 function getNodesToSkip() {
00066 return 1;
00067 }
00068
00069 function isClickable($a_type, $a_id = 0)
00070 {
00071 if ($a_type=="sbl") {
00072 $block_object =& new ilAICCBlock($a_id);
00073 return (strlen($block_object->getDescription())>0);
00074 }
00075
00076 if ($a_type != "sau")
00077 {
00078 return false;
00079 }
00080 else
00081 {
00082 $sc_object =& new ilAICCUnit($a_id);
00083
00084
00085 return true;
00086
00087 }
00088 return false;
00089 }
00090
00091 function formatItemTable(&$tpl, $a_id, $a_type)
00092 {
00093 global $lng;
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 }
00140
00141
00142
00151 function formatObject($a_node_id,$a_option)
00152 {
00153 global $lng;
00154
00155 if (!isset($a_node_id) or !is_array($a_option))
00156 {
00157 $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
00158 "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
00159 }
00160
00161 $tpl = new ilTemplate("tpl.sahs_tree.html", true, true, true);
00162
00163 if ($a_option["type"]=="sos")
00164 return;
00165
00166 if ($a_option["type"]=="srs")
00167 return;
00168
00169 if (is_array($a_option["tab"])) {
00170 foreach ($a_option["tab"] as $picture)
00171 {
00172 $pic = false;
00173 if ($picture == 'plus')
00174 {
00175 $target = $this->createTarget('+',$a_node_id);
00176 $tpl->setCurrentBlock("expander");
00177 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
00178 $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/plus.gif"));
00179 $tpl->parseCurrentBlock();
00180 $pic = true;
00181 }
00182
00183 if ($picture == 'minus' && $this->show_minus)
00184 {
00185 $target = $this->createTarget('-',$a_node_id);
00186 $tpl->setCurrentBlock("expander");
00187 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
00188 $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/minus.gif"));
00189 $tpl->parseCurrentBlock();
00190 $pic = true;
00191 }
00192
00193 if (!$pic)
00194 {
00195 $picture = 'blank';
00196 $tpl->setCurrentBlock("lines");
00197 $tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".gif"));
00198 $tpl->parseCurrentBlock();
00199 }
00200 }
00201 }
00202
00203 if ($this->output_icons) {
00204 if ($this->isClickable($a_option["type"], $a_node_id) && !$a_option["type"]=="sbl")
00205 $this->getOutputIcons($tpl, $a_option, $a_node_id);
00206 }
00207
00208 if ($this->isClickable($a_option["type"], $a_node_id))
00209 {
00210 $tpl->setCurrentBlock("link");
00211
00212
00213
00214
00215 $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
00216 if ($frame_target != "")
00217 {
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227 if ($a_option["type"]=="sbl") {
00228 $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
00229 $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
00230 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
00231
00232 } else {
00233
00234 $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"]." ($a_node_id)", $this->textwidth, true));
00235 $tpl->setVariable("LINK_TARGET", "javascript:void(0);");
00236 $tpl->setVariable("ONCLICK", " onclick=\"parent.APIFRAME.setupApi();parent.APIFRAME.API.IliasLaunchSahs('".$a_node_id."');return false;\"");
00237
00238
00239 }
00240
00241 }
00242 $tpl->parseCurrentBlock();
00243 }
00244 else
00245 {
00246 $tpl->setCurrentBlock("text");
00247 $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
00248 $tpl->parseCurrentBlock();
00249 }
00250 $this->formatItemTable($tpl, $a_node_id, $a_option["type"]);
00251
00252 $tpl->setCurrentBlock("row");
00253 $tpl->parseCurrentBlock();
00254
00255 $this->output[] = $tpl->get();
00256 }
00257 }
00258 ?>