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
00036
00037
00038
00039
00045 function ilLearningObjectGUI($a_data,$a_id,$a_call_by_reference)
00046 {
00047 $this->type = "lo";
00048 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference);
00049 }
00050
00051 function viewObject()
00052 {
00053 global $rbacsystem, $tree, $tpl;
00054
00055 if (empty($_GET["lo_id"]))
00056 {
00057 $_GET["lo_id"] = $_GET["obj_id"];
00058 $_GET["lo_parent"] = $_GET["parent"];
00059 }
00060
00061 if (empty($_GET["lo_parent"]))
00062 {
00063 $_GET["lo_parent"] = $_GET["lm_id"];
00064 }
00065
00066
00067 $lotree = new ilTree($_GET["lm_id"],$_GET["lm_id"]);
00068
00069 $this->data = array();
00070 $this->data["data"] = array();
00071 $this->data["ctrl"] = array();
00072
00073 $this->data["cols"] = array("", "view", "title", "description", "last_change");
00074
00075 $lo_childs = $lotree->getChilds($_GET["lo_id"], $a_order, $a_direction);
00076
00077 foreach ($lo_childs as $key => $val)
00078 {
00079
00080
00081
00082
00083
00084
00085
00086 $this->data["data"][] = array(
00087 "type" => "<img src=\"".$tpl->tplPath."/images/enlarge.gif\" border=\"0\">",
00088 "title" => $val["title"],
00089 "description" => $val["desc"],
00090 "last_change" => $val["last_update"]
00091 );
00092
00093
00094 $this->data["ctrl"][] = array(
00095 "type" => $val["type"],
00096 "obj_id" => $_GET["obj_id"],
00097 "parent" => $_GET["parent"],
00098 "parent_parent" => $val["parent_parent"],
00099 "lm_id" => $_GET["lm_id"],
00100 "lo_id" => $val["child"],
00101 "lo_parent" => $val["parent"]
00102 );
00103 }
00104
00105 $this->setLOLocator($lotree, $_GET["lo_id"], $_GET["lo_parent"]);
00106
00107 parent::displayList();
00108 }
00134 function setLOLocator($a_tree = "", $a_obj_id = "", $a_parent = "", $a_parent_parent = "")
00135 {
00136 if (!is_object($a_tree))
00137 {
00138 $a_tree =& $this->tree;
00139 }
00140
00141 if (!($a_obj_id))
00142 {
00143 $a_obj_id = $_GET["obj_id"];
00144 }
00145
00146 if (!($a_parent))
00147 {
00148 $a_parent = $_GET["parent"];
00149 }
00150
00151 if (!($a_parent_parent))
00152 {
00153 $a_parent_parent = $_GET["parent_parent"];
00154 }
00155
00156 global $lng;
00157
00158 $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
00159
00160 if ($a_parent_parent)
00161 {
00162 $path = $a_tree->getPathFull($a_parent);
00163 }
00164 else
00165 {
00166 $path = $a_tree->getPathFull($a_obj_id);
00167 }
00168
00169
00170 if ($a_parent_parent)
00171 {
00172
00173 $subObj =& $this->ilias->obj_factory->getInstanceByObjId($a_obj_id);
00174
00175 $path[] = array(
00176 "id" => $a_obj_id,
00177 "title" => $this->lng->txt($subObj->getTitle()),
00178 "parent" => $a_parent,
00179 "parent_parent" => $a_parent_parent
00180 );
00181 }
00182
00183 foreach ($path as $key => $row)
00184 {
00185 if ($key < count($path)-1)
00186 {
00187 $this->tpl->touchBlock("locator_separator");
00188 }
00189
00190 $this->tpl->setCurrentBlock("locator_item");
00191 $this->tpl->setVariable("ITEM", $row["title"]);
00192 $this->tpl->parseCurrentBlock();
00193
00194 if ($row["child"] == $_GET["lm_id"])
00195 {
00196 $type_lo = "type=lo&";
00197 }
00198 }
00199
00200 $this->tpl->setCurrentBlock("locator");
00201
00202 $this->tpl->setVariable("TXT_PATH","LO-Path: ");
00203 $this->tpl->parseCurrentBlock();
00204 }
00205
00212 function displayStructure ($a_tree)
00213 {
00214 echo "<table border=\"1\">" . "<tr>" . "<th>id</th>" . "<th>value</th>" . "<th>name</th>" . "<th>type</th>" . "<th>depth</th>" . "<th>parent</th>" . "<th>first</th>" . "<th>prev</th>" . "<th>next</th>" . "<th>left</th>" . "<th>right</th>" . "<th>db_id</th>" . "</tr>";
00215
00216 foreach ($a_tree as $id => $node)
00217 {
00218 echo "<tr>";
00219 echo "<td>" . $id . "</td>";
00220
00221 foreach ($node as $key => $value)
00222 {
00223 echo "<td>" . $value . "</td>";
00224 }
00225 echo "</tr>";
00226 }
00227 echo "</table>";
00228 }
00229
00230 ?>