Changeset 42 for trunk/lib/PageSequence.inc.php
- Timestamp:
- Dec 18, 2005 12:16:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/PageSequence.inc.php
r41 r42 10 10 * @version 1.01 11 11 */ 12 12 13 13 require_once dirname(__FILE__) . '/Prefs.inc.php'; 14 14 … … 19 19 var $sequence_title = ''; 20 20 var $seq = '_sequence_'; 21 var $idle_timeout; 22 21 var $idle_timeout; 22 23 23 /** 24 24 * Constructor. Sets the title of this sequence and initializes session variables. … … 33 33 $this->seq .= $params['sequence_title']; 34 34 } 35 35 36 36 // How long before resetting session? 60 minutes. 37 37 $this->idle_timeout = isset($params['idle_timeout']) ? $params['idle_timeout'] : 3600; 38 38 39 39 // Where is user to be redirected after startOver function call? 40 40 $this->start_url = isset($params['start_url']) ? $params['start_url'] : $_SERVER['PHP_SELF']; 41 41 42 42 // Initialize vars if not set. 43 43 if (!isset($_SESSION[$this->seq]['steps'])) { … … 50 50 $_SESSION[$this->seq]['defaults'] = array(); 51 51 } 52 52 53 53 // Manage timeout. 54 54 $this->_auto_timeout(); 55 55 } 56 57 /** 58 * Create a new step at the end (or specified position) of the $steps array. 56 57 /** 58 * Create a new step at the end (or specified position) of the $steps array. 59 59 * 60 60 * @param string $step_id Uniqie identifyer for this step. … … 85 85 ); 86 86 } 87 87 88 88 /** 89 89 * Set the features of a step. Current step if step_id not specified. … … 123 123 } 124 124 } 125 125 126 126 /** 127 127 * Set the current step id. Which step are we on? … … 142 142 } 143 143 } 144 144 145 145 /** 146 146 * Get the current step id. … … 157 157 } 158 158 } 159 159 160 160 /** 161 161 * Get the current step number. … … 179 179 foreach ($_SESSION[$this->seq]['steps'] as $pos=>$step) { 180 180 if ($step['id'] == $step_id) { 181 return $pos; 181 return $pos; 182 182 } 183 183 } … … 186 186 } 187 187 } 188 188 189 189 /** 190 190 * Returns the ID of the step with required=true and completed=false 191 * and active=true that falls before specified step_id. 191 * and active=true that falls before specified step_id. 192 192 * 193 193 * @param string $curr_step_id ID or number of current step. … … 212 212 return $curr_step_id; 213 213 } 214 214 215 215 /** 216 216 * Returns the next step in the steps array or the first active required … … 235 235 return null; 236 236 } 237 237 238 238 /** 239 239 * To set a set as 'completed'. … … 246 246 $_SESSION[$this->seq]['steps'][$pos]['completed'] = true; 247 247 } 248 248 249 249 /** 250 250 * Prints the a link that returns to the form for a step. … … 262 262 } 263 263 } 264 264 265 265 /** 266 266 * Saves given $step_data (usually coming from $_POST) into $_SESSION … … 279 279 } 280 280 } 281 281 282 282 /** 283 283 * Returns the value saved in $_SESSION for a specific data key. … … 297 297 } 298 298 } 299 299 300 300 /** 301 301 * Deletes all data saved in $_SESSION. … … 330 330 } 331 331 } 332 332 333 333 /** 334 334 * Saves given array (usually coming from $_POST) into $_SESSION … … 341 341 $_SESSION[$this->seq]['data'] = array_merge($_SESSION[$this->seq]['data'], $step_data); 342 342 } 343 343 344 344 /** 345 345 * Reset all vars. … … 354 354 $_SESSION[$this->seq]['last_access_time'] = time(); 355 355 } 356 356 357 357 /** 358 358 * Template function to be extended with custom SQL code. … … 365 365 return false; 366 366 } 367 367 368 368 /** 369 369 * Template function to be extended with custom SQL code. … … 376 376 return false; 377 377 } 378 379 378 379 380 380 } // END CLASS 381 381
Note: See TracChangeset
for help on using the changeset viewer.