  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: navigation_history.php 153 2005-08-04 12:57:59Z hpdl $ |
| |
| 3 | + | $Id: navigation_history.php 196 2005-09-16 12:59:17Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
7 | 7 | | |
  |
8 | | - | Copyright (c) 2003 osCommerce |
| |
| 8 | + | Copyright (c) 2005 osCommerce |
|
9 | 9 | | |
| |
10 | 10 | | Released under the GNU General Public License |
| |
11 | 11 | | */ |
| |
12 | 12 | | |
| |
13 | 13 | | class navigationHistory { |
  |
14 | | - | var $path, $snapshot, $set_global; |
| |
| 14 | + | var $path, $snapshot; |
|
15 | 15 | | |
| |
16 | 16 | | function navigationHistory() { |
| |
17 | 17 | | $this->reset(); |
  |
18 | | - | |
| |
19 | | - | $this->setGlobal(); |
|
20 | 18 | | } |
| |
21 | 19 | | |
| |
22 | 20 | | function reset() { |
| |
|
|
 |
… |
|
25 | 23 | | } |
| |
26 | 24 | | |
| |
27 | 25 | | function add_current_page() { |
  |
28 | | - | if (PHP_VERSION < 4.1) { |
| |
29 | | - | global $_SERVER; |
| |
30 | | - | } |
| |
31 | | - | |
|
32 | 26 | | global $request_type, $cPath; |
| |
33 | 27 | | |
  |
34 | | - | if ($this->set_global) { |
| |
35 | | - | global $_GET, $_POST; |
| |
36 | | - | } |
| |
37 | | - | |
|
38 | 28 | | $set = 'true'; |
| |
39 | 29 | | for ($i=0, $n=sizeof($this->path); $i<$n; $i++) { |
| |
40 | 30 | | if ($this->path[$i]['page'] == basename($_SERVER['PHP_SELF'])) { |
| |
|
|
 |
… |
|
76 | 66 | | } |
| |
77 | 67 | | |
| |
78 | 68 | | function remove_current_page() { |
  |
79 | | - | if (PHP_VERSION < 4.1) { |
| |
80 | | - | global $_SERVER; |
| |
81 | | - | } |
| |
82 | | - | |
|
83 | 69 | | $last_entry_position = sizeof($this->path) - 1; |
| |
84 | 70 | | if ($this->path[$last_entry_position]['page'] == basename($_SERVER['PHP_SELF'])) { |
| |
85 | 71 | | unset($this->path[$last_entry_position]); |
| |
86 | 72 | | } |
| |
87 | 73 | | } |
| |
88 | 74 | | |
| |
89 | 75 | | function set_snapshot($page = '') { |
  |
90 | | - | if (PHP_VERSION < 4.1) { |
| |
91 | | - | global $_SERVER; |
| |
92 | | - | } |
| |
93 | | - | |
|
94 | 76 | | global $request_type; |
| |
95 | 77 | | |
  |
96 | | - | if ($this->set_global) { |
| |
97 | | - | global $_GET, $_POST; |
| |
98 | | - | } |
| |
99 | | - | |
|
100 | 78 | | if (is_array($page)) { |
| |
101 | 79 | | $this->snapshot = array('page' => $page['page'], |
| |
102 | 80 | | 'mode' => $page['mode'], |
| |
|
|
 |
… |
|
122 | 100 | | 'post' => $this->path[$pos]['post']); |
| |
123 | 101 | | } |
| |
124 | 102 | | |
  |
125 | | - | function setGlobal() { |
| |
126 | | - | $this->set_global = (PHP_VERSION < 4.1) ? true : false; |
| |
127 | | - | } |
| |
128 | | - | |
  |
129 | 103 | | function debug() { |
| |
130 | 104 | | global $osC_Session; |
| |
131 | 105 | | |