当前位置: 首页>>代码示例>>PHP>>正文


PHP Language::getIsoById方法代码示例

本文整理汇总了PHP中Language::getIsoById方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::getIsoById方法的具体用法?PHP Language::getIsoById怎么用?PHP Language::getIsoById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Language的用法示例。


在下文中一共展示了Language::getIsoById方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     global $cookie;
     $lang = strtoupper(Language::getIsoById($cookie->id_lang));
     $this->className = 'Configuration';
     $this->table = 'configuration';
     /* Collect all font files and build array for combo box */
     $fontFiles = scandir(_PS_FPDF_PATH_ . 'font');
     $fontList = array();
     $arr = array();
     foreach ($fontFiles as $file) {
         if (substr($file, -4) == '.php' and $file != 'index.php') {
             $arr['mode'] = substr($file, 0, -4);
             $arr['name'] = substr($file, 0, -4);
             array_push($fontList, $arr);
         }
     }
     /* Collect all encoding map files and build array for combo box */
     $encodingFiles = scandir(_PS_FPDF_PATH_ . 'font/makefont');
     $encodingList = array();
     $arr = array();
     foreach ($encodingFiles as $file) {
         if (substr($file, -4) == '.map') {
             $arr['mode'] = substr($file, 0, -4);
             $arr['name'] = substr($file, 0, -4);
             array_push($encodingList, $arr);
         }
     }
     $this->_fieldsPDF = array('PS_PDF_ENCODING_' . $lang => array('title' => $this->l('Encoding:'), 'desc' => $this->l('Encoding for PDF invoice'), 'type' => 'select', 'cast' => 'strval', 'identifier' => 'mode', 'list' => $encodingList), 'PS_PDF_FONT_' . $lang => array('title' => $this->l('Font:'), 'desc' => $this->l('Font for PDF invoice'), 'type' => 'select', 'cast' => 'strval', 'identifier' => 'mode', 'list' => $fontList));
     parent::__construct();
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:31,代码来源:AdminPDF.php

示例2: getAuthorisation

 public function getAuthorisation()
 {
     global $cookie, $cart;
     // Getting cart informations
     $currency = new Currency(intval($cart->id_currency));
     if (!Validate::isLoadedObject($currency)) {
         $this->_logs[] = $this->l('Not a valid currency');
     }
     if (sizeof($this->_logs)) {
         return false;
     }
     // Making request
     $vars = '?fromPayPal=1';
     $returnURL = Tools::getHttpHost(true, true) . __PS_BASE_URI__ . 'modules/paypalapi/payment/submit.php' . $vars;
     $cancelURL = Tools::getHttpHost(true, true) . __PS_BASE_URI__ . 'order.php';
     $paymentAmount = floatval($cart->getOrderTotal());
     $currencyCodeType = strval($currency->iso_code);
     $paymentType = 'Sale';
     $request = '&Amt=' . urlencode($paymentAmount) . '&PAYMENTACTION=' . urlencode($paymentType) . '&ReturnUrl=' . urlencode($returnURL) . '&CANCELURL=' . urlencode($cancelURL) . '&CURRENCYCODE=' . urlencode($currencyCodeType) . '&NOSHIPPING=1';
     if ($this->_pp_integral) {
         $request .= '&SOLUTIONTYPE=Sole&LANDINGPAGE=Billing';
     } else {
         $request .= '&SOLUTIONTYPE=Mark&LANDINGPAGE=Login';
     }
     $request .= '&LOCALECODE=' . Language::getIsoById($cart->id_lang);
     if ($this->_header) {
         $request .= '&HDRIMG=' . urlencode($this->_header);
     }
     // Calling PayPal API
     include _PS_MODULE_DIR_ . 'paypalapi/api/paypallib.php';
     $ppAPI = new PaypalLib();
     $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'SetExpressCheckout', $request);
     $this->_logs = array_merge($this->_logs, $ppAPI->getLogs());
     return $result;
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:35,代码来源:paypalpayment.php

示例3: getContent

 /**
  * Returns the template's HTML content
  * @return string HTML content
  */
 public function getContent()
 {
     $country = new Country((int) $this->order->id_address_invoice);
     //		$invoice_address = new Address((int)$this->order->id_address_invoice);
     //		$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
     //		$formatted_delivery_address = '';
     //
     //		if ($this->order->id_address_delivery != $this->order->id_address_invoice)
     //		{
     //			$delivery_address = new Address((int)$this->order->id_address_delivery);
     //			$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
     //		}
     //
     //		$customer = new Customer((int)$this->order->id_customer);
     //
     //		$this->smarty->assign(array(
     //			'order' => $this->order,
     //			'order_details' => $this->order_invoice->getProducts(),
     //			'cart_rules' => $this->order->getCartRules($this->order_invoice->id),
     //			'delivery_address' => $formatted_delivery_address,
     //			'invoice_address' => $formatted_invoice_address,
     //			'tax_excluded_display' => Group::getPriceDisplayMethod($customer->id_default_group),
     //			'tax_tab' => $this->getTaxTabContent(),
     //			'customer' => $customer
     //		));
     //
     //		return $this->smarty->fetch($this->getTemplate('info'));
     $context = Context::getContext();
     $iso = Language::getIsoById(intval($context->language->id));
     return $this->smarty->fetch($this->getTemplateByCountry($iso));
 }
开发者ID:Gelikon,项目名称:gelikon,代码行数:35,代码来源:HTMLTemplateInfo.php

示例4: initContent

 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     parent::initContent();
     if (!$this->isTokenValid()) {
         die($this->module->l($this->module->displayName . ' Error: (invalid token)'));
     }
     $cart = $this->context->cart;
     $address = new Address((int) $cart->id_address_invoice);
     $customer = new Customer((int) $cart->id_customer);
     $currency = $this->context->currency;
     $country = new Country((int) $address->id_country);
     $lang = Language::getIsoById((int) $cart->id_lang);
     if (!Configuration::get('SOFORTBANKING_USER_ID')) {
         die($this->module->l($this->module->displayName . ' Error: (invalid or undefined userId)'));
     }
     if (!Configuration::get('SOFORTBANKING_PROJECT_ID')) {
         die($this->module->l($this->module->displayName . ' Error: (invalid or undefined projectId)'));
     }
     if (!Validate::isLoadedObject($address) || !Validate::isLoadedObject($customer) || !Validate::isLoadedObject($currency)) {
         die($this->module->l($this->module->displayName . ' Error: (invalid address or customer)'));
     }
     $parameters = array('user_id' => Configuration::get('SOFORTBANKING_USER_ID'), 'project_id' => Configuration::get('SOFORTBANKING_PROJECT_ID'), 'sender_holder' => '', '', '', 'sender_country_id' => $country->iso_code, 'amount' => number_format($cart->getOrderTotal(), 2, '.', ''), 'currency_id' => $currency->iso_code, 'reason_1' => time() . '-' . (int) $cart->id, 'reason_2' => $customer->firstname . ' ' . Tools::ucfirst(Tools::strtolower($customer->lastname)), 'user_variable_0' => $customer->secure_key, 'user_variable_1' => (int) $cart->id, 'user_variable_2' => '', 'user_variable_3' => '', 'user_variable_4' => '', 'user_variable_5' => '', 'project_password' => Configuration::get('SOFORTBANKING_PROJECT_PW'));
     $this->context->smarty->assign(array('this_path' => $this->module->getPathUri(), 'nbProducts' => $cart->nbProducts(), 'total' => $cart->getOrderTotal(), 'version' => _PS_VERSION_, 'hash' => sha1(implode('|', $parameters)), 'gateway' => 'https://www.sofortueberweisung.de/payment/start', 'cprotect' => Configuration::get('SOFORTBANKING_CPROTECT'), 'parameters' => $parameters, 'mod_lang' => $this->isSupportedLang()));
     $this->setTemplate(Configuration::get('SOFORTBANKING_REDIRECT') == 'Y' ? 'payment_redirect.tpl' : 'payment_execution.tpl');
 }
开发者ID:ventsiwad,项目名称:presta_addons,代码行数:29,代码来源:payment.php

示例5: smartyTranslate

function smartyTranslate($params, &$smarty)
{
    /*
     * Warning : 2 lines have been added to the Smarty class.
     * "public $currentTemplate = null;" into the class itself
     * "$this->currentTemplate = substr(basename($resource_name), 0, -4);" into the "display" method
     */
    global $_LANG, $_MODULES, $cookie, $_MODULE;
    if (!isset($params['js'])) {
        $params['js'] = 0;
    }
    if (!isset($params['mod'])) {
        $params['mod'] = false;
    }
    $msg = false;
    $string = str_replace('\'', '\\\'', $params['s']);
    $key = $smarty->currentTemplate . '_' . md5($string);
    if ($params['mod']) {
        if (file_exists(_PS_THEME_DIR_ . 'modules/' . $params['mod'] . '/' . Language::getIsoById($cookie->id_lang) . '.php')) {
            $translationsFile = _PS_THEME_DIR_ . 'modules/' . $params['mod'] . '/' . Language::getIsoById($cookie->id_lang) . '.php';
            $modKey = '<{' . $params['mod'] . '}' . _THEME_NAME_ . '>' . $key;
        } else {
            $translationsFile = _PS_MODULE_DIR_ . $params['mod'] . '/' . Language::getIsoById($cookie->id_lang) . '.php';
            $modKey = '<{' . $params['mod'] . '}prestashop>' . $key;
        }
        if (@(include_once $translationsFile)) {
            $_MODULES = array_merge($_MODULES, $_MODULE);
        }
        $msg = (is_array($_MODULES) and key_exists($modKey, $_MODULES)) ? $params['js'] ? addslashes($_MODULES[$modKey]) : stripslashes($_MODULES[$modKey]) : false;
    }
    if (!$msg) {
        $msg = (is_array($_LANG) and key_exists($key, $_LANG)) ? $params['js'] ? addslashes($_LANG[$key]) : stripslashes($_LANG[$key]) : $params['s'];
    }
    return $params['js'] ? $msg : Tools::htmlentitiesUTF8($msg);
}
开发者ID:sealence,项目名称:local,代码行数:35,代码来源:smarty.config.inc.php

示例6: process

 public function process()
 {
     if ($id_supplier = Tools::getValue('id_supplier')) {
         $this->supplier = new Supplier((int) $id_supplier, self::$cookie->id_lang);
         if (Validate::isLoadedObject($this->supplier) and $this->supplier->active) {
             $nbProducts = $this->supplier->getProducts($id_supplier, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
             $this->pagination((int) $nbProducts);
             self::$smarty->assign(array('nb_products' => $nbProducts, 'products' => $this->supplier->getProducts($id_supplier, (int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay), 'path' => $this->supplier->active ? Tools::safeOutput($this->supplier->name) : '', 'supplier' => $this->supplier));
         } else {
             header('HTTP/1.1 404 Not Found');
             header('Status: 404 Not Found');
             $this->errors[] = Tools::displayError('Supplier does not exist');
         }
     } else {
         if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
             $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true);
             $nbProducts = count($data);
             $this->pagination($nbProducts);
             $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true, $this->p, $this->n);
             $imgDir = _PS_MANU_IMG_DIR_;
             foreach ($data as &$item) {
                 $item['image'] = !file_exists($imgDir . '/' . $item['id_supplier'] . '-medium.jpg') ? Language::getIsoById((int) self::$cookie->id_lang) . '-default' : $item['id_supplier'];
             }
             self::$smarty->assign(array('pages_nb' => ceil($nbProducts / (int) $this->n), 'nbSuppliers' => $nbProducts, 'mediumSize' => Image::getSize('medium'), 'suppliers' => $data, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY')));
         } else {
             self::$smarty->assign('nbSuppliers', 0);
         }
     }
 }
开发者ID:hecbuma,项目名称:quali-fisioterapia,代码行数:29,代码来源:SupplierController.php

示例7: translate

 static function translate($params, &$smarty)
 {
     global $_LANG, $_MODULES, $cookie, $_MODULE;
     if (!isset($params['js'])) {
         $params['js'] = 0;
     }
     if (!isset($params['mod'])) {
         $params['mod'] = false;
     }
     $msg = FALSE;
     $string = str_replace('\'', '\\\'', $params['s']);
     if (!file_exists(_PS_MODULE_DIR_ . 'coremanager/lang/coremanager.' . $params['mod'] . '.lang.tpl')) {
         $key = $smarty->currentTemplate . '_' . md5($string);
     } else {
         $key = 'coremanager.' . $params['mod'] . '.lang_' . md5($string);
         $params['mod'] = 'coremanager';
     }
     if ($params['mod']) {
         if (file_exists(_PS_THEME_DIR_ . 'modules/' . $params['mod'] . '/' . Language::getIsoById($cookie->id_lang) . '.php')) {
             $translationsFile = _PS_THEME_DIR_ . 'modules/' . $params['mod'] . '/' . Language::getIsoById($cookie->id_lang) . '.php';
             $modKey = '<{' . $params['mod'] . '}' . _THEME_NAME_ . '>' . $key;
         } else {
             $translationsFile = _PS_MODULE_DIR_ . $params['mod'] . '/' . Language::getIsoById($cookie->id_lang) . '.php';
             $modKey = '<{' . $params['mod'] . '}prestashop>' . $key;
         }
         if (@(include_once $translationsFile)) {
             $_MODULES = array_merge($_MODULES, $_MODULE);
         }
         $msg = (is_array($_MODULES) and key_exists($modKey, $_MODULES)) ? $params['js'] ? addslashes($_MODULES[$modKey]) : stripslashes($_MODULES[$modKey]) : FALSE;
     }
     if (!$msg) {
         $msg = (is_array($_LANG) and key_exists($key, $_LANG)) ? $params['js'] ? addslashes($_LANG[$key]) : stripslashes($_LANG[$key]) : $params['s'];
     }
     return $params['js'] ? $msg : Tools::htmlentitiesUTF8($msg);
 }
开发者ID:Eximagen,项目名称:3m,代码行数:35,代码来源:procore.api.php

示例8: run

 public function run()
 {
     $this->init();
     $this->preProcess();
     global $cookie, $link;
     $id_product = Tools::getValue('id');
     $product = new Product($id_product, true, 1);
     $id_customer = (isset(self::$cookie->id_customer) and self::$cookie->id_customer) ? (int) self::$cookie->id_customer : 0;
     if ($id_customer) {
         $sql = "select id from ps_wishlist where id_customer = " . $id_customer . " and id_product = " . $product->id;
         $res = Db::getInstance()->ExecuteS($sql);
         if ($res) {
             self::$smarty->assign("in_wishlist", true);
         } else {
             self::$smarty->assign("in_wishlist", false);
         }
     } else {
         self::$smarty->assign("in_wishlist", false);
     }
     $idImage = $product->getCoverWs();
     if ($idImage) {
         $idImage = $productObj->id . '-' . $idImage;
     } else {
         $idImage = Language::getIsoById(1) . '-default';
     }
     $image_link = $link->getImageLink($productObj->link_rewrite, $idImage, 'thickbox');
     self::$smarty->assign('product', $product);
     self::$smarty->assign('imagelink', $image_link);
     self::$smarty->assign('productlink', $product->getLink());
     die(self::$smarty->display(_PS_THEME_DIR_ . 'quick-view.tpl'));
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:31,代码来源:QuickViewController.php

示例9: loadLocalisationPack

 public function loadLocalisationPack($file, $selection, $install_mode = false, $iso_localization_pack = null)
 {
     if (!($xml = @simplexml_load_string($file))) {
         return false;
     }
     libxml_clear_errors();
     $main_attributes = $xml->attributes();
     $this->name = (string) $main_attributes['name'];
     $this->version = (string) $main_attributes['version'];
     if ($iso_localization_pack) {
         $id_country = (int) Country::getByIso($iso_localization_pack);
         if ($id_country) {
             $country = new Country($id_country);
         }
         if (!$id_country || !Validate::isLoadedObject($country)) {
             $this->_errors[] = Tools::displayError(sprintf('Cannot load country : %1d', $id_country));
             return false;
         }
         if (!$country->active) {
             $country->active = 1;
             if (!$country->update()) {
                 $this->_errors[] = Tools::displayError(sprintf('Cannot enable the associated country: %1s', $country->name));
             }
         }
     }
     $res = true;
     if (empty($selection)) {
         $res &= $this->_installStates($xml);
         $res &= $this->_installTaxes($xml);
         $res &= $this->_installCurrencies($xml, $install_mode);
         $res &= $this->installConfiguration($xml);
         $res &= $this->installModules($xml);
         $res &= $this->updateDefaultGroupDisplayMethod($xml);
         if (($res || $install_mode) && isset($this->iso_code_lang)) {
             if (!($id_lang = (int) Language::getIdByIso($this->iso_code_lang, true))) {
                 $id_lang = 1;
             }
             if (!$install_mode) {
                 Configuration::updateValue('PS_LANG_DEFAULT', $id_lang);
             }
         } elseif (!isset($this->iso_code_lang) && $install_mode) {
             $id_lang = 1;
         }
         if (!Language::isInstalled(Language::getIsoById($id_lang))) {
             $res &= $this->_installLanguages($xml, $install_mode);
             $res &= $this->_installUnits($xml);
         }
         if ($install_mode && $res && isset($this->iso_currency)) {
             Cache::clean('Currency::getIdByIsoCode_*');
             $res &= Configuration::updateValue('PS_CURRENCY_DEFAULT', (int) Currency::getIdByIsoCode($this->iso_currency));
             Currency::refreshCurrencies();
         }
     } else {
         foreach ($selection as $selected) {
             // No need to specify the install_mode because if the selection mode is used, then it's not the install
             $res &= Validate::isLocalizationPackSelection($selected) ? $this->{'_install' . $selected}($xml) : false;
         }
     }
     return $res;
 }
开发者ID:prestanesia,项目名称:PrestaShop,代码行数:60,代码来源:LocalizationPack.php

示例10: getSubCategories

 public static function getSubCategories($id_lang, $active = true, $id_category = 2, $p = 0, $n = 6)
 {
     $sql_groups_where = '';
     $sql_groups_join = '';
     if (Group::isFeatureActive()) {
         $sql_groups_join = 'LEFT JOIN `' . _DB_PREFIX_ . 'category_group` cg ON (cg.`id_category` = c.`id_category`)';
         $groups = FrontController::getCurrentCustomerGroups();
         $sql_groups_where = 'AND cg.`id_group` ' . (count($groups) ? 'IN (' . pSQL(implode(',', $groups)) . ')' : '=' . (int) Group::getCurrent()->id);
     }
     $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
     SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description
     FROM `' . _DB_PREFIX_ . 'category` c
     ' . Shop::addSqlAssociation('category', 'c') . '
     LEFT JOIN `' . _DB_PREFIX_ . 'category_lang` cl ON (c.`id_category` = cl.`id_category` 
 		AND `id_lang` = ' . (int) $id_lang . ' ' . Shop::addSqlRestrictionOnLang('cl') . ')
     ' . $sql_groups_join . '
     WHERE `id_parent` = ' . (int) $id_category . '
     ' . ($active ? 'AND `active` = 1' : '') . '
     ' . $sql_groups_where . '
     GROUP BY c.`id_category`
     ORDER BY `level_depth` ASC, category_shop.`position` ASC
     LIMIT ' . (int) $p . ', ' . (int) $n);
     foreach ($result as &$row) {
         $row['id_image'] = Tools::file_exists_cache(_PS_CAT_IMG_DIR_ . $row['id_category'] . '.jpg') ? (int) $row['id_category'] : Language::getIsoById($id_lang) . '-default';
         $row['legend'] = 'no picture';
     }
     return $result;
 }
开发者ID:vuduykhuong1412,项目名称:GitHub,代码行数:28,代码来源:subcategories.php

示例11: getSettings

 public function getSettings($id_lang = false)
 {
     $settings = $this->index_settings;
     $attributes_to_index = array();
     $attributes_for_faceting = array();
     foreach ($this->index_settings['attributesToIndex'] as $attribute) {
         if ($id_lang === false) {
             foreach (Language::getLanguages() as $language) {
                 array_push($attributes_to_index, $attribute . "_" . $language['iso_code']);
             }
         } else {
             array_push($attributes_to_index, $attribute . "_" . Language::getIsoById($id_lang));
         }
     }
     foreach ($this->index_settings['attributesForFaceting'] as $attribute) {
         if ($id_lang === false) {
             foreach (Language::getLanguages() as $language) {
                 array_push($attributes_for_faceting, $attribute . "_" . $language['iso_code']);
             }
         } else {
             array_push($attributes_for_faceting, $attribute . "_" . Language::getIsoById($id_lang));
         }
     }
     $settings['attributesToIndex'] = $attributes_to_index;
     $settings['attributesForFaceting'] = $attributes_for_faceting;
     return $settings;
 }
开发者ID:matiasmenker,项目名称:algoliasearch-prestashop,代码行数:27,代码来源:AlgoliaSync.php

示例12: getList

 public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
 {
     parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
     $nb_items = count($this->_list);
     $this->tpl_list_vars['nb_items'] = $nb_items;
     if ($nb_items > 0) {
         for ($i = 0; $i < $nb_items; ++$i) {
             $item =& $this->_list[$i];
             $item['token'] = Tools::getAdminTokenLite($item['controller']);
         }
     }
     $currentLanguage = Language::getIsoById((int) $this->context->language->id);
     $urlEShop = URL_ESHOP_EN;
     $urlTechnicalSupport = URL_TECHNICAL_SUPPORT_EN;
     if ($currentLanguage == 'fr') {
         $urlEShop = URL_ESHOP_FR;
         $urlTechnicalSupport = URL_TECHNICAL_SUPPORT_FR;
     } elseif ($currentLanguage == 'es') {
         $urlTechnicalSupport = URL_TECHNICAL_SUPPORT_ES;
     } elseif ($currentLanguage == 'it') {
         $urlTechnicalSupport = URL_TECHNICAL_SUPPORT_IT;
     }
     $this->context->smarty->assign(array('token' => Tools::getValue('token'), 'urlEShop' => $urlEShop, 'urlTechnicalSupport' => $urlTechnicalSupport, 'licenceActive' => date('Y-m-d') > Configuration::get('ERP_WS_DATE_END') ? false : true));
     // Configuration CSS/JS
     if (version_compare(_PS_VERSION_, '1.6') == -1) {
         $this->context->controller->addCSS(_MODULE_DIR_ . '/erpillicopresta/css/bs3.css');
     }
     $this->context->controller->addCSS(_MODULE_DIR_ . '/erpillicopresta/css/adminerp.css');
     $this->context->controller->addJS(_MODULE_DIR_ . '/erpillicopresta/js/tools.js');
 }
开发者ID:prestamodule,项目名称:erpillicopresta,代码行数:30,代码来源:AdminERP.php

示例13: getLanguageLink

 /**
  * Create link after language change
  *
  * @param integer $id_lang Language ID
  * @return string link
  */
 public function getLanguageLink($id_lang)
 {
     if ($this->allow == 1) {
         return _PS_BASE_URL_ . __PS_BASE_URI__ . 'lang-' . Language::getIsoById($id_lang) . '/' . substr(preg_replace('#/lang-([a-z]{2})/#', '/', $_SERVER['REQUEST_URI']), strlen(__PS_BASE_URI__));
     } else {
         return $this->getUrlWith('id_lang', intval($id_lang));
     }
 }
开发者ID:redb,项目名称:prestashop,代码行数:14,代码来源:AdvLink.php

示例14: process

 public function process()
 {
     parent::process();
     //echo "vao day";die;
     if (self::$cookie->RoleID == 1) {
         Tools::redirect('hotelpage.php?mid=' . self::$cookie->HotelID);
     }
     $continentCode = Tools::getUserContinentCode(self::$cookie->CompanyID);
     $search_form = array();
     $search_form['CityId'] = 0;
     $search_form['AreaId'] = 0;
     if ((self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3) && self::$cookie->OldLoginUserName == NULL) {
         $search_form['CheckIn'] = date('Y-m-d', strtotime(date('Y-m-d') . " + 5 days"));
         $search_form['Nights'] = 1;
         $search_form['CheckOut'] = date('Y-m-d', strtotime($search_form['CheckIn'] . " + {$search_form['Nights']} days"));
     }
     $search_form['HotelClassId'] = 0;
     $search_form['HotelName'] = '';
     $search_form['ContinentCode'] = $continentCode;
     $roomtype_list = RoomPlan::getRoomTypeList();
     $roomtype_form_list = array();
     foreach ($roomtype_list as $roomtype) {
         $roomTypeId = $roomtype['RoomTypeId'];
         $roomtype_form_list[$roomTypeId] = 0;
     }
     $search_form['RoomTypeVals'] = $roomtype_form_list;
     self::$smarty->assign("roomTypeList", $roomtype_list);
     self::$smarty->assign("search_form", $search_form);
     self::$smarty->assign("classList", Tools::getAllHotelClasses());
     self::$smarty->assign("areaList", Tools::getJapanAreas());
     //get Hotel List and Promotion List
     $promotionList = Promotion::getHomePromotionList(Promotion::$TYPE_PROMOTION);
     self::$smarty->assign('homePromotionList', $promotionList);
     $eventList = Promotion::getHomePromotionList(Promotion::$TYPE_EVENT);
     self::$smarty->assign('homeEventList', $eventList);
     // Get Popular Hotel List
     $poList = HotelDetail::getPopularHotelList(3);
     // 東京・横浜 - 関東 areaid = 3
     $popularList = array();
     global $cookie;
     $iso = Language::getIsoById((int) $cookie->LanguageID);
     foreach ($poList as $popular) {
         $image = HotelDetail::getFirstFileOfHotel($popular['HotelId'], 150, 150);
         if (is_file(_TAS_ROOT_DIR_ . "/asset/" . $image['w5_path'])) {
             $popular['HotelFilePath'] = $image['w5_path'];
             $popular['w5'] = $image['w5'];
             $popular['h5'] = $image['h5'];
         }
         $popular['LowestPrice'] = HotelDetail::getLowestPriceOfHotel($popular['HotelId']);
         $popular['AreaName'] = HotelDetail::getAreaName($popular['HotelArea']);
         $HotelNameKey = 'HotelName_' . $iso;
         $popular['HotelName'] = $popular[$HotelNameKey];
         $popularList[] = $popular;
     }
     //self::$smarty->assign('homeAreaList', Db::getInstance()->ExecuteS("select *, AreaName_".$this->iso." as AreaName from HT_Area where AreaId in (3, 5, 8, 12)"));
     self::$smarty->assign('homeAreaList', Db::getInstance()->ExecuteS('select  *, AreaName_' . $this->iso . ' as AreaName from `HT_Area` where isPopular = 1'));
     self::$smarty->assign("popularList", $popularList);
 }
开发者ID:khuyennd,项目名称:dev-tasagent,代码行数:58,代码来源:IndexController.php

示例15: __construct

 public function __construct()
 {
     global $cookie;
     $lang = strtoupper(Language::getIsoById($cookie->id_lang));
     $this->className = 'Configuration';
     $this->table = 'configuration';
     $this->_fieldsLocalization = array('PS_WEIGHT_UNIT' => array('title' => $this->l('Weight unit:'), 'desc' => $this->l('The weight unit of your shop'), 'validation' => 'isWeightUnit', 'required' => true, 'type' => 'text'));
     parent::__construct();
 }
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:9,代码来源:AdminLocalization.php


注:本文中的Language::getIsoById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。