本文整理汇总了PHP中Language::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getLanguage方法的具体用法?PHP Language::getLanguage怎么用?PHP Language::getLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Language
的用法示例。
在下文中一共展示了Language::getLanguage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLanguage
/**
* Test the Language class.
*
* @return void
* @access public
*/
public function testLanguage()
{
$l = new Language();
$this->assertEquals($l->getLanguage('eng'), 'English');
$this->assertEquals($l->getLanguage('??'), 'Unknown');
$this->assertEquals($l->getCode('English'), 'eng');
$this->assertEquals($l->getCode('???'), false);
}
示例2: getListByParameters
/**
* override method: get list image from articles.
*/
function getListByParameters($params, $pparams)
{
global $smarty, $cookie;
$numberOFAr = $params->get("custom-num", 5);
$list = array();
$id_lang = $cookie->id_lang;
$curLang = Language::getLanguage(intval($cookie->id_lang));
$lofiso_code = $curLang["iso_code"];
for ($i = 1; $i <= $numberOFAr; $i++) {
$index = $i - 1;
$name = 'gci_' . $id_lang . "-" . $i;
$list[$index]["name"] = $params->get($name . "-title", "");
//if($params->get($id_lang."-".$i."-type",""))
$list[$index]["classicon"] = "lof-" . $params->get($name . "-type", "") . " " . "lof-" . $params->get($name . "-type", "") . $lofiso_code;
$list[$index]["link"] = $params->get($name . "-link", "");
$list[$index]["price"] = $params->get($name . "-price", "");
$list[$index]["image"] = $params->get($name . "-image", "");
$list[$index]["mainImge"] = $list[$index]["image"];
$list[$index]["thumbImge"] = $list[$index]["image"];
if ($list[$index]["thumbImge"]) {
if ($params->get("cre_thumb", 1)) {
$list[$index] = $this->generateImages($list[$index], $params);
}
}
$list[$index]["description"] = $params->get($name . "-desc", "");
if ($list[$index]["name"] != "") {
$list[$index]["name"] = $list[$index]["name"];
}
if ($list[$index]['link']) {
$list[$index]['link'] = $this->addhttp($list[$index]['link']);
$list[$index]['description'] = $list[$index]['description'] . "<a href='" . $list[$index]['link'] . "' title='" . $list[$index]['title'] . "' >" . $params->get('readmore_txt', '[More...]') . "</a>";
}
}
return $list;
}
示例3: getContent
public function getContent()
{
$output = '<h2>' . $this->displayName . '</h2>';
if (Tools::isSubmit('submit' . $this->name)) {
foreach ($this->custom_attributes as $i => $value) {
Configuration::updateValue($value, Tools::getValue($value));
}
$output .= $this->displayConfirmation($this->l('Settings updated'));
}
$output .= $this->renderForm();
$shop_url = (Configuration::get('PS_SSL_ENABLED') ? _PS_BASE_URL_SSL_ : _PS_BASE_URL_) . __PS_BASE_URI__;
$default_lang_name = Language::getLanguage($this->id_lang);
$default_lang_name = $default_lang_name['name'];
$output .= '
<fieldset class="space">
<legend><img src="../img/admin/unknown.gif" alt="" class="middle" />' . $this->l('Help') . '</legend>
<h2>' . $this->l('Registration') . '</h2>
<p>' . $this->l('Register your price list on site') . '
<a class="action_module" href="http://partner.market.yandex.ru/">http://partner.market.yandex.ru</a><br/><br/>
' . $this->l('Use the following address as a price list address') . ':<br/>
<div>
<a style="padding: 5px; border: 1px solid;" class="action_module" href="' . $shop_url . 'modules/yamarketdealers/">' . $shop_url . 'modules/yamarketdealers/</a>
</div>
</p>
<h2>' . $this->l('Miscellaneous') . '</h2>
<p>' . $this->l('When filling the attribute name fields, it is necessary to use default shop language') . '.
' . $this->l('Current default shop language: ') . $default_lang_name . '</p>
<p class="warn">
' . $this->l('When using vendor.model offer type, make sure you have filled the manufacturer name field for all your products') . '.
</p>
</fieldset>';
return $output;
}
示例4: __construct
public function __construct(Language $language = null, $dbInstanceKey = null)
{
parent::__construct($dbInstanceKey);
if ($language === null) {
$shortName = false;
if (isset($_GET['language']) && $this->languageExists($_GET['language'])) {
$shortName = $_GET['language'];
} elseif (isset($_SESSION['language']) && $this->languageExists($_SESSION['language'])) {
$shortName = $_SESSION['language'];
} elseif (isset($_COOKIE['language']) && $this->languageExists($_COOKIE['language'])) {
$shortName = $_COOKIE['language'];
}
if ($shortName !== false) {
$language = Language::getLanguage($shortName);
} else {
$language = $this->getDefaultLanguage();
}
}
if ($language instanceof Language) {
$this->language = $language;
$this->setLanguage($language);
} else {
throw new InvalidArgumentException("Argument should be instanse of Language");
}
}
示例5: __construct
public function __construct($id = null, $id_lang = null, $id_shop = null)
{
parent::__construct($id, null, $id_shop);
if (!is_null($id_lang)) {
$this->id_lang = (int) (Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT');
}
if ($this->id) {
$this->associated_shops = $this->getAssociatedShops();
}
$this->image_dir = _PS_EMPLOYEE_IMG_DIR_;
}
示例6: __construct
public function __construct()
{
$this->name = 'themeconfigurator';
$this->tab = 'front_office_features';
$this->version = '0.3';
$this->bootstrap = true;
$this->secure_key = Tools::encrypt($this->name);
$this->default_language = Language::getLanguage(Configuration::get('PS_LANG_DEFAULT'));
$this->languages = Language::getLanguages();
$this->author = 'PrestaShop';
parent::__construct();
$this->displayName = $this->l('Theme configurator');
$this->description = $this->l('Configure the main elements of your theme.');
$this->module_path = _PS_MODULE_DIR_ . $this->name . '/';
$this->uploads_path = _PS_MODULE_DIR_ . $this->name . '/img/';
$this->admin_tpl_path = _PS_MODULE_DIR_ . $this->name . '/views/templates/admin/';
$this->hooks_tpl_path = _PS_MODULE_DIR_ . $this->name . '/views/templates/hooks/';
}
示例7: __construct
public function __construct($id = null, $id_lang = null)
{
parent::__construct($id);
if (!is_null($id_lang)) {
$this->id_lang = (int) (Language::getLanguage($id_lang) !== false) ? $id_lang : Configuration::get('PS_LANG_DEFAULT');
}
if ($this->id_customer) {
if (isset(Context::getContext()->customer) && Context::getContext()->customer->id == $this->id_customer) {
$customer = Context::getContext()->customer;
} else {
$customer = new Customer((int) $this->id_customer);
}
Cart::$_customer = $customer;
if ((!$this->secure_key || $this->secure_key == '-1') && $customer->secure_key) {
$this->secure_key = $customer->secure_key;
$this->save();
}
}
$this->setTaxCalculationMethod();
}
示例8: __construct
public function __construct()
{
$this->name = 'ptsthemepanel';
$this->tab = 'front_office_features';
$this->version = '1.6.0';
$this->bootstrap = true;
$this->secure_key = Tools::encrypt($this->name);
$this->default_language = Language::getLanguage(Configuration::get('PS_LANG_DEFAULT'));
$this->languages = Language::getLanguages();
$this->author = 'PrestaBrain';
parent::__construct();
$this->displayName = $this->l('PTS Theme Control Panel');
$this->description = $this->l('Configure the main elements of your theme.');
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
$this->module_path = _PS_MODULE_DIR_ . $this->name . '/';
$this->uploads_path = _PS_MODULE_DIR_ . $this->name . '/img/';
$this->admin_tpl_path = _PS_MODULE_DIR_ . $this->name . '/views/templates/admin/';
$this->hooks_tpl_path = _PS_MODULE_DIR_ . $this->name . '/views/templates/hooks/';
$this->theme_name = Context::getContext()->shop->getTheme();
$this->themes = $this->getThemes();
$this->is_showed = $this->isOwnTheme();
}
示例9: __construct
public function __construct()
{
$this->name = 'tmhtmlcontent';
// Defines module name
$this->tab = 'other';
// Defines module tab name/module category in the admin panel
$this->author = 'TemplateMonster';
// Defines module author
$this->version = '1.0';
// Defines module version
$this->secure_key = Tools::encrypt($this->name);
$this->_defaultLanguage = Language::getLanguage(Configuration::get('PS_LANG_DEFAULT'));
$this->_languages = Language::getLanguages();
parent::__construct();
$this->displayName = $this->l('TM HTML content');
$this->desctiption = $this->l('Module for HTML content with images and links.');
// Paths
$this->module_path = _PS_MODULE_DIR_ . $this->name . '/';
$this->uploads_path = _PS_MODULE_DIR_ . $this->name . '/images/';
$this->admin_tpl_path = _PS_MODULE_DIR_ . $this->name . '/views/templates/admin/';
$this->hooks_tpl_path = _PS_MODULE_DIR_ . $this->name . '/views/templates/hooks/';
}
示例10: update
/**
* Get cookie content
*/
public function update($nullValues = false)
{
if (isset($_COOKIE[$this->_name])) {
/* Decrypt cookie content */
$content = $this->_cipherTool->decrypt($_COOKIE[$this->_name]);
//printf("\$content = %s<br />", $content);
/* Get cookie checksum */
$tmpTab = explode('¤', $content);
array_pop($tmpTab);
$content_for_checksum = implode('¤', $tmpTab) . '¤';
$checksum = crc32($this->_salt . $content_for_checksum);
//printf("\$checksum = %s<br />", $checksum);
/* Unserialize cookie content */
$tmpTab = explode('¤', $content);
foreach ($tmpTab as $keyAndValue) {
$tmpTab2 = explode('|', $keyAndValue);
if (count($tmpTab2) == 2) {
$this->_content[$tmpTab2[0]] = $tmpTab2[1];
}
}
/* Blowfish fix */
if (isset($this->_content['checksum'])) {
$this->_content['checksum'] = (int) $this->_content['checksum'];
}
//printf("\$this->_content['checksum'] = %s<br />", $this->_content['checksum']);
//die();
/* Check if cookie has not been modified */
if (!isset($this->_content['checksum']) || $this->_content['checksum'] != $checksum) {
$this->logout();
}
if (!isset($this->_content['date_add'])) {
$this->_content['date_add'] = date('Y-m-d H:i:s');
}
} else {
$this->_content['date_add'] = date('Y-m-d H:i:s');
}
//checks if the language exists, if not choose the default language
if (!$this->_standalone && !Language::getLanguage((int) $this->id_lang)) {
$this->id_lang = Configuration::get('PS_LANG_DEFAULT');
// set detect_language to force going through Tools::setCookieLanguage to figure out browser lang
$this->detect_language = true;
}
}
示例11: supplyOrdersImportOne
protected function supplyOrdersImportOne($info, $force_ids, $current_line, $validateOnly = false)
{
// sets default values if needed
AdminImportController::setDefaultValues($info);
// if an id is set, instanciates a supply order with this id if possible
if (array_key_exists('id', $info) && (int) $info['id'] && SupplyOrder::exists((int) $info['id'])) {
$supply_order = new SupplyOrder((int) $info['id']);
} elseif (array_key_exists('reference', $info) && $info['reference'] && SupplyOrder::exists(pSQL($info['reference']))) {
$supply_order = SupplyOrder::getSupplyOrderByReference(pSQL($info['reference']));
} else {
// new supply order
$supply_order = new SupplyOrder();
}
// gets parameters
$id_supplier = (int) $info['id_supplier'];
$id_lang = (int) $info['id_lang'];
$id_warehouse = (int) $info['id_warehouse'];
$id_currency = (int) $info['id_currency'];
$reference = pSQL($info['reference']);
$date_delivery_expected = pSQL($info['date_delivery_expected']);
$discount_rate = (double) $info['discount_rate'];
$is_template = (bool) $info['is_template'];
$error = '';
// checks parameters
if (!Supplier::supplierExists($id_supplier)) {
$error = sprintf($this->l('Supplier ID (%d) is not valid (at line %d).'), $id_supplier, $current_line + 1);
}
if (!Language::getLanguage($id_lang)) {
$error = sprintf($this->l('Lang ID (%d) is not valid (at line %d).'), $id_lang, $current_line + 1);
}
if (!Warehouse::exists($id_warehouse)) {
$error = sprintf($this->l('Warehouse ID (%d) is not valid (at line %d).'), $id_warehouse, $current_line + 1);
}
if (!Currency::getCurrency($id_currency)) {
$error = sprintf($this->l('Currency ID (%d) is not valid (at line %d).'), $id_currency, $current_line + 1);
}
if (empty($supply_order->reference) && SupplyOrder::exists($reference)) {
$error = sprintf($this->l('Reference (%s) already exists (at line %d).'), $reference, $current_line + 1);
}
if (!empty($supply_order->reference) && ($supply_order->reference != $reference && SupplyOrder::exists($reference))) {
$error = sprintf($this->l('Reference (%s) already exists (at line %d).'), $reference, $current_line + 1);
}
if (!Validate::isDateFormat($date_delivery_expected)) {
$error = sprintf($this->l('Date format (%s) is not valid (at line %d). It should be: %s.'), $date_delivery_expected, $current_line + 1, $this->l('YYYY-MM-DD'));
} elseif (new DateTime($date_delivery_expected) <= new DateTime('yesterday')) {
$error = sprintf($this->l('Date (%s) cannot be in the past (at line %d). Format: %s.'), $date_delivery_expected, $current_line + 1, $this->l('YYYY-MM-DD'));
}
if ($discount_rate < 0 || $discount_rate > 100) {
$error = sprintf($this->l('Discount rate (%d) is not valid (at line %d). %s.'), $discount_rate, $current_line + 1, $this->l('Format: Between 0 and 100'));
}
if ($supply_order->id > 0 && !$supply_order->isEditable()) {
$error = sprintf($this->l('Supply Order (%d) is not editable (at line %d).'), $supply_order->id, $current_line + 1);
}
// if no errors, sets supply order
if (empty($error)) {
// adds parameters
$info['id_ref_currency'] = (int) Currency::getDefaultCurrency()->id;
$info['supplier_name'] = pSQL(Supplier::getNameById($id_supplier));
if ($supply_order->id > 0) {
$info['id_supply_order_state'] = (int) $supply_order->id_supply_order_state;
$info['id'] = (int) $supply_order->id;
} else {
$info['id_supply_order_state'] = 1;
}
// sets parameters
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order);
// updatesd($supply_order);
$res = false;
if ((int) $supply_order->id && ($supply_order->exists((int) $supply_order->id) || $supply_order->exists($supply_order->reference))) {
$res = $validateOnly || $supply_order->update();
} else {
$supply_order->force_id = (bool) $force_ids;
$res = $validateOnly || $supply_order->add();
}
// errors
if (!$res) {
$this->errors[] = sprintf($this->l('Supply Order could not be saved (at line %d).'), $current_line + 1);
}
} else {
$this->errors[] = $error;
}
}
示例12: display
public function display()
{
global $cookie;
$currency = Currency::getCurrency(Configuration::get('PS_CURRENCY_DEFAULT'));
$language = Language::getLanguage(intval($cookie->id_lang));
$iso = $language['iso_code'];
$dateBetween = ModuleGraph::getDateBetween();
$sales = self::getSales($dateBetween);
$carts = self::getCarts($dateBetween);
$records = self::getRecords($dateBetween);
echo '
<div style="float: left">';
$this->displayCalendar();
$this->displayMenu(false);
$this->displayEngines();
$this->displaySearch();
echo '
</div>
<div style="float: left; margin-left: 40px;">
<fieldset class="width3"><legend><img src="../img/admin/tab-stats.gif" /> ' . $this->l('Help') . '</legend>
<p>' . $this->l('Use the calendar on the left to select the time period.') . '</p>
<p>' . $this->l('All available statistic modules are displayed in the Navigation list beneath the calendar.') . '</p>
<p>' . $this->l('In the Settings sub-tab, you can also customize the Stats tab to fit your needs and resources, change the graph rendering engine, and adjust the database settings.') . '</p>
</fieldset>
<br /><br />
<fieldset class="width3"><legend><img src="../img/admin/___info-ca.gif" style="vertical-align: middle" /> ' . $this->l('Sales') . '</legend>
<table>
<tr><td style="font-weight: bold">' . $this->l('Total placed orders') . '</td><td style="padding-left: 20px">' . $sales['orders'] . '</td></tr>
<tr><td style="font-weight: bold">' . $this->l('Total products sold') . '</td><td style="padding-left: 20px">' . $sales['products'] . '</td></tr>
</table>
<table cellspacing="0" cellpadding="0" class="table space">
<tr>
<th style="width: 150px"></th>
<th style="width: 180px; text-align: center; font-weight: bold">' . $this->l('total paid with tax') . '</th>
<th style="width: 220px; text-align: center; font-weight: bold">' . $this->l('total products not incl. tax') . '</th>
</tr>
<tr>
<th style="font-weight: bold">' . $this->l('Sales turnover') . '</th>
<td align="right">' . Tools::displayPrice($sales['ttc'], $currency) . '</td>
<td align="right">' . Tools::displayPrice($sales['ht'], $currency) . '</td>
</tr>
<tr>
<th style="font-weight: bold">' . $this->l('Largest order') . '</th>
<td align="right">' . Tools::displayPrice($sales['maxttc'], $currency) . '</td>
<td align="right">' . Tools::displayPrice($sales['maxht'], $currency) . '</td>
</tr>
<tr>
<th style="font-weight: bold">' . $this->l('Smallest order') . '</th>
<td align="right">' . Tools::displayPrice($sales['minttc'], $currency) . '</td>
<td align="right">' . Tools::displayPrice($sales['minht'], $currency) . '</td>
</tr>
</table>
</fieldset>
<br /><br />
<fieldset class="width3"><legend><img src="../img/admin/products.gif" style="vertical-align: middle" /> ' . $this->l('Carts') . '</legend>
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th style="width: 150px"></th>
<th style="width: 180px; text-align: center; font-weight: bold">' . $this->l('Products total all tax inc.') . '</th>
</tr>
<tr>
<th style="font-weight: bold">' . $this->l('Average cart') . '</th>
<td align="right">' . Tools::displayPrice($carts['average'], $currency) . '</td>
</tr>
<tr>
<th style="font-weight: bold">' . $this->l('Largest cart') . '</th>
<td align="right">' . Tools::displayPrice($carts['highest'], $currency) . '</td>
</tr>
<tr>
<th style="font-weight: bold">' . $this->l('Smallest cart') . '</th>
<td align="right">' . Tools::displayPrice($carts['lowest'], $currency) . '</td>
</tr>
</table>
</fieldset>';
if (strtolower($cookie->stats_granularity) != 'd' and $records and is_array($records)) {
echo '
<br /><br />
<fieldset class="width3"><legend><img src="../img/admin/medal.png" style="vertical-align: middle" />' . $this->l('Records') . '</legend>
<table cellspacing="0" cellpadding="0" class="table">
<tr>
<th style="width: 150px"></th>
<th style="width: 100px; text-align: center; font-weight: bold">' . $this->l('date') . '</th>
<th style="width: 120px; text-align: center; font-weight: bold">' . $this->l('with tax') . '</th>
<th style="width: 180px; text-align: center; font-weight: bold">' . $this->l('only products not incl. tax') . '</th>
</tr>';
if (strtolower($cookie->stats_granularity) == 'y') {
echo '
<tr>
<th style="font-weight: bold">' . $this->l('Best month') . '</th>
<td align="right">' . $this->displayDate($records['bestmonth']['date'], $iso) . '</td>
<td align="right">' . Tools::displayPrice($records['bestmonth']['totalttc'], $currency) . '</td>
<td align="right">' . Tools::displayPrice($records['bestmonth']['totalht'], $currency) . '</td>
</tr>
<tr>
<th style="font-weight: bold">' . $this->l('Worst month') . '</th>
<td align="right">' . $this->displayDate($records['worstmonth']['date'], $iso) . '</td>
<td align="right">' . Tools::displayPrice($records['worstmonth']['totalttc'], $currency) . '</td>
<td align="right">' . Tools::displayPrice($records['worstmonth']['totalht'], $currency) . '</td>
</tr>';
}
//.........这里部分代码省略.........
示例13: __construct
/**
* Builds the object
*
* @param int|null $id If specified, loads and existing object from DB (optional).
* @param int|null $id_lang Required if object is multilingual (optional).
* @param int|null $id_shop ID shop for objects with multishop tables.
*
* @throws PrestaShopDatabaseException
* @throws PrestaShopException
*/
public function __construct($id = null, $id_lang = null, $id_shop = null)
{
$class_name = get_class($this);
if (!isset(ObjectModel::$loaded_classes[$class_name])) {
$this->def = ObjectModel::getDefinition($class_name);
$this->setDefinitionRetrocompatibility();
if (!Validate::isTableOrIdentifier($this->def['primary']) || !Validate::isTableOrIdentifier($this->def['table'])) {
throw new PrestaShopException('Identifier or table format not valid for class ' . $class_name);
}
ObjectModel::$loaded_classes[$class_name] = get_object_vars($this);
} else {
foreach (ObjectModel::$loaded_classes[$class_name] as $key => $value) {
$this->{$key} = $value;
}
}
if ($id_lang !== null) {
$this->id_lang = Language::getLanguage($id_lang) !== false ? $id_lang : Configuration::get('PS_LANG_DEFAULT');
}
if ($id_shop && $this->isMultishop()) {
$this->id_shop = (int) $id_shop;
$this->get_shop_from_context = false;
}
if ($this->isMultishop() && !$this->id_shop) {
$this->id_shop = Context::getContext()->shop->id;
}
if ($id) {
$entity_mapper = Adapter_ServiceLocator::get("Adapter_EntityMapper");
$entity_mapper->load($id, $id_lang, $this, $this->def, $this->id_shop, self::$cache_objects);
}
}
示例14: __construct
public function __construct()
{
// need to set this in constructor to allow translation
TSBuyerProtection::$payments_type = array('DIRECT_DEBIT' => $this->l('Direct debit'), 'CREDIT_CARD' => $this->l('Credit Card'), 'INVOICE' => $this->l('Invoice'), 'CASH_ON_DELIVERY' => $this->l('Cash on delivery'), 'PREPAYMENT' => $this->l('Prepayment'), 'CHEQUE' => $this->l('Cheque'), 'PAYBOX' => $this->l('Paybox'), 'PAYPAL' => $this->l('PayPal'), 'CASH_ON_PICKUP' => $this->l('Cash on pickup'), 'FINANCING' => $this->l('Financing'), 'LEASING' => $this->l('Leasing'), 'T_PAY' => $this->l('T-Pay'), 'CLICKANDBUY' => $this->l('Click&Buy'), 'GIROPAY' => $this->l('Giropay'), 'GOOGLE_CHECKOUT' => $this->l('Google Checkout'), 'SHOP_CARD' => $this->l('Online shop payment card'), 'DIRECT_E_BANKING' => $this->l('DIRECTebanking.com'), 'MONEYBOOKERS' => $this->l('moneybookers.com'), 'OTHER' => $this->l('Other method of payment'));
$this->tab_name = $this->l('Trusted Shops quality seal and buyer protection');
$this->site_url = Tools::htmlentitiesutf8('http://' . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__);
TSBPException::setTranslationObject($this);
if (!method_exists('Tools', 'jsonDecode') || !method_exists('Tools', 'jsonEncode')) {
$this->warnings[] = $this->l('Json functions must be implemented in your php version');
} else {
foreach ($this->available_languages as $iso => $lang) {
if ($lang === '') {
$this->available_languages[$iso] = Language::getLanguage(Language::getIdByIso($iso));
}
TSBuyerProtection::$CERTIFICATE[strtoupper($iso)] = (array) Tools::jsonDecode(Tools::htmlentitiesDecodeUTF8(Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'CERTIFICATE_' . strtoupper($iso))));
}
if (TSBuyerProtection::$SHOPSW === NULL) {
TSBuyerProtection::$SHOPSW = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'SHOPSW');
TSBuyerProtection::$ET_CID = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'ET_CID');
TSBuyerProtection::$ET_LID = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'ET_LID');
TSBuyerProtection::$DEFAULT_LANG = (int) Configuration::get('PS_LANG_DEFAULT');
TSBuyerProtection::$CAT_ID = (int) Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'CAT_ID');
TSBuyerProtection::$ENV_API = Configuration::get(TSBuyerProtection::PREFIX_TABLE . 'ENV_API');
}
}
}
示例15: view
/**
* view() - Метод рендеринга приложения,
* включает в шаблон объекты и отображает их
* @access public final
* @return application
*/
public final function view()
{
/**
* Импортирую параметры в шаблон
*/
$breadcrumbs = $this->__setBreadcrumbs($this->APPLICATION->GetCurPage());
/**
* Устанавливаю CSS стили для каталога
*/
$this->APPLICATION->SetAdditionalCSS($this->_CONFIG['CSS_PATH'] . '/autocat.css');
/**
* Устанавливаю JavaScript
*/
$this->APPLICATION->AddHeadScript($this->_CONFIG['JQUERY_PATH'] . '/jquery.min.js');
// подключаю jQuery Google
$this->APPLICATION->AddHeadScript($this->_CONFIG['JS_PATH'] . '/autocat.js');
// главный скрипт Init
/**
* Устанавливаю переменные в шаблон
*/
$this->_setobj('breadcrumbs', $breadcrumbs);
// загружаем крошки
$this->_setobj('config', $this->_CONFIG);
// загружаем конфигурации
//$this->_setobj('version', $this->__getVersion()); // информация о сервисе
if (empty($this->GET_data)) {
$this->APPLICATION->SetTitle(Language::getLanguage('TITLE'));
// заголовок по умолчанию
$marks = $this->_getManufacturers();
//DEBUG::deBug($marks);
$this->_setobj('marks', $marks);
// загружаем марки из Сессии
if ($this->_CONFIG['ENABLE_CACHE']) {
if (!$this->_CACHE->isCached()) {
/**
* Если страница не закэширована
* Если страницы разные, то будем их заменять
*/
$this->_CACHE->setCachePage($this->__templateBuffer());
// устанавливаем ее в кэш
} else {
/**
* Достаем из кэша
*/
$this->_CACHE->getCachePage();
}
} else {
$this->__includeTemplate($this->_TEMPLATE);
}
// подключаем шаблон
} else {
/**
* Если передаются $_GET параметры,
* то каталог подгружает следующие шаблоны
*/
//DEBUG::deBug($this->GET_data);
$this->_TEMPLATE = $this->GET_data['view'];
// присваиваю шаблону значение из GET
if (!empty($this->GET_data['manufacturer_id'])) {
/**
* Определяю по каким параметрам загружать страницу
*/
$this->_TITLE = ucwords($this->GET_data['manufacturer_id']);
// получаю TITLE
$this->_manuId = $this->_getManufacturerID($this->GET_data['manufacturer_id']);
// загружаю модели
$cars = (array) $this->_getModels($this->_manuId);
// ID производителя
try {
if (!isset($this->GET_data['model_id'])) {
/**
* 2ая страница (Загрузка моделей)
*/
if (!$this->_manuId) {
$this->_TITLE = ucwords(Language::getLanguage('CATEGORY_NOT_FOUND'));
// заголовок
$this->APPLICATION->SetTitle($this->_TITLE);
// устанавливаю заголовок
throw new Exception(Language::getLanguage('CATEGORY_NOT_FOUND'));
// выбрасываю исключение
}
} else {
if (isset($this->GET_data['parts_id'])) {
if (isset($this->GET_data['kit_id'])) {
if (isset($this->GET_data['prod_id'])) {
/**
* 6ая страница (Карточка товара)
*/
$article = explode("_", $this->GET_data['prod_id']);
// разбиваю URL
//Debug::deBug($this->_getDocument($article[1],$article[0]));
$cars = (array) $this->_getFlyCard($this->_getDocument((int) $article[1], (int) $article[0]));
// загружаю карточку товар
//Debug::deBug($cars);
//.........这里部分代码省略.........