navigation_history Class Reference

List of all members.

Public Member Functions

Static Public Member Functions

Public Attributes

Protected Member Functions

Static Protected Attributes

Static Private Member Functions

Static Private Attributes


Detailed Description

Definition at line 16 of file navigation_history.php.


Constructor & Destructor Documentation

navigation_history::__construct (  )  [protected]

Definition at line 35 of file navigation_history.php.

00035                                    {
00036     if (tep_session_is_registered('navigation')){
00037       $this->path = $_SESSION['navigation']->path;
00038       $this->snapshot =  $_SESSION['navigation']->snapshot;
00039     }
00040     else $this->reset();
00041   }


Member Function Documentation

navigation_history::add_current_page (  ) 

Definition at line 71 of file navigation_history.php.

00071                                      {
00072     global  $_GET, $_POST, $request_type, $cPath;
00073 
00074     $set = true;
00075     for ($i=0, $n=sizeof($this->path); $i<$n; $i++) {
00076       if ( ($this->path[$i]['page'] == self::cleanPage() ) ) {
00077         if (isset($cPath)) {
00078           if (!isset($this->path[$i]['get']['cPath'])) {
00079             continue;
00080           } else {
00081             if ($this->path[$i]['get']['cPath'] == $cPath) {
00082               array_splice($this->path, ($i+1));
00083               $set = false;
00084               break;
00085             } else {
00086               $old_cPath = explode('_', $this->path[$i]['get']['cPath']);
00087               $new_cPath = explode('_', $cPath);
00088 
00089               for ($j=0, $n2=sizeof($old_cPath); $j<$n2; $j++) {
00090                 if ($old_cPath[$j] != $new_cPath[$j]) {
00091                   array_splice($this->path, ($i));
00092                   $set = true;
00093                   break 2;
00094                 }
00095               }
00096             }
00097           }
00098         } else {
00099           array_splice($this->path, ($i));
00100           $set = true;
00101           break;
00102         }
00103       }
00104     }
00105 
00106     if ((bool)$set) {
00107       $this->path[] = array('page' => self::cleanPage(),
00108                             'mode' => $request_type,
00109                             'get' => $_GET,
00110                             'post' => $_POST);
00111     }
00112   }

static navigation_history::cleanPage (  )  [static, private]

clean current page

Definition at line 159 of file navigation_history.php.

00159                                       {
00160     return (!empty(self::$_Page)? self::$_Page : self::$_Page=preg_replace('#[?].+#i','',basename($_SERVER['REQUEST_URI'])) );
00161   }

navigation_history::clear_snapshot (  ) 

Definition at line 137 of file navigation_history.php.

00137                                    {
00138     $this->snapshot = array();
00139   }

navigation_history::get_snapshot (  ) 

call content snapshot

Definition at line 144 of file navigation_history.php.

00144                                 {
00145     return $this->snapshot;
00146   }

static navigation_history::getInstance (  )  [static]

Definition at line 43 of file navigation_history.php.

Referenced by shopping_cart_action::init(), and resetInstance().

00043                                        {
00044     if(self::$_instance == null) {
00045       self::$_instance = new self();
00046     }
00047     return self::$_instance;
00048   }

navigation_history::remove_current_page (  ) 

Definition at line 114 of file navigation_history.php.

00114                                         {
00115     $last_entry_position = sizeof($this->path) - 1;
00116     if ($this->path[$last_entry_position]['page'] == self::cleanPage() ) {
00117       unset($this->path[$last_entry_position]);
00118     }
00119   }

navigation_history::reset (  ) 

Definition at line 66 of file navigation_history.php.

Referenced by __construct(), and unserialize().

00066                           {
00067     $this->path = array();
00068     $this->snapshot = array();
00069   }

static navigation_history::resetInstance (  )  [static]

Definition at line 50 of file navigation_history.php.

00050                                          {
00051     self::$_instance = null;
00052     return self::getInstance();
00053   }

$object navigation_history::set_close (  ) 

call by close session page.

save snapshot

Definition at line 59 of file navigation_history.php.

00059                              {
00060     if (tep_session_is_registered('navigation')){
00061       $_SESSION['navigation']->path=$this->path ;
00062       $_SESSION['navigation']->snapshot= $this->snapshot  ;
00063     }
00064   }

navigation_history::set_path_as_snapshot ( history = 0  ) 

Definition at line 148 of file navigation_history.php.

00148                                                      {
00149     $pos = (sizeof($this->path)-1-$history);
00150     $this->snapshot = array('page' => $this->path[$pos]['page'],
00151                             'mode' => $this->path[$pos]['mode'],
00152                             'get' => $this->path[$pos]['get'],
00153                             'post' => $this->path[$pos]['post']);
00154   }

navigation_history::set_snapshot ( page = ''  ) 

Definition at line 121 of file navigation_history.php.

00121                                            {
00122     global  $_GET, $_POST, $request_type;
00123 
00124     if (is_array($page)) {
00125       $this->snapshot = array('page' => $page['page'],
00126                               'mode' => $page['mode'],
00127                               'get' => $page['get'],
00128                               'post' => $page['post']);
00129     } else {
00130       $this->snapshot = array('page' => self::cleanPage(),
00131                               'mode' => $request_type,
00132                               'get' => $_GET,
00133                               'post' => $_POST);
00134     }
00135   }

navigation_history::unserialize ( broken  ) 

Definition at line 164 of file navigation_history.php.

00164                                 {
00165     for(reset($broken);$kv=each($broken);) {
00166       $key=$kv['key'];
00167       if (gettype($this->$key)!="user function")
00168       $this->$key=$kv['value'];
00169     }
00170   }


Member Data Documentation

navigation_history::$_instance [static, protected]

Definition at line 28 of file navigation_history.php.

navigation_history::$_Page [static, private]

Definition at line 32 of file navigation_history.php.

navigation_history::$path

Definition at line 20 of file navigation_history.php.

navigation_history::$snapshot

Definition at line 24 of file navigation_history.php.


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