24 $this->items =
array();
40 public function addItem($a_ref_id, $a_link,
$a_type, $a_title =
"", $a_sub_obj_id =
"",
46 if ($ilUser->prefs[
"store_last_visited"] == 2)
51 $a_sub_obj_id = $a_sub_obj_id.
"";
53 if ($a_title ==
"" && $a_ref_id > 0)
62 $id = $a_ref_id.
":".$a_sub_obj_id;
64 $new_items[$id] =
array(
"id" => $id,
"ref_id" => $a_ref_id,
"link" => $a_link,
"title" => $a_title,
65 "type" =>
$a_type,
"sub_obj_id" => $a_sub_obj_id,
"goto_link" => $a_goto_link);
68 foreach($this->items as $key => $item)
70 if ($item[
"id"] != $id && $cnt <= 10)
72 $new_items[$item[
"id"]] = $item;
78 $this->items = $new_items;
80 $items = serialize($this->items);
86 if ($ilUser->prefs[
"store_last_visited"] == 1)
93 $ilDB->update(
"usr_data",
95 "last_visited" =>
array(
"clob", serialize($this->
getItems()))),
97 "usr_id" =>
array(
"integer", $ilUser->getId()))
106 global $tree,
$ilDB,
$ilUser, $objDefinition, $ilPluginAdmin;
110 foreach ($this->items as $it)
112 if ($tree->isInTree($it[
"ref_id"]) &&
113 (!$objDefinition->isPluginTypeName($it[
"type"]) ||
118 $items[$it[
"ref_id"].
":".$it[
"sub_obj_id"]] = $it;
122 if (count(
$items) < 10 && $ilUser->getId() != ANONYMOUS_USER_ID)
124 $set = $ilDB->query(
"SELECT last_visited FROM usr_data ".
125 " WHERE usr_id = ".$ilDB->quote($ilUser->getId(),
"integer")
127 $rec = $ilDB->fetchAssoc($set);
128 $db_entries = unserialize($rec[
"last_visited"]);
130 if (is_array($db_entries))
132 foreach ($db_entries as $rec)
134 include_once(
"./Services/Link/classes/class.ilLink.php");
136 if ($cnt <= 10 && ! isset(
$items[$rec[
"ref_id"].
":".$rec[
"sub_obj_id"]]))
138 if ($tree->isInTree($rec[
"ref_id"]) &&
139 (!$objDefinition->isPluginTypeName($rec[
"type"]) ||
144 $link = ($rec[
"goto_link"] !=
"")
147 if ($rec[
"sub_obj_id"] !=
"")
155 $items[$rec[
"ref_id"].
":".$rec[
"sub_obj_id"]] =
array(
"id" => $rec[
"ref_id"].
":".$rec[
"sub_obj_id"],
156 "ref_id" => $rec[
"ref_id"],
"link" => $link,
"title" =>
$title,
157 "type" => $rec[
"type"],
"sub_obj_id" => $rec[
"sub_obj_id"],
"goto_link" => $rec[
"goto_link"]);
179 $ilDB->update(
"usr_data",
181 "last_visited" =>
array(
"clob", serialize(
array()))),
183 "usr_id" =>
array(
"integer", $ilUser->getId()))
__construct()
Constructor.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
deleteSessionEntries()
Delete session entries.
static _lookupTitle($a_id)
lookup object title
static lookupNameForId($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
Lookup name for id.
getItems()
Get navigation item stack.
static _lookupObjId($a_id)
Navigation History of Repository Items.
Create styles array
The data for the language used.
addItem($a_ref_id, $a_link, $a_type, $a_title="", $a_sub_obj_id="", $a_goto_link="")
Add an item to the stack.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
deleteDBEntries()
Delete DB entries.