function __construct($src = null, $params = array()) { parent::__construct($src, $params); $this->o = new order(); $this->tstart = time() - $this->oneday; $this->tend = time(); $this->prev_month = strftime("%A, %d %B %Y", mktime(0, 0, 0, strftime("%m") - 1, 1, strftime("%Y"))); $this->now_date = strftime("%A, %d %B %Y"); $this->now_hour = strftime("%I"); $this->now_min = strftime("%M"); $this->now_ampm = strftime("%p"); }
function __construct($src = null, $params = array()) { global $db; parent::__construct($src, $params); // only set the system help version if it's not already set as a session variable if (!expSession::is_set('help-version')) { $version = $db->selectValue('help_version', 'version', 'is_current=1'); if (!empty($params['version'])) { $version = isset($params['version']) ? $params['version'] == 'current' ? $version : $params['version'] : $version; } expSession::set('help-version', $version); } $this->help_version = expSession::get('help-version'); }
function __construct($src = null, $params = array()) { global $db, $router, $section, $user; parent::__construct($src = null, $params); // we're setting the config here globably $this->grabConfig(); if (expTheme::inAction() && !empty($router->url_parts[1]) && ($router->url_parts[0] == "store" && $router->url_parts[1] == "showall")) { if (isset($router->url_parts[array_search('title', $router->url_parts) + 1]) && is_string($router->url_parts[array_search('title', $router->url_parts) + 1])) { $default_id = $db->selectValue('storeCategories', 'id', "sef_url='" . $router->url_parts[array_search('title', $router->url_parts) + 1] . "'"); $active = $db->selectValue('storeCategories', 'is_active', "sef_url='" . $router->url_parts[array_search('title', $router->url_parts) + 1] . "'"); if (empty($active) && $user->is_acting_admin != 1) { redirect_to(array("section" => SITE_DEFAULT_SECTION)); } expSession::set('catid', $default_id); } } elseif (expTheme::inAction() && !empty($router->url_parts[1]) && ($router->url_parts[0] == "store" && ($router->url_parts[1] == "show" || $router->url_parts[1] == "showByTitle"))) { if (isset($router->url_parts[array_search('id', $router->url_parts) + 1]) && $router->url_parts[array_search('id', $router->url_parts) + 1] != 0) { $default_id = $db->selectValue('product_storeCategories', 'storecategories_id', "product_id='" . $router->url_parts[array_search('id', $router->url_parts) + 1] . "'"); expSession::set('catid', $default_id); } else { $prod_id = $db->selectValue('product', 'id', "sef_url='" . $router->url_parts[array_search('title', $router->url_parts) + 1] . "'"); $default_id = $db->selectValue('product_storeCategories', 'storecategories_id', "product_id='" . $prod_id . "'"); expSession::set('catid', $default_id); } } elseif (isset($this->config['show_first_category']) || !expTheme::inAction() && $section == SITE_DEFAULT_SECTION) { if (!empty($this->config['show_first_category'])) { $default_id = $db->selectValue('storeCategories', 'id', 'lft=1'); } else { $default_id = 0; } expSession::set('catid', $default_id); } elseif (!isset($this->config['show_first_category']) && !expTheme::inAction()) { expSession::set('catid', 0); } else { $default_id = 0; } // figure out if we need to show all categories and products or default to showing the first category. // elseif (!empty($this->config['category'])) { // $default_id = $this->config['category']; // } elseif (ecomconfig::getConfig('show_first_category')) { // $default_id = $db->selectValue('storeCategories', 'id', 'lft=1'); // } else { // $default_id = 0; // } $this->parent = expSession::get('catid'); $this->category = new storeCategory($this->parent); // we're setting the config here for the category $this->grabConfig($this->category); }
function __construct($src = null, $params = array()) { global $user; parent::__construct($src, $params); $this->remove_permissions = $user->isLoggedIn() ? array('update', 'create') : array(); }
function __construct($src = null, $params = array()) { parent::__construct($src = null, $params); }