function start() { global $lC_MessageStack, $lC_Language; if (SERVICE_DEBUG_CHECK_LOCALE == '1') { $setlocale = lc_setlocale(LC_TIME, explode(',', $lC_Language->getLocale())); if ($setlocale === false || $setlocale === null) { $lC_MessageStack->add('debug', 'Error: Locale does not exist: ' . $lC_Language->getLocale(), 'error'); } } if (SERVICE_DEBUG_CHECK_INSTALLATION_MODULE == '1' && file_exists(dirname($_SERVER['SCRIPT_FILENAME']) . '/install')) { $lC_MessageStack->add('debug', sprintf($lC_Language->get('warning_install_directory_exists'), dirname($_SERVER['SCRIPT_FILENAME']) . '/install'), 'warning'); } if (SERVICE_DEBUG_CHECK_CONFIGURATION == '1' && file_exists(dirname($_SERVER['SCRIPT_FILENAME']) . '/includes/config.php') && is_writeable(dirname($_SERVER['SCRIPT_FILENAME']) . '/includes/config.php')) { $lC_MessageStack->add('debug', sprintf($lC_Language->get('warning_config_file_writeable'), dirname($_SERVER['SCRIPT_FILENAME']) . '/includes/config.php'), 'warning'); } if (SERVICE_DEBUG_CHECK_SESSION_DIRECTORY == '1' && STORE_SESSIONS == '') { if (!is_dir($lC_Session->getSavePath())) { $lC_MessageStack->add('debug', sprintf($lC_Language->get('warning_session_directory_non_existent'), $lC_Session->getSavePath()), 'warning'); } elseif (!is_writeable($lC_Session->getSavePath())) { $lC_MessageStack->add('debug', sprintf($lC_Language->get('warning_session_directory_not_writeable'), $lC_Session->getSavePath()), 'warning'); } } if (SERVICE_DEBUG_CHECK_SESSION_AUTOSTART == '1' && (bool) ini_get('session.auto_start')) { $lC_MessageStack->add('debug', $lC_Language->get('warning_session_auto_start'), 'warning'); } if (SERVICE_DEBUG_CHECK_DOWNLOAD_DIRECTORY == '1' && DOWNLOAD_ENABLED == '1') { if (!is_dir(DIR_FS_DOWNLOAD)) { $lC_MessageStack->add('debug', sprintf($lC_Language->get('warning_download_directory_non_existent'), DIR_FS_DOWNLOAD), 'warning'); } } return true; }
function start() { global $lC_Language, $lC_Session, $lC_Vqmod; require $lC_Vqmod->modCheck('includes/classes/language.php'); $lC_Language = new lC_Language(); if (isset($_GET['language']) && !empty($_GET['language'])) { $lC_Language->set($_GET['language']); } $lC_Language->load('general'); $lC_Language->load('modules-boxes'); $lC_Language->load('modules-content'); header('Content-Type: text/html; charset=' . $lC_Language->getCharacterSet()); lc_setlocale(LC_TIME, explode(',', $lC_Language->getLocale())); return true; }
function setLocalization() { global $lC_Database, $lC_Currencies, $lC_Language, $lC_Session; //unset($_SESSION['localization']); if (isset($_SESSION['localization']['currency']) || isset($_SESSION['localization']['language'])) { return; } $_SESSION['localization'] = array(); $Qalt = $lC_Database->query('select * from :table_localization where alt_domain = :alt_domain'); $Qalt->bindTable(':table_localization', TABLE_LOCALIZATION); $Qalt->bindInt(':alt_domain', 1); $Qalt->execute(); while ($Qalt->next()) { $_SESSION['localization']['alt'][] = $Qalt->toArray(); } $Qalt->freeResult(); $Qlocal = $lC_Database->query('select * from :table_localization where domain = :domain limit 1'); $Qlocal->bindTable(':table_localization', TABLE_LOCALIZATION); $Qlocal->bindValue(':domain', $_SERVER['HTTP_HOST']); $Qlocal->execute(); if ($Qlocal->numberOfRows() > 0) { $_SESSION['currency'] = $lC_Currencies->getCode($Qlocal->valueInt('currencies_id')); $_SESSION['language'] = $lC_Language->getCodeFromID($Qlocal->valueInt('language_id')); $_SESSION['localization']['domain'] = $Qlocal->value('domain'); $_SESSION['localization']['alt_domain'] = $Qlocal->value('alt_domain'); $_SESSION['localization']['show_tax'] = $Qlocal->valueInt('show_tax'); $_SESSION['localization']['language'] = $lC_Language->getCodeFromID($Qlocal->valueInt('language_id')); $_SESSION['localization']['currency'] = $lC_Currencies->getCode($Qlocal->valueInt('currencies_id')); $_SESSION['localization']['default_tax_zone'] = $Qlocal->valueInt('default_tax_zone'); $_SESSION['localization']['base_price_modifier'] = $Qlocal->valueDecimal('base_price_modifier'); $_SESSION['localization']['session_id'] = $lC_Session->getID(); $_SESSION['localization']['session_name'] = $lC_Session->getName(); $lC_Language->set($_SESSION['localization']['language']); $lC_Language->load('general'); $lC_Language->load('modules-boxes'); $lC_Language->load('modules-content'); header('Content-Type: text/html; charset=' . $lC_Language->getCharacterSet()); lc_setlocale(LC_TIME, explode(',', $lC_Language->getLocale())); } $Qlocal->freeResult(); // overrides $no_tax_or = isset($_GET['no_tax']) && empty($_GET['no_tax']) === false ? $_GET['no_tax'] : false; if ($no_tax_or !== false) { $_SESSION['localization']['no_tax'] = $no_tax_or; } }
require $lC_Vqmod->modCheck('../includes/classes/xml.php'); require $lC_Vqmod->modCheck('../includes/classes/datetime.php'); // set the language require $lC_Vqmod->modCheck('includes/classes/language.php'); $lC_Language = new lC_Language_Admin(); // admin specific language if ($lC_Language->getAdminLanguage($_SESSION['admin']['id']) != 'en_US' || $lC_Language->getAdminLanguage($_SESSION['admin']['id']) != $_SESSION['admin']['language_id']) { $lC_Language->set($lC_Language->getAdminLanguage($_SESSION['admin']['id'])); } // language change detected via url $_GET if (isset($_GET['language']) && !empty($_GET['language'])) { $lC_Language->set($_GET['language']); } $lC_Language->loadIniFile(); //header('Content-Type: text/html; charset=' . $lC_Language->getCharacterSet()); lc_setlocale(LC_TIME, explode(',', $lC_Language->getLocale())); // define our localization functions require $lC_Vqmod->modCheck('includes/functions/localization.php'); // initialize the message stack for output messages require $lC_Vqmod->modCheck('includes/classes/message_stack.php'); $lC_MessageStack = new lC_MessageStack_Admin(); // entry/item info classes require $lC_Vqmod->modCheck('includes/classes/object_info.php'); // email class require $lC_Vqmod->modCheck('../includes/classes/mail.php'); // file uploading class require $lC_Vqmod->modCheck('../includes/classes/upload.php'); // api class require $lC_Vqmod->modCheck('includes/classes/api.php'); $lC_Api = new lC_Api(); // QR code class