ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilNavigationHistoryGUI Class Reference

User Interface Class for Navigation History. More...

+ Collaboration diagram for ilNavigationHistoryGUI:

Public Member Functions

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

Protected Attributes

 $ctrl
 
 $nav_history
 
 $lng
 

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

◆ __construct()

ilNavigationHistoryGUI::__construct ( )

Constructor.

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

References $DIC.

38  {
39  global $DIC;
40 
41  $this->ctrl = $DIC->ctrl();
42  $this->nav_history = $DIC["ilNavigationHistory"];
43  $this->lng = $DIC->language();
44  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ executeCommand()

ilNavigationHistoryGUI::executeCommand ( )

Execute command.

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

References $ctrl, and $ilCtrl.

50  {
52 
53  $next_class = $ilCtrl->getNextClass();
54  $cmd = $ilCtrl->getCmd();
55 
56  switch ($next_class) {
57  default:
58  $this->$cmd();
59  break;
60  }
61  }
global $ilCtrl
Definition: ilias.php:18

◆ getHTML()

ilNavigationHistoryGUI::getHTML ( )

Get HTML for navigation history.

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

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

67  {
68  $ilNavigationHistory = $this->nav_history;
69  $lng = $this->lng;
70 
71  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
72  $selection = new ilAdvancedSelectionListGUI();
73  $selection->setFormSelectMode(
74  "url_ref_id",
75  "ilNavHistorySelect",
76  true,
77  "goto.php?target=navi_request",
78  "ilNavHistory",
79  "ilNavHistoryForm",
80  "_top",
81  $lng->txt("go"),
82  "ilNavHistorySubmit"
83  );
84  $selection->setListTitle($lng->txt("last_visited"));
85  $selection->setId("lastvisited");
86  $selection->setSelectionHeaderClass("MMInactive");
87  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::NO_ICON);
88  $selection->setItemLinkClass("small");
89  $selection->setUseImages(true);
90  include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
91  $selection->setAccessKey(ilAccessKey::LAST_VISITED);
92 
93  $items = $ilNavigationHistory->getItems();
94  //$sel_arr = array(0 => "-- ".$lng->txt("last_visited")." --");
95  reset($items);
96  $cnt = 0;
97  foreach ($items as $k => $item) {
98  if ($cnt++ > 20) {
99  break;
100  }
101  if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) ||
102  $item["ref_id"] != $_GET["ref_id"] || $k > 0) { // do not list current item
103  $obj_id = ilObject::_lookupObjId($item["ref_id"]);
104  $selection->addItem(
105  $item["title"],
106  $item["ref_id"],
107  $item["link"],
108  ilObject::_getIcon($obj_id, "tiny", $item["type"]),
109  $lng->txt("obj_" . $item["type"]),
110  "_top"
111  );
112  }
113  }
114  $html = $selection->getHTML();
115 
116  if ($html == "") {
117  $selection->addItem(
118  $lng->txt("no_items"),
119  "",
120  "#",
121  "",
122  "",
123  "_top"
124  );
125  $selection->setUseImages(false);
126  $html = $selection->getHTML();
127  }
128  return $html;
129  }
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
$_GET["client_id"]
static _lookupObjId($a_id)
User interface class for advanced drop-down selection lists.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ handleNavigationRequest()

ilNavigationHistoryGUI::handleNavigationRequest ( )

Handle navigation request.

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

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

135  {
136  $ilNavigationHistory = $this->nav_history;
138 
139  if ($_GET["target"] == "navi_request") {
140  $items = $ilNavigationHistory->getItems();
141  foreach ($items as $item) {
142  if ($item["ref_id"] == $_POST["url_ref_id"]) {
143  ilUtil::redirect($item["link"]);
144  }
145  }
146  reset($items);
147  $item = current($items);
148  if ($_POST["url_ref_id"] == 0 && $item["ref_id"] == $_GET["ref_id"]) {
149  $item = next($items); // omit current item
150  }
151  if ($_POST["url_ref_id"] == 0 && $item["link"] != "") {
152  ilUtil::redirect($item["link"]);
153  }
154 
155  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", "");
156  $ilCtrl->setParameterByClass("ilrepositorygui", "getlast", "true");
157  $ilCtrl->redirectByClass("ilrepositorygui", "frameset");
158  }
159  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static redirect($a_script)
$_POST["username"]
+ Here is the call graph for this function:

◆ removeEntries()

ilNavigationHistoryGUI::removeEntries ( )

Remove all entries form list.

Parameters

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

References $nav_history.

168  {
169  $ilNavigationHistory = $this->nav_history;
170 
171  $ilNavigationHistory->deleteDBEntries();
172  $ilNavigationHistory->deleteSessionEntries();
173  }

Field Documentation

◆ $ctrl

ilNavigationHistoryGUI::$ctrl
protected

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

Referenced by executeCommand(), and handleNavigationRequest().

◆ $items

ilNavigationHistoryGUI::$items
private

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

Referenced by getHTML(), and handleNavigationRequest().

◆ $lng

ilNavigationHistoryGUI::$lng
protected

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

Referenced by getHTML().

◆ $nav_history

ilNavigationHistoryGUI::$nav_history
protected

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