ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNavigationHistoryGUI Class Reference

User Interface Class for Navigation History. More...

+ Collaboration diagram for ilNavigationHistoryGUI:

Public Member Functions

 __construct ()
 Constructor.
 executeCommand ()
 Execute command.
 getHTML ()
 Get HTML for navigation history.
 handleNavigationRequest ()
 Handle navigation request.
 removeEntries ()
 Remove all entries form list.

Private Attributes

 $items

Detailed Description

User Interface Class for Navigation History.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilNavigationHistoryGUI:

Definition at line 13 of file class.ilNavigationHistoryGUI.php.

Constructor & Destructor Documentation

ilNavigationHistoryGUI::__construct ( )

Constructor.

Definition at line 22 of file class.ilNavigationHistoryGUI.php.

{
}

Member Function Documentation

ilNavigationHistoryGUI::executeCommand ( )

Execute command.

Definition at line 29 of file class.ilNavigationHistoryGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd();
switch($next_class)
{
default:
$this->$cmd();
break;
}
}
ilNavigationHistoryGUI::getHTML ( )

Get HTML for navigation history.

Definition at line 47 of file class.ilNavigationHistoryGUI.php.

References $_GET, $items, $lng, ilObject\_getIcon(), ilObject\_lookupObjId(), ilAccessKey\LAST_VISITED, and ilAdvancedSelectionListGUI\NO_ICON.

{
global $ilNavigationHistory, $lng;
include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
$selection = new ilAdvancedSelectionListGUI();
$selection->setFormSelectMode("url_ref_id", "ilNavHistorySelect", true,
"goto.php?target=navi_request", "ilNavHistory", "ilNavHistoryForm",
"_top", $lng->txt("go"), "ilNavHistorySubmit");
$selection->setListTitle($lng->txt("last_visited"));
$selection->setId("lastvisited");
$selection->setSelectionHeaderClass("MMInactive");
$selection->setHeaderIcon(ilAdvancedSelectionListGUI::NO_ICON);
$selection->setItemLinkClass("small");
$selection->setUseImages(true);
include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
$selection->setAccessKey(ilAccessKey::LAST_VISITED);
$items = $ilNavigationHistory->getItems();
//$sel_arr = array(0 => "-- ".$lng->txt("last_visited")." --");
reset($items);
$cnt = 0;
foreach($items as $k => $item)
{
if ($cnt++ > 20) break;
if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) ||
$item["ref_id"] != $_GET["ref_id"] || $k > 0) // do not list current item
{
$obj_id = ilObject::_lookupObjId($item["ref_id"]);
$selection->addItem($item["title"], $item["ref_id"], $item["link"],
ilObject::_getIcon($obj_id, "tiny", $item["type"]),
$lng->txt("obj_".$item["type"]), "_top");
}
}
$html = $selection->getHTML();
if ($html == "")
{
$selection->addItem($lng->txt("no_items"), "", "#",
"", "", "_top");
$selection->setUseImages(false);
$html = $selection->getHTML();
}
return $html;
}

+ Here is the call graph for this function:

ilNavigationHistoryGUI::handleNavigationRequest ( )

Handle navigation request.

Definition at line 96 of file class.ilNavigationHistoryGUI.php.

References $_GET, $_POST, $ilCtrl, $items, and ilUtil\redirect().

{
global $ilNavigationHistory, $ilCtrl;
if ($_GET["target"] == "navi_request")
{
$items = $ilNavigationHistory->getItems();
foreach($items as $item)
{
if ($item["ref_id"] == $_POST["url_ref_id"])
{
ilUtil::redirect($item["link"]);
}
}
reset($items);
$item = current($items);
if ($_POST["url_ref_id"] == 0 && $item["ref_id"] == $_GET["ref_id"])
{
$item = next($items); // omit current item
}
if ($_POST["url_ref_id"] == 0 && $item["link"] != "")
{
ilUtil::redirect($item["link"]);
}
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", "");
$ilCtrl->setParameterByClass("ilrepositorygui", "getlast", "true");
$ilCtrl->redirectByClass("ilrepositorygui", "frameset");
}
}

+ Here is the call graph for this function:

ilNavigationHistoryGUI::removeEntries ( )

Remove all entries form list.

Parameters
@return

Definition at line 133 of file class.ilNavigationHistoryGUI.php.

{
global $ilNavigationHistory;
$ilNavigationHistory->deleteDBEntries();
$ilNavigationHistory->deleteSessionEntries();
}

Field Documentation

ilNavigationHistoryGUI::$items
private

Definition at line 16 of file class.ilNavigationHistoryGUI.php.

Referenced by getHTML(), and handleNavigationRequest().


The documentation for this class was generated from the following file: