51 $this->
user = $DIC->user();
52 $this->db = $DIC->database();
53 $this->tree = $DIC->repositoryTree();
54 $this->obj_definition = $DIC[
"objDefinition"];
55 $this->plugin_admin = $DIC[
"ilPluginAdmin"];
56 $this->items = array();
82 if (
$ilUser->prefs[
"store_last_visited"] == 2) {
86 $a_sub_obj_id = $a_sub_obj_id .
"";
88 if ($a_title ==
"" && $a_ref_id > 0) {
95 $id = $a_ref_id .
":" . $a_sub_obj_id;
97 $new_items[
$id] = array(
"id" =>
$id,
"ref_id" => $a_ref_id,
"link" => $a_link,
"title" => $a_title,
98 "type" =>
$a_type,
"sub_obj_id" => $a_sub_obj_id,
"goto_link" => $a_goto_link);
101 foreach ($this->items as
$key => $item) {
102 if ($item[
"id"] !=
$id && $cnt <= 10) {
103 $new_items[$item[
"id"]] = $item;
109 $this->items = $new_items;
111 $items = serialize($this->items);
117 if (
$ilUser->prefs[
"store_last_visited"] == 1) {
126 "last_visited" => array(
"clob", serialize($this->
getItems()))),
128 "usr_id" => array(
"integer",
$ilUser->getId()))
145 foreach ($this->items as $it) {
146 if (
$tree->isInTree($it[
"ref_id"]) &&
148 !$objDefinition->isPluginTypeName($it[
"type"]) ||
149 $ilPluginAdmin->isActive(
156 $items[$it[
"ref_id"] .
":" . $it[
"sub_obj_id"]] = $it;
160 if (count(
$items) < 10 &&
$ilUser->getId() != ANONYMOUS_USER_ID) {
162 "SELECT last_visited FROM usr_data " .
163 " WHERE usr_id = " .
$ilDB->quote(
$ilUser->getId(),
"integer")
165 $rec =
$ilDB->fetchAssoc($set);
166 $db_entries = unserialize($rec[
"last_visited"]);
168 if (is_array($db_entries)) {
169 foreach ($db_entries as $rec) {
170 include_once(
"./Services/Link/classes/class.ilLink.php");
172 if ($cnt <= 10 && !isset(
$items[$rec[
"ref_id"] .
":" . $rec[
"sub_obj_id"]])) {
173 if (
$tree->isInTree($rec[
"ref_id"]) &&
175 !$objDefinition->isPluginTypeName($rec[
"type"]) ||
176 $ilPluginAdmin->isActive(
183 $link = ($rec[
"goto_link"] !=
"")
186 if ($rec[
"sub_obj_id"] !=
"") {
191 $items[$rec[
"ref_id"] .
":" . $rec[
"sub_obj_id"]] = array(
"id" => $rec[
"ref_id"] .
":" . $rec[
"sub_obj_id"],
192 "ref_id" => $rec[
"ref_id"],
"link" => $link,
"title" =>
$title,
193 "type" => $rec[
"type"],
"sub_obj_id" => $rec[
"sub_obj_id"],
"goto_link" => $rec[
"goto_link"]);
219 "last_visited" => array(
"clob", serialize(array()))),
221 "usr_id" => array(
"integer",
$ilUser->getId()))
233 $_SESSION[
"il_nav_history"] = serialize(array());
__construct()
Constructor.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
if(!array_key_exists('StateId', $_REQUEST)) $id
deleteSessionEntries()
Delete session entries.
static _lookupTitle($a_id)
lookup object title
static lookupNameForId(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_id)
addItem( $a_ref_id, $a_link, $a_type, $a_title="", $a_sub_obj_id="", $a_goto_link="")
Add an item to the stack.
getItems()
Get navigation item stack.
static _lookupObjId($a_id)
Navigation History of Repository Items.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
deleteDBEntries()
Delete DB entries.