Navigation History of Repository Items. More...
Public Member Functions | |
| __construct () | |
| Constructor. | |
| addItem ($a_ref_id, $a_link, $a_type, $a_title="") | |
| Add an item to the stack. | |
| getItems () | |
| Get navigation item stack. | |
Private Attributes | |
| $items | |
Navigation History of Repository Items.
Definition at line 31 of file class.ilNavigationHistory.php.
| ilNavigationHistory::__construct | ( | ) |
| ilNavigationHistory::addItem | ( | $ | a_ref_id, | |
| $ | a_link, | |||
| $ | a_type, | |||
| $ | a_title = "" | |||
| ) |
Add an item to the stack.
If ref_id is already used, the item is moved to the top.
Definition at line 61 of file class.ilNavigationHistory.php.
References $_SESSION, $items, ilObject::_exists(), ilObject::_lookupObjId(), and ilObject::_lookupTitle().
{
if ($a_title == "" && $a_ref_id > 0)
{
$obj_id = ilObject::_lookupObjId($a_ref_id);
if (ilObject::_exists($obj_id))
{
$a_title = ilObject::_lookupTitle($obj_id);
}
}
// remove ref id from stack, if existing
foreach($this->items as $key => $item)
{
if ($item["ref_id"] == $a_ref_id)
{
array_splice($this->items, $key, 1);
break;
}
}
$this->items = array_merge(
array(array("ref_id" => $a_ref_id, "link" => $a_link, "title" => $a_title,
"type" => $a_type)), $this->items);
$items = serialize($this->items);
$_SESSION["il_nav_history"] = $items;
}
Here is the call graph for this function:| ilNavigationHistory::getItems | ( | ) |
ilNavigationHistory::$items [private] |
Definition at line 34 of file class.ilNavigationHistory.php.
Referenced by __construct(), addItem(), and getItems().
1.7.1