Exemplo n.º 1
0
 public static function execute()
 {
     $OSCOM_Language = Registry::get('Language');
     $module_files = array();
     $DLapps = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Application');
     $DLapps->setIncludeFiles(false);
     foreach ($DLapps->getFiles() as $file) {
         if (!in_array($file['name'], call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Controller', 'getGuestApplications'))) && file_exists($DLapps->getDirectory() . '/' . $file['name'] . '/Controller.php')) {
             $module_files[] = $file['name'];
         }
     }
     $modules = array();
     foreach ($module_files as $module) {
         $application_class = 'osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . $module . '\\Controller';
         if (class_exists($application_class)) {
             if ($module == OSCOM::getSiteApplication()) {
                 $OSCOM_Application = Registry::get('Application');
             } else {
                 Registry::get('Language')->loadIniFile($module . '.php');
                 $OSCOM_Application = new $application_class(false);
             }
             $modules[Access::getGroupTitle($OSCOM_Application->getGroup())][] = array('id' => $module, 'text' => $OSCOM_Application->getTitle(), 'icon' => $OSCOM_Application->getIcon());
         }
     }
     ksort($modules);
     return $modules;
 }
Exemplo n.º 2
0
 public static function initialize()
 {
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('PDO', PDO::initialize());
     foreach (OSCOM::callDB('Shop\\GetConfiguration', null, 'Site') as $param) {
         define($param['cfgKey'], $param['cfgValue']);
     }
     Registry::set('Session', Session::load('adminSid'));
     Registry::get('Session')->start();
     Registry::get('MessageStack')->loadFromSession();
     Registry::set('Language', new Language());
     if (!self::hasAccess(OSCOM::getSiteApplication())) {
         Registry::get('MessageStack')->add('header', 'No access.', 'error');
         OSCOM::redirect(OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()));
     }
     $application = 'osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::set('Template', new Template());
     Registry::get('Template')->setApplication(Registry::get('Application'));
     // HPDL move following checks elsewhere
     // check if a default currency is set
     if (!defined('DEFAULT_CURRENCY')) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_no_default_currency'), 'error');
     }
     // check if a default language is set
     if (!defined('DEFAULT_LANGUAGE')) {
         Registry::get('MessageStack')->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
     }
     if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_uploads_disabled'), 'warning');
     }
     // check if Work directories are writable
     $work_dirs = array();
     foreach (array('Cache', 'CoreUpdate', 'Database', 'Logs', 'Session', 'Temp') as $w) {
         if (!is_writable(OSCOM::BASE_DIRECTORY . 'Work/' . $w)) {
             $work_dirs[] = $w;
         }
     }
     if (!empty($work_dirs)) {
         Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_work_directories_not_writable'), OSCOM::BASE_DIRECTORY . 'Work/', implode(', ', $work_dirs)), 'error');
     }
     if (!OSCOM::configExists('time_zone', 'OSCOM')) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_time_zone_not_defined'), 'warning');
     }
     if (!OSCOM::configExists('dir_fs_public', 'OSCOM') || !file_exists(OSCOM::getConfig('dir_fs_public', 'OSCOM'))) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_dir_fs_public_not_defined'), 'warning');
     }
     // check if the upload directory exists
     if (is_dir(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload')) {
         if (!is_writeable(OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload')) {
             Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_not_writable'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
         }
     } else {
         Registry::get('MessageStack')->add('header', sprintf(OSCOM::getDef('ms_error_upload_directory_non_existant'), OSCOM::getConfig('dir_fs_public', 'OSCOM') . 'upload'), 'error');
     }
 }
 public function __construct()
 {
     $this->initialize();
     if (isset($_GET['action']) && !empty($_GET['action'])) {
         $action = HTML::sanitize(basename($_GET['action']));
         if (class_exists('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Action\\' . $action)) {
             call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Action\\' . $action, 'execute'), $this);
         }
     }
 }
Exemplo n.º 4
0
 public static function initialize()
 {
     Registry::set('Language', new Language());
     Registry::set('osC_Language', Registry::get('Language'));
     // HPDL to remove
     if (!self::hasAccess(OSCOM::getSiteApplication())) {
         OSCOM::redirect(OSCOM::getLink(null, 'Offline'));
     }
     $application = 'osCommerce\\OM\\Core\\Site\\Setup\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::set('Template', new Template());
     Registry::get('Template')->setApplication(Registry::get('Application'));
 }
Exemplo n.º 5
0
 function __construct($group)
 {
     $OSCOM_Cache = Registry::get('Cache');
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_PDO = Registry::get('PDO');
     $this->_group = $group;
     if ($OSCOM_Cache->read('templates_' . $this->_group . '_layout-' . $OSCOM_Template->getCode() . '-' . OSCOM::getSiteApplication() . '-' . $OSCOM_Template->getPageContentsFilename())) {
         $data = $OSCOM_Cache->getCache();
     } else {
         $data = array();
         $Qspecific = $OSCOM_PDO->prepare('select b2p.boxes_group, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.page_specific = 1 and b2p.content_page in ("*", "' . OSCOM::getSiteApplication() . '/*", "' . OSCOM::getSiteApplication() . '/' . substr($OSCOM_Template->getPageContentsFilename(), 0, strrpos($OSCOM_Template->getPageContentsFilename(), '.')) . '") and b2p.templates_boxes_id = b.id and b.modules_group = :modules_group and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
         $Qspecific->bindInt(':templates_id', $OSCOM_Template->getID());
         $Qspecific->bindValue(':modules_group', $this->_group);
         $Qspecific->execute();
         $result = $Qspecific->fetchAll();
         if (count($result) > 0) {
             foreach ($result as $r) {
                 $data[$r['boxes_group']][] = $r['code'];
             }
         } else {
             $_data = array();
             $Qmodules = $OSCOM_PDO->prepare('select b2p.boxes_group, b2p.content_page, b.code from :table_templates_boxes_to_pages b2p, :table_templates_boxes b, :table_templates t where b2p.templates_id = :templates_id and b2p.content_page in ("*", "' . OSCOM::getSiteApplication() . '/*", "' . OSCOM::getSiteApplication() . '/' . substr($OSCOM_Template->getPageContentsFilename(), 0, strrpos($OSCOM_Template->getPageContentsFilename(), '.')) . '") and b2p.templates_boxes_id = b.id and b.modules_group = :modules_group and b2p.templates_id = t.id order by b2p.boxes_group, b2p.sort_order');
             $Qmodules->bindInt(':templates_id', $OSCOM_Template->getID());
             $Qmodules->bindValue(':modules_group', $this->_group);
             $Qmodules->execute();
             while ($Qmodules->fetch()) {
                 $_data[$Qmodules->value('boxes_group')][] = array('code' => $Qmodules->value('code'), 'page' => $Qmodules->value('content_page'));
             }
             foreach ($_data as $groups => $modules) {
                 $clean = array();
                 foreach ($modules as $module) {
                     if (isset($clean[$module['code']])) {
                         if (substr_count($module['page'], '/') > substr_count($clean[$module['code']]['page'], '/')) {
                             unset($clean[$module['code']]);
                         }
                     }
                     $clean[$module['code']] = $module;
                 }
                 $_data[$groups] = $clean;
             }
             foreach ($_data as $groups => $modules) {
                 foreach ($modules as $module) {
                     $data[$groups][] = $module['code'];
                 }
             }
         }
         $OSCOM_Cache->write($data);
     }
     $this->_modules = $data;
 }
Exemplo n.º 6
0
 public function loadIniFile($filename = null, $comment = '#', $language_code = null)
 {
     if (is_null($language_code)) {
         $language_code = $this->_code;
     }
     if ($this->_languages[$language_code]['parent_id'] > 0) {
         $this->loadIniFile($filename, $comment, $this->getCodeFromID($this->_languages[$language_code]['parent_id']));
     }
     if (is_null($filename)) {
         if (file_exists(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php')) {
             $contents = file(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php');
         } elseif (file_exists(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php')) {
             $contents = file(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '.php');
         } else {
             return array();
         }
     } else {
         if (substr(realpath(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename), 0, strlen(realpath(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code))) != realpath(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code)) {
             return array();
         }
         if (substr(realpath(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename), 0, strlen(realpath(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code))) != realpath(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSiteApplication() . '/languages/' . $language_code)) {
             return array();
         }
         if (file_exists(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename)) {
             $contents = file(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename);
         } elseif (file_exists(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename)) {
             $contents = file(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/languages/' . $language_code . '/' . $filename);
         } else {
             return array();
         }
     }
     $ini_array = array();
     foreach ($contents as $line) {
         $line = trim($line);
         $firstchar = substr($line, 0, 1);
         if (!empty($line) && $firstchar != $comment) {
             $delimiter = strpos($line, '=');
             if ($delimiter !== false && substr_count(substr($line, 0, $delimiter), ' ') == 1) {
                 $key = trim(substr($line, 0, $delimiter));
                 $value = trim(substr($line, $delimiter + 1));
                 $ini_array[$key] = $value;
             } elseif (isset($key)) {
                 $ini_array[$key] .= "\n" . trim($line);
             }
         }
     }
     unset($contents);
     $this->_definitions = array_merge($this->_definitions, $ini_array);
 }
Exemplo n.º 7
0
 public static function start()
 {
     Registry::set('Language', new LanguageClass());
     $OSCOM_Language = Registry::get('Language');
     if (isset($_GET['language']) && !empty($_GET['language'])) {
         $OSCOM_Language->set($_GET['language']);
     }
     $OSCOM_Language->load('general');
     $OSCOM_Language->load('modules-boxes');
     $OSCOM_Language->load('modules-content');
     $OSCOM_Language->load(OSCOM::getSiteApplication());
     header('Content-Type: text/html; charset=' . $OSCOM_Language->getCharacterSet());
     osc_setlocale(LC_TIME, explode(',', $OSCOM_Language->getLocale()));
     return true;
 }
Exemplo n.º 8
0
 public static function initialize()
 {
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('PDO', PDO::initialize());
     foreach (OSCOM::callDB('Shop\\GetConfiguration', null, 'Site') as $param) {
         define($param['cfgKey'], $param['cfgValue']);
     }
     Registry::set('Service', new Service());
     Registry::get('Service')->start();
     Registry::set('Template', new Template());
     $application = 'osCommerce\\OM\\Core\\Site\\Shop\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::get('Template')->setApplication(Registry::get('Application'));
 }
Exemplo n.º 9
0
 protected function initialize()
 {
     $OSCOM_Language = Registry::get('Language');
     $OSCOM_Session = Registry::get('Session');
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     $OSCOM_Language->load('products');
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 1) {
         $requested_product = basename(key(array_slice($_GET, 1, 1, true)));
         if ($requested_product == OSCOM::getSiteApplication()) {
             unset($requested_product);
             if (count($_GET) > 2) {
                 $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (!self::siteApplicationActionExists($requested_product)) {
             if (Product::checkEntry($requested_product)) {
                 $product_check = true;
                 Registry::set('Product', new Product($requested_product));
                 $OSCOM_Product = Registry::get('Product');
                 $OSCOM_Product->incrementCounter();
                 $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getTitle());
                 $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getModel());
                 if ($OSCOM_Product->hasTags()) {
                     $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getTags());
                 }
                 $OSCOM_Template->addJavascriptFilename(OSCOM::getPublicSiteLink('javascript/products/info.js'));
                 // HPDL            osC_Services_category_path::process($osC_Product->getCategoryID());
                 if ($OSCOM_Service->isStarted('Breadcrumb')) {
                     $OSCOM_Breadcrumb->add($OSCOM_Product->getTitle(), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
                 }
                 $this->_page_title = $OSCOM_Product->getTitle();
             }
         }
     }
     if ($product_check === false) {
         $this->_page_title = OSCOM::getDef('product_not_found_heading');
         $this->_page_contents = 'not_found.php';
     }
 }
Exemplo n.º 10
0
 public static function initialize()
 {
     define('OSCOM_BOOTSTRAP_FILE', 'index.php');
     define('HTTP_SERVER', '');
     define('HTTP_COOKIE_PATH', '');
     define('HTTP_COOKIE_DOMAIN', '');
     define('DIR_WS_HTTP_CATALOG', '');
     define('DIR_WS_IMAGES', '');
     define('DB_SERVER_PERSISTENT_CONNECTIONS', false);
     define('DIR_FS_WORK', OSCOM::BASE_DIRECTORY . 'work/');
     Registry::set('Language', new Language());
     Registry::set('osC_Language', Registry::get('Language'));
     // HPDL to remove
     $application = 'osCommerce\\OM\\Core\\Site\\Setup\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::set('Template', new Template());
     Registry::get('Template')->setApplication(Registry::get('Application'));
 }
Exemplo n.º 11
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Template = Registry::get('Template');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     // HPDL
     $OSCOM_Template->setHasHeader(false);
     $OSCOM_Template->setHasFooter(false);
     $OSCOM_Template->setHasBoxModules(false);
     $OSCOM_Template->setHasContentModules(false);
     $OSCOM_Template->setShowDebugMessages(false);
     $OSCOM_NavigationHistory->removeCurrentPage();
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == OSCOM::getSiteApplication()) {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (!$application->siteApplicationActionExists($requested_product)) {
             if (Product::checkEntry($requested_product)) {
                 $product_check = true;
                 Registry::set('Product', new Product($requested_product));
                 $OSCOM_Product = Registry::get('Product');
                 $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getTitle());
                 $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getModel());
                 if ($OSCOM_Product->hasTags()) {
                     $OSCOM_Template->addPageTags('keywords', $OSCOM_Product->getTags());
                 }
                 $application->setPageTitle($OSCOM_Product->getTitle());
                 $application->setPageContent('images.php');
             }
         }
     }
     if ($product_check === false) {
         $application->setPageTitle(OSCOM::getDef('product_not_found_heading'));
         $application->setPageContent('not_found.php');
     }
 }
Exemplo n.º 12
0
 public static function initialize()
 {
     OSCOM::loadConfig();
     if (strlen(DB_SERVER) < 1) {
         osc_redirect(OSCOM::getLink('Setup'));
     }
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('Database', Database::initialize());
     $Qcfg = Registry::get('Database')->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
     $Qcfg->setCache('configuration');
     $Qcfg->execute();
     while ($Qcfg->next()) {
         define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
     }
     $Qcfg->freeResult();
     Registry::set('Session', Session::load('adminSid'));
     Registry::get('Session')->start();
     Registry::get('MessageStack')->loadFromSession();
     Registry::set('Language', new Language());
     if (!self::hasAccess(OSCOM::getSiteApplication())) {
         Registry::get('MessageStack')->add('header', 'No access.', 'error');
         osc_redirect_admin(OSCOM::getLink(null, 'Index'));
     }
     $application = 'osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::set('Template', new Template());
     Registry::get('Template')->setApplication(Registry::get('Application'));
     // HPDL move following checks elsewhere
     // check if a default currency is set
     if (!defined('DEFAULT_CURRENCY')) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_no_default_currency'), 'error');
     }
     // check if a default language is set
     if (!defined('DEFAULT_LANGUAGE')) {
         Registry::get('MessageStack')->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
     }
     if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_uploads_disabled'), 'warning');
     }
 }
Exemplo n.º 13
0
 public function __construct()
 {
     $DLlang = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages');
     $DLlang->setIncludeDirectories(false);
     $DLlang->setCheckExtension('xml');
     foreach ($DLlang->getFiles() as $file) {
         $lang = XML::toArray(simplexml_load_file(OSCOM::BASE_DIRECTORY . 'Core/Site/Shop/Languages/' . $file['name']));
         if (!isset($lang['language'])) {
             // create root element (simpleXML does not use root element)
             $lang = array('language' => $lang);
         }
         $this->_languages[$lang['language']['data']['code']] = array('id' => 1, 'code' => $lang['language']['data']['code'], 'name' => $lang['language']['data']['title'], 'locale' => $lang['language']['data']['locale'], 'charset' => $lang['language']['data']['character_set'], 'date_format_short' => $lang['language']['data']['date_format_short'], 'date_format_long' => $lang['language']['data']['date_format_long'], 'time_format' => $lang['language']['data']['time_format'], 'text_direction' => $lang['language']['data']['text_direction'], 'parent_id' => 0);
     }
     unset($lang);
     $language = isset($_GET['language']) && !empty($_GET['language']) ? $_GET['language'] : '';
     $this->set($language);
     header('Content-Type: text/html; charset=' . $this->getCharacterSet());
     setlocale(LC_TIME, explode(',', $this->getLocale()));
     $this->loadIniFile();
     $this->loadIniFile(OSCOM::getSiteApplication() . '.php');
 }
Exemplo n.º 14
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if ($OSCOM_Service->isStarted('Reviews') === false) {
         osc_redirect(OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()));
     }
     $application->setPageTitle(OSCOM::getDef('reviews_heading'));
     $application->setPageContent('reviews.php');
     if ($OSCOM_Service->isStarted('Breadcrumb')) {
         $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_reviews'), OSCOM::getLink(null, null, 'Reviews'));
     }
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == OSCOM::getSiteApplication()) {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
             Registry::set('Product', new Product($requested_product));
             $OSCOM_Product = Registry::get('Product');
             $application->setPageTitle($OSCOM_Product->getTitle());
             $application->setPageContent('reviews_product.php');
             if ($OSCOM_Service->isStarted('Breadcrumb')) {
                 $OSCOM_Breadcrumb->add($OSCOM_Product->getTitle(), OSCOM::getLink(null, null, 'Reviews&' . $OSCOM_Product->getKeyword()));
             }
         }
         if ($product_check === false) {
             $application->setPageContent('not_found.php');
         }
     }
 }
Exemplo n.º 15
0
 public static function execute(ApplicationAbstract $application)
 {
     $OSCOM_Customer = Registry::get('Customer');
     $OSCOM_NavigationHistory = Registry::get('NavigationHistory');
     $OSCOM_Service = Registry::get('Service');
     $OSCOM_Breadcrumb = Registry::get('Breadcrumb');
     if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) {
         $OSCOM_NavigationHistory->setSnapshot();
         OSCOM::redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
     }
     $requested_product = null;
     $product_check = false;
     if (count($_GET) > 2) {
         $requested_product = basename(key(array_slice($_GET, 2, 1, true)));
         if ($requested_product == OSCOM::getSiteApplication()) {
             unset($requested_product);
             if (count($_GET) > 3) {
                 $requested_product = basename(key(array_slice($_GET, 3, 1, true)));
             }
         }
     }
     if (isset($requested_product)) {
         if (Product::checkEntry($requested_product)) {
             $product_check = true;
             Registry::set('Product', new Product($requested_product));
             $OSCOM_Product = Registry::get('Product');
             $application->setPageTitle($OSCOM_Product->getTitle());
             $application->setPageContent('tell_a_friend.php');
             if ($OSCOM_Service->isStarted('Breadcrumb')) {
                 $OSCOM_Breadcrumb->add($OSCOM_Product->getTitle(), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
                 $OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_tell_a_friend'), OSCOM::getLink(null, null, 'TellAFriend&' . $OSCOM_Product->getKeyword()));
             }
         }
         if ($product_check === false) {
             $application->setPageContent('not_found.php');
         }
     }
 }
Exemplo n.º 16
0
 public function get($group = null)
 {
     if (empty($group)) {
         $group = OSCOM::getSiteApplication();
     }
     $result = false;
     if ($this->exists($group)) {
         $data = array();
         foreach ($this->_data[$group] as $message) {
             $data['messageStack' . ucfirst($message['type'])][] = $message['text'];
         }
         $result = '';
         foreach ($data as $type => $messages) {
             $result .= '<div class="' . HTML::outputProtected($type) . '" onmouseover="$(this).find(\'span:first\').show();" onmouseout="$(this).find(\'span:first\').hide();"><span style="float: right; display: none;"><a href="#" onclick="$(this).parent().parent().slideFadeToggle();">' . HTML::icon('minimize.png', 'Hide') . '</a></span>';
             foreach ($messages as $message) {
                 $result .= '<p>' . HTML::outputProtected($message) . '</p>';
             }
             $result .= '</div>';
         }
         unset($this->_data[$group]);
     }
     return $result;
 }
Exemplo n.º 17
0
 public static function initialize()
 {
     if (strlen(DB_SERVER) < 1) {
         osc_redirect(OSCOM::getLink('Setup'));
     }
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('Database', Database::initialize());
     Registry::set('PDO', DatabasePDO::initialize());
     $Qcfg = Registry::get('Database')->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
     $Qcfg->setCache('configuration');
     $Qcfg->execute();
     while ($Qcfg->next()) {
         define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
     }
     $Qcfg->freeResult();
     Registry::set('Service', new Service());
     Registry::get('Service')->start();
     Registry::set('Template', new Template());
     $application = 'osCommerce\\OM\\Core\\Site\\Shop\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::get('Template')->setApplication(Registry::get('Application'));
 }
Exemplo n.º 18
0
 public static function initialize()
 {
     if (strlen(DB_SERVER) < 1) {
         osc_redirect(OSCOM::getLink('Setup'));
     }
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('Database', Database::initialize());
     Registry::set('PDO', DatabasePDO::initialize());
     foreach (OSCOM::callDB('Admin\\GetConfiguration', null, 'Site') as $param) {
         define($param['cfgKey'], $param['cfgValue']);
     }
     Registry::set('Session', Session::load('adminSid'));
     Registry::get('Session')->start();
     Registry::get('MessageStack')->loadFromSession();
     Registry::set('Language', new Language());
     if (!self::hasAccess(OSCOM::getSiteApplication())) {
         Registry::get('MessageStack')->add('header', 'No access.', 'error');
         osc_redirect_admin(OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()));
     }
     $application = 'osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::set('Template', new Template());
     Registry::get('Template')->setApplication(Registry::get('Application'));
     // HPDL move following checks elsewhere
     // check if a default currency is set
     if (!defined('DEFAULT_CURRENCY')) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_no_default_currency'), 'error');
     }
     // check if a default language is set
     if (!defined('DEFAULT_LANGUAGE')) {
         Registry::get('MessageStack')->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
     }
     if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_uploads_disabled'), 'warning');
     }
 }
Exemplo n.º 19
0
                wkn[key].n.show();
              }
            }
          } else {
            $('#shortcut-' + key + ' .notBubble').hide();
          }
        }
      });

      $.cookie('wkn', $.toJSON(wkn));
    });
  }

  $(document).ready(function() {
    updateShortcutNotifications(typeof resetShortcutNotification != 'undefined' ? '<?php 
    echo OSCOM::getSiteApplication();
    ?>
' : null);

    setInterval('updateShortcutNotifications()', 10000);
  });

  if (window.external.msIsSiteMode()) {

<?php 
    if (Access::hasShortcut()) {
        echo '    window.external.msSiteModeClearJumplist();' . "\n" . '    window.external.msSiteModeCreateJumplist("Shortcuts");' . "\n";
        foreach (Access::getShortcuts() as $shortcut) {
            echo '    window.external.msSiteModeAddJumpListItem("' . $shortcut['title'] . '", "' . OSCOM::getLink(null, $shortcut['module']) . '", "", "self");' . "\n";
        }
        echo '    window.external.msSiteModeShowJumplist();' . "\n";
Exemplo n.º 20
0
 /**
  * Get the number of messages belonging to a group
  *
  * @param string $group The name of the group to check
  * @since v3.0.0
  */
 public function size($group = null)
 {
     if (!isset($group)) {
         $group = OSCOM::getSiteApplication();
     }
     $size = 0;
     if ($this->exists($group)) {
         $size = count($this->_data[$group]);
     }
     return $size;
 }
Exemplo n.º 21
0
 public static function siteApplicationRPCExists($rpc)
 {
     return class_exists('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\' . $rpc);
 }
Exemplo n.º 22
0
            if ($OSCOM_Template->getCode() == DEFAULT_TEMPLATE) {
                include OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Module/Content/' . $OSCOM_ContentModule->getCode() . '/pages/main.php';
            } else {
                //HPDL old
                if (file_exists('templates/' . $osC_Template->getCode() . '/modules/content/' . $osC_Box->getCode() . '.php')) {
                    include 'templates/' . $osC_Template->getCode() . '/modules/content/' . $osC_Box->getCode() . '.php';
                } else {
                    include 'templates/' . DEFAULT_TEMPLATE . '/modules/content/' . $osC_Box->getCode() . '.php';
                }
            }
        }
        unset($OSCOM_ContentModule);
    }
}
if ($OSCOM_Template->getCode() == DEFAULT_TEMPLATE) {
    include OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Application/' . OSCOM::getSiteApplication() . '/pages/' . $OSCOM_Template->getPageContentsFilename();
} else {
    // HPDL old
    if (file_exists('templates/' . $osC_Template->getCode() . '/content/' . $osC_Template->getGroup() . '/' . $osC_Template->getPageContentsFilename())) {
        include 'templates/' . $osC_Template->getCode() . '/content/' . $osC_Template->getGroup() . '/' . $osC_Template->getPageContentsFilename();
    } else {
        include 'templates/' . DEFAULT_TEMPLATE . '/content/' . $osC_Template->getGroup() . '/' . $osC_Template->getPageContentsFilename();
    }
}
?>

<div style="clear: both;"></div>

<?php 
if ($OSCOM_Template->hasPageContentModules()) {
    foreach ($OSCOM_Service->getCallAfterPageContent() as $service) {
Exemplo n.º 23
0
    }
    echo '    </ul>' . '  </li>';
}
echo '  <li><a href="' . OSCOM::getLink('Shop', 'Index', null, 'NONSSL', false) . '" target="_blank">' . OSCOM::getDef('header_title_online_catalog') . '</a></li>' . '  <li><a href="http://www.oscommerce.com" target="_blank"><span class="ui-icon ui-icon-triangle-1-s" style="float: right;"></span>' . OSCOM::getDef('header_title_help') . '</a>' . '    <ul>' . '      <li><a href="http://www.oscommerce.com" target="_blank">osCommerce Support Site</a></li>' . '      <li><a href="http://www.oscommerce.info" target="_blank">Online Documentation</a></li>' . '      <li><a href="http://forums.oscommerce.com" target="_blank">Community Support Forums</a></li>' . '      <li><a href="http://addons.oscommerce.com" target="_blank">Add-Ons Site</a></li>' . '      <li><a href="http://svn.oscommerce.com/jira" target="_blank">Bug Reporter</a></li>' . '    </ul>' . '  </li>';
?>

  </ul>

<?php 
if (isset($_SESSION[OSCOM::getSite()]['id'])) {
    echo '<ul class="apps" style="float: right;">';
    if ($OSCOM_Application->canLinkTo()) {
        if (Access::isShortcut(OSCOM::getSiteApplication())) {
            echo '  <li class="shortcuts">' . osc_link_object(OSCOM::getLink(null, 'Index', 'RemoveShortcut&shortcut=' . OSCOM::getSiteApplication()), osc_icon('shortcut_remove.png')) . '</li>';
        } else {
            echo '  <li class="shortcuts">' . osc_link_object(OSCOM::getLink(null, 'Index', 'AddShortcut&shortcut=' . OSCOM::getSiteApplication()), osc_icon('shortcut_add.png')) . '</li>';
        }
    }
    if (Access::hasShortcut()) {
        echo '  <li class="shortcuts">';
        foreach (Access::getShortcuts() as $shortcut) {
            echo '<a href="' . OSCOM::getLink(null, $shortcut['module']) . '">' . $OSCOM_Template->getIcon(16, $shortcut['icon'], $shortcut['title']) . '</a>';
        }
        echo '  </li>';
    }
    echo '  <li><a href="#"><span class="ui-icon ui-icon-triangle-1-s" style="float: right;"></span>' . osc_output_string_protected($_SESSION[OSCOM::getSite()]['username']) . '</a>' . '    <ul>' . '      <li><a href="' . OSCOM::getLink(null, 'Login', 'Logoff') . '">' . OSCOM::getDef('header_title_logoff') . '</a></li>' . '    </ul>' . '  </li>' . '</ul>';
}
?>

</div>
Exemplo n.º 24
0
<link rel="stylesheet" type="text/css" href="public/external/fileuploader/fileuploader.css" />
<script src="public/external/fileuploader/fileuploader.min.js"></script>

<link rel="stylesheet" type="text/css" href="public/external/jquery/ui/themes/smoothness/jquery-ui-1.8.17.custom.css" />
<script type="text/javascript" src="public/external/jquery/ui/jquery-ui-1.8.17.custom.min.js"></script>

<script type="text/javascript" src="public/external/alexei/sprintf.js"></script>

<script type="text/javascript" src="<?php echo OSCOM::getPublicSiteLink('javascript/general.js'); ?>"></script>
<script type="text/javascript" src="<?php echo OSCOM::getPublicSiteLink('javascript/datatable.js'); ?>"></script>

<link rel="stylesheet" type="text/css" href="<?php echo OSCOM::getPublicSiteLink('templates/oscom/stylesheets/general.css'); ?>" />

<script type="text/javascript">
  var pageURL = '<?php echo OSCOM::getLink(); ?>';
  var pageModule = '<?php echo OSCOM::getSiteApplication(); ?>';

  var batchSize = parseInt('<?php echo MAX_DISPLAY_SEARCH_RESULTS; ?>');
  var batchTotalPagesText = '<?php echo addslashes(OSCOM::getDef('batch_results_number_of_entries')); ?>';
  var batchCurrentPageset = '<?php echo addslashes(OSCOM::getDef('result_set_current_page')); ?>';
  var batchIconNavigationBack = '<?php echo HTML::icon('nav_back.png'); ?>';
  var batchIconNavigationBackGrey = '<?php echo HTML::icon('nav_back_grey.png'); ?>';
  var batchIconNavigationForward = '<?php echo HTML::icon('nav_forward.png'); ?>';
  var batchIconNavigationForwardGrey = '<?php echo HTML::icon('nav_forward_grey.png'); ?>';
  var batchIconNavigationReload = '<?php echo HTML::icon('reload.png'); ?>';
  var batchIconProgress = '<?php echo HTML::icon('progress_ani.gif'); ?>';

  var taxDecimalPlaces = parseInt('<?php echo TAX_DECIMAL_PLACES; ?>');
</script>

<meta name="application-name" content="osCommerce Dashboard" />
Exemplo n.º 25
0
                }
              }
            } else {
              $('#shortcut-' + key + ' .notBubble').hide();
            }
          }
        });
      }

      $.cookie('wkn', $.toJSON(wkn));
    });
  }

  $(document).ready(function() {
    if ( totalShortcuts > 0 ) {
      updateShortcutNotifications(typeof resetShortcutNotification != 'undefined' ? '<?php echo OSCOM::getSiteApplication(); ?>' : null);

      setInterval('updateShortcutNotifications()', 10000);
    }
  });

  if ( (typeof window.external.msAddSiteMode != 'undefined') && window.external.msIsSiteMode() ) {

<?php
    if ( Access::hasShortcut() ) {
      echo '    window.external.msSiteModeClearJumplist();' . "\n" .
           '    window.external.msSiteModeCreateJumplist("Shortcuts");' . "\n";

      foreach ( Access::getShortcuts() as $shortcut ) {
        echo '    window.external.msSiteModeAddJumpListItem("' . $shortcut['title'] . '", "' . OSCOM::getLink(null, $shortcut['module']) . '", "", "self");' . "\n";
      }
 /**
  * @since v3.0.1
  */
 protected function siteApplicationActionExists($action)
 {
     return class_exists('osCommerce\\OM\\Core\\Site\\Shop\\Application\\' . OSCOM::getSiteApplication() . '\\Action\\' . $action);
 }
Exemplo n.º 27
0
 public function getPageContentsFile()
 {
     $file_location = OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Application/' . OSCOM::getSiteApplication() . '/pages/' . $this->getPageContentsFilename();
     if (file_exists(OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/Application/' . OSCOM::getSiteApplication() . '/pages/' . $this->getPageContentsFilename())) {
         $file_location = OSCOM::BASE_DIRECTORY . 'Custom/Site/' . OSCOM::getSite() . '/Application/' . OSCOM::getSiteApplication() . '/pages/' . $this->getPageContentsFilename();
     }
     return $file_location;
 }
Exemplo n.º 28
0
}
?>

<div id="appContent">

<?php 
if (Registry::get('MessageStack')->exists('header')) {
    echo Registry::get('MessageStack')->get('header');
}
require OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Application/' . OSCOM::getSiteApplication() . '/pages/' . $OSCOM_Template->getPageContentsFilename();
?>

</div>

<?php 
if (isset($_SESSION[OSCOM::getSite()]['id']) && !in_array(OSCOM::getSiteApplication(), array('Index', 'Login'))) {
    ?>

<script type="text/javascript">
  $('#appContent').css('marginLeft', '190px');
</script>

<?php 
}
if ($OSCOM_Template->hasPageFooter()) {
    ?>

<div id="footer">
  <?php 
    include OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/templates/oscom/footer.php';
    ?>