  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: template.php 1034 2006-10-21 18:02:38Z hpdl $ |
| |
| 3 | + | $Id: template.php 1102 2006-11-03 21:56:48Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
478 | 478 | | /** |
| |
479 | 479 | | * Sets the template to use |
| |
480 | 480 | | * |
  |
| 481 | + | * @param string $code The code of the template to use |
|
481 | 482 | | * @access public |
| |
482 | 483 | | */ |
| |
483 | 484 | | |
  |
484 | | - | function set() { |
| |
485 | | - | global $osC_Database; |
| |
| 485 | + | function set($code = null) { |
| |
| 486 | + | if ( (isset($_SESSION['template']) === false) || !empty($code) || (isset($_GET['template']) && !empty($_GET['template'])) ) { |
| |
| 487 | + | if ( !empty( $code ) ) { |
| |
| 488 | + | $set_template = $code; |
| |
| 489 | + | } else { |
| |
| 490 | + | $set_template = (isset($_GET['template']) && !empty($_GET['template'])) ? $_GET['template'] : DEFAULT_TEMPLATE; |
| |
| 491 | + | } |
|
486 | 492 | | |
  |
487 | | - | if ( (isset($_SESSION['template']) === false) || (isset($_GET['template']) && !empty($_GET['template'])) ) { |
| |
488 | | - | $set_template = (isset($_GET['template']) && !empty($_GET['template'])) ? $_GET['template'] : DEFAULT_TEMPLATE; |
| |
489 | | - | |
  |
490 | 493 | | $data = array(); |
| |
491 | 494 | | $data_default = array(); |
| |
492 | 495 | | |