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


PHP Configuration::getGlobalValue方法代码示例

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


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

示例1: getGlobalValue

 public static function getGlobalValue($key, $id_lang = null)
 {
     ConfigurationKPI::setKpiDefinition();
     $r = parent::getGlobalValue($key, $id_lang);
     ConfigurationKPI::unsetKpiDefinition();
     return $r;
 }
开发者ID:prestanesia,项目名称:PrestaShop,代码行数:7,代码来源:ConfigurationKPI.php

示例2: testGetGlobalValue

 public function testGetGlobalValue()
 {
     $this->assertEquals('RESULT_NOT_OVERRIDDEN', Configuration::getGlobalValue('PS_TEST_NOT_OVERRIDDEN'));
     $this->assertEquals('RESULT_GROUP_OVERRIDDEN', Configuration::getGlobalValue('PS_TEST_GROUP_OVERRIDDEN'));
     $this->assertEquals('RESULT_SHOP_OVERRIDDEN', Configuration::getGlobalValue('PS_TEST_SHOP_OVERRIDDEN'));
     $this->assertEquals('RESULT_GROUP_SHOP_OVERRIDDEN', Configuration::getGlobalValue('PS_TEST_GROUP_SHOP_OVERRIDDEN'));
     $this->assertFalse(Configuration::getGlobalValue('PS_TEST_DOES_NOT_EXIST'));
 }
开发者ID:bravoman,项目名称:PrestaShop,代码行数:8,代码来源:ConfigurationCoreTest.php

示例3: __construct

 public function __construct()
 {
     if (Tools::getValue('token') != Configuration::getGlobalValue('CRONJOBS_EXECUTION_TOKEN')) {
         die('Invalid token');
     }
     parent::__construct();
     $this->postProcess();
     die;
 }
开发者ID:evgrishin,项目名称:mh16014,代码行数:9,代码来源:AdminCronJobsController.php

示例4: dirname

<?php

include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
include dirname(__FILE__) . '/pm_advancedsearch4.php';
if (php_sapi_name() != 'cli') {
    if (isset($_GET['secure_key'])) {
        $secureKey = version_compare(_PS_VERSION_, '1.5.0.0', '>=') ? Configuration::getGlobalValue('PM_AS4_SECURE_KEY') : Configuration::get('PM_AS4_SECURE_KEY');
        if (!empty($secureKey) and $secureKey === $_GET['secure_key']) {
            $PM_AdvancedSearch4 = new PM_AdvancedSearch4();
            $PM_AdvancedSearch4->cronTask();
            echo 'Reindexation done';
        }
    }
} else {
    $PM_AdvancedSearch4 = new PM_AdvancedSearch4();
    $PM_AdvancedSearch4->cronTask();
    echo 'Reindexation done via PHP Cli';
}
开发者ID:acreno,项目名称:pm-ps,代码行数:19,代码来源:cron.php

示例5: isFeatureActive

 /**
  * @return bool Return true if multishop feature is active and at last 2 shops have been created
  */
 public static function isFeatureActive()
 {
     static $feature_active = null;
     if ($feature_active === null) {
         $feature_active = Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') && Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'shop') > 1;
     }
     return $feature_active;
 }
开发者ID:gks-stage,项目名称:prestashop,代码行数:11,代码来源:Shop.php

示例6: getContent


//.........这里部分代码省略.........
			<div class="conf">' . $this->l('Settings saved successfully') . '</div>';
            } else {
                if (isset($_GET['deleteFilterTemplate'])) {
                    $layered_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
			SELECT filters 
			FROM ' . _DB_PREFIX_ . 'layered_filter 
			WHERE id_layered_filter = ' . (int) $_GET['id_layered_filter']);
                    if ($layered_values) {
                        Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'layered_filter WHERE id_layered_filter = ' . (int) $_GET['id_layered_filter'] . ' LIMIT 1');
                        $this->buildLayeredCategories();
                        $html .= '
				<div class="conf">' . $this->l('Filter template deleted, categories updated (reverted to default Filter template).') . '
				</div>';
                    } else {
                        $html .= '
				<div class="error">
					<img src="../img/admin/error.png" alt="" title="" /> ' . $this->l('Filter template not found') . '
				</div>';
                    }
                }
            }
        }
        $html .= '
		<div id="ajax-message-ok" class="conf ajax-message" style="display: none">
			<span class="message"></span>
		</div>
		<div id="ajax-message-ko" class="error ajax-message" style="display: none">
			<span class="message"></span>
		</div>
		<h2>' . $this->l('Layered navigation') . '</h2>
		<fieldset class="width4">
			<legend><img src="../img/admin/cog.gif" alt="" />' . $this->l('Indexes and caches') . '</legend>
			<span id="indexing-warning" style="display: none; color:red; font-weight: bold">' . $this->l('Indexing is in progress. Please do not leave this page') . '<br/><br/></span>';
        if (!Configuration::getGlobalValue('PS_LAYERED_INDEXED')) {
            $html .= '
			<script type="text/javascript">
			$(document).ready(function() {
				$(\'#url-indexer\').click();
				$(\'#full-index\').click();
			});
			</script>';
        }
        $category_ist = array();
        foreach (Db::getInstance()->executeS('SELECT id_category FROM `' . _DB_PREFIX_ . 'category`') as $category) {
            if ($category['id_category'] != 1) {
                $category_ist[] = $category['id_category'];
            }
        }
        $domain = Tools::getProtocol(Tools::usingSecureMode()) . $_SERVER['HTTP_HOST'];
        $html .= '
			<a class="bold ajaxcall-recurcive"
			style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"
			href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-price-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '">' . $this->l('Index all missing prices') . '</a>
			<br />
			<a class="bold ajaxcall-recurcive"
			style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="full-index"
			href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-price-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '&full=1">' . $this->l('Rebuild entire price index') . '</a>
			<br />
			<a class="bold ajaxcall" id="attribute-indexer" rel="attribute"
			style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="full-index"
			href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-attribute-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '">' . $this->l('Build attribute index') . '</a>
			<br />
			<a class="bold ajaxcall" id="url-indexer" rel="price"
			style="width: 250px; text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="full-index"
			href="' . $domain . __PS_BASE_URI__ . 'modules/blocklayered/blocklayered-url-indexer.php' . '?token=' . substr(Tools::encrypt('blocklayered/index'), 0, 10) . '&truncate=1">' . $this->l('Build URL index') . '</a>
			<br />
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:67,代码来源:blocklayered.php

示例7: getSpecialCatrgoryIdsArray

 public static function getSpecialCatrgoryIdsArray()
 {
     $wyuxmpthu = "specialIds";
     global $cookie;
     ${$wyuxmpthu} = array();
     if (Module::isInstalled("agilemembership")) {
         ${"GLOBALS"}["fmpcnwtupy"] = "specialIds";
         ${${"GLOBALS"}["fmpcnwtupy"]}[] = intval(Configuration::get("AGILE_MEMBERSHIP_CID"));
     }
     if (Module::isInstalled("agileprepaidcredit")) {
         ${${"GLOBALS"}["qgvsfxh"]}[] = intval(Configuration::getGlobalValue("AGILE_PCREDIT_CID"));
     }
     if (Module::isInstalled("agilesellerlistoptions")) {
         ${${"GLOBALS"}["qgvsfxh"]}[] = intval(Configuration::get("ASLO_CATEGORY_ID"));
     }
     return ${${"GLOBALS"}["qgvsfxh"]};
 }
开发者ID:sho5kubota,项目名称:guidingyou2,代码行数:17,代码来源:AgileMultipleSellerBase.php

示例8: getProducts

    public function getProducts($id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, $random = false, $randomNumberProducts = 1, $checkAccess = true, Context $context = null)
    {
        global $cookie;
        if (!$checkAccess or !$this->checkAccess($cookie->id_customer)) {
            return false;
        }
        if (!$context) {
            $context = Context::getContext();
        }
        $front = true;
        if (!in_array($context->controller->controller_type, array('front', 'modulefront'))) {
            $front = false;
        }
        if (Module::isInstalled('agilemembership') and $this->id == Configuration::get('AGILE_MEMBERSHIP_CID')) {
            return parent::getProducts($id_lang, $p, $n, $orderBy, $orderWay, $getTotal, $active, $random, $randomNumberProducts, $checkAccess);
        }
        if (Module::isInstalled('agileprepaidcredit') and $this->id == Configuration::getGlobalValue('AGILE_PCREDIT_CID')) {
            return parent::getProducts($id_lang, $p, $n, $orderBy, $orderWay, $getTotal, $active, $random, $randomNumberProducts, $checkAccess);
        }
        if (Module::isInstalled('agilesellerlistoptions') and $this->id == Configuration::get('ASLO_CATEGORY_ID')) {
            return parent::getProducts($id_lang, $p, $n, $orderBy, $orderWay, $getTotal, $active, $random, $randomNumberProducts, $checkAccess);
        }
        $agile_sql_parts = AgileSellerManager::getAdditionalSqlForProducts("p");
        if (empty($agile_sql_parts['selects']) and empty($agile_sql_parts['joins']) and empty($agile_sql_parts['wheres'])) {
            return parent::getProducts($id_lang, $p, $n, $orderBy, $orderWay, $getTotal, $active, $random, $randomNumberProducts, $checkAccess);
        }
        if (Module::isInstalled('agilesellerlistoptions')) {
            require_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
            if ($this->id <= 1 or $this->id == 2 or $this->id == (int) Configuration::get('PS_HOME_CATEGORY')) {
                return AgileSellerListOptions::get_home_products($id_lang, $p, $n);
            }
            if (empty($orderBy) || $orderBy == 'position') {
                $orderBy = 'position2';
            }
        }
        if ($p < 1) {
            $p = 1;
        }
        if (empty($orderBy)) {
            $orderBy = 'position';
        } else {
            $orderBy = strtolower($orderBy);
        }
        if (empty($orderWay)) {
            $orderWay = 'ASC';
        }
        if ($orderBy == 'id_product' or $orderBy == 'date_add' or $orderBy == 'date_upd') {
            $orderByPrefix = 'p';
        } elseif ($orderBy == 'name') {
            $orderByPrefix = 'pl';
        } elseif ($orderBy == 'manufacturer') {
            $orderByPrefix = 'm';
            $orderBy = 'name';
        } elseif ($orderBy == 'position') {
            $orderByPrefix = 'cp';
        }
        if ($orderBy == 'price') {
            $orderBy = 'orderprice';
        }
        if (!Validate::isBool($active) or !Validate::isOrderBy($orderBy) or !Validate::isOrderWay($orderWay)) {
            die(Tools::displayError());
        }
        $id_supplier = (int) Tools::getValue('id_supplier');
        if ($getTotal) {
            $sql = '
			SELECT COUNT(cp.`id_product`) AS total
			FROM `' . _DB_PREFIX_ . 'product` p
			' . Shop::addSqlAssociation('product', 'p') . '
			LEFT JOIN `' . _DB_PREFIX_ . 'category_product` cp ON p.`id_product` = cp.`id_product`
			    ' . $agile_sql_parts['joins'] . '
			WHERE cp.`id_category` = ' . (int) $this->id . ($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '') . ($active ? ' AND product_shop.`active` = 1' : '') . $agile_sql_parts['wheres'] . ($id_supplier ? 'AND p.id_supplier = ' . (int) $id_supplier : '');
            $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
            return isset($result) ? $result['total'] : 0;
        }
        $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, MAX(product_attribute_shop.id_product_attribute) id_product_attribute, product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, pl.`description`, pl.`description_short`, pl.`available_now`,
					pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, MAX(image_shop.`id_image`) id_image,
					il.`legend`, m.`name` AS manufacturer_name, cl.`name` AS category_default,
					DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),
					INTERVAL ' . (Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20) . '
						DAY)) > 0 AS new, product_shop.price AS orderprice
					' . $agile_sql_parts['selects'] . '	
				FROM `' . _DB_PREFIX_ . 'category_product` cp
				LEFT JOIN `' . _DB_PREFIX_ . 'product` p
					ON p.`id_product` = cp.`id_product`
				' . Shop::addSqlAssociation('product', 'p') . '
				LEFT JOIN `' . _DB_PREFIX_ . 'product_attribute` pa
				ON (p.`id_product` = pa.`id_product`)
				' . Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1') . '
				' . Product::sqlStock('p', 'product_attribute_shop', false, $context->shop) . '
				LEFT JOIN `' . _DB_PREFIX_ . 'category_lang` cl
					ON (product_shop.`id_category_default` = cl.`id_category`
					AND cl.`id_lang` = ' . (int) $id_lang . Shop::addSqlRestrictionOnLang('cl') . ')
				LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl
					ON (p.`id_product` = pl.`id_product`
					AND pl.`id_lang` = ' . (int) $id_lang . Shop::addSqlRestrictionOnLang('pl') . ')
				LEFT JOIN `' . _DB_PREFIX_ . 'image` i
					ON (i.`id_product` = p.`id_product`)' . Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1') . '
				LEFT JOIN `' . _DB_PREFIX_ . 'image_lang` il
					ON (image_shop.`id_image` = il.`id_image`
					AND il.`id_lang` = ' . (int) $id_lang . ')
//.........这里部分代码省略.........
开发者ID:evilscripts,项目名称:gy,代码行数:101,代码来源:Category.php

示例9: updateWebservice

 protected function updateWebservice($use_webservice)
 {
     $link = new Link();
     $admin_folder = $this->getAdminDir();
     $path = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . $admin_folder;
     $cron_url = $path . '/' . $link->getAdminLink('AdminCronJobs', false);
     $webservice_id = Configuration::get('CRONJOBS_WEBSERVICE_ID') ? '/' . Configuration::get('CRONJOBS_WEBSERVICE_ID') : null;
     $data = array('callback' => $link->getModuleLink($this->name, 'callback'), 'domain' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__, 'cronjob' => $cron_url . '&token=' . Configuration::getGlobalValue('CRONJOBS_EXECUTION_TOKEN'), 'cron_token' => Configuration::getGlobalValue('CRONJOBS_EXECUTION_TOKEN'), 'active' => (bool) $use_webservice);
     $context_options = array('http' => array('method' => is_null($webservice_id) == true ? 'POST' : 'PUT', 'content' => http_build_query($data)));
     $result = Tools::file_get_contents($this->webservice_url . $webservice_id, false, stream_context_create($context_options));
     if ($result != false) {
         Configuration::updateValue('CRONJOBS_WEBSERVICE_ID', (int) $result);
     }
     if ((Tools::isSubmit('install') == true || Tools::isSubmit('reset') == true) && (bool) $result == false) {
         return true;
     } elseif ((Tools::isSubmit('install') == false || Tools::isSubmit('reset') == false) && (bool) $result == false) {
         return $this->setErrorMessage('An error occurred while trying to contact PrestaShop\'s cron tasks webservice.');
     } elseif ($this->isLocalEnvironment() == true) {
         return true;
     }
     if ((bool) $use_webservice == true) {
         return $this->setSuccessMessage('Your cron tasks have been successfully added to PrestaShop\'s cron tasks webservice.');
     }
     return $this->setSuccessMessage('Your cron tasks have been successfully registered using the Advanced mode.');
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:25,代码来源:cronjobs.php

示例10: getExtraModulesConfiguration

 private function getExtraModulesConfiguration()
 {
     $c = Configuration::getGlobalValue('PP_INTEGRATION_EXTRA_MODULES');
     if (is_string($c)) {
         return Tools::jsonDecode($c, true);
     }
     return null;
 }
开发者ID:Oldwo1f,项目名称:yakaboutique,代码行数:8,代码来源:ppsetup.php

示例11: getPickupCentersBySellerId

    public static function getPickupCentersBySellerId($id_seller, $id_lang)
    {
        $id_carrier = (int) Configuration::getGlobalValue('AGILE_PICKUPCENTER_CARRIER_ID');
        $sql = 'Select l.id_location, l.id_carrier, c.name as carrier,l.location, l.active,l.address1,l.postcode,l.city,cl.name as country 
			from ' . _DB_PREFIX_ . 'location l ' . 'INNER JOIN ' . _DB_PREFIX_ . 'carrier c on c.id_carrier=l.id_carrier ' . 'LEFT JOIN ' . _DB_PREFIX_ . 'country_lang cl ON (l.id_country = cl.id_country AND cl.id_lang = ' . (int) $id_lang . ' ) WHERE l.deleted = 0  AND l.id_seller = ' . (int) $id_seller . ' AND l.id_carrier = ' . $id_carrier;
        return Db::getInstance()->executeS($sql);
    }
开发者ID:sho5kubota,项目名称:guidingyou2,代码行数:7,代码来源:AgileSellerManager.php

示例12: show_status

 public function show_status()
 {
     $table = new Cli\Table();
     $table->setHeaders(array('Key', 'Configuration', 'Value'));
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_SMARTY_CACHE', 'Smarty Template Cache');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SMARTY_CACHING_TYPE', 'Smarty Caching type', '1.6.0.11');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SMARTY_CONSOLE', 'Display smarty console (0 for never, 1 for URL, 2 for always)', '1.6.0.11');
     PS_CLI_Utils::add_configuration_value($table, 'PS_SMARTY_CONSOLE_KEY', 'Smarty console key', '1.6.0.11');
     $currentConfig = Configuration::getGlobalValue('PS_SMARTY_FORCE_COMPILE');
     $line = array('PS_SMARTY_FORCE_COMPILE', 'Smarty Template Compilation (' . _PS_SMARTY_NO_COMPILE_ . ' for never, ' . _PS_SMARTY_CHECK_COMPILE_ . ' for updated, ' . _PS_SMARTY_FORCE_COMPILE_ . ' for always)');
     switch ($currentConfig) {
         case _PS_SMARTY_NO_COMPILE_:
             array_push($line, $currentConfig . ' (never)');
             break;
         case _PS_SMARTY_CHECK_COMPILE_:
             array_push($line, $currentConfig . ' (if updated)');
             break;
         case _PS_SMARTY_FORCE_COMPILE_:
             array_push($line, $currentConfig . ' (Always)');
             break;
     }
     $table->addRow($line);
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_CSS_THEME_CACHE', 'Css cache');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_JS_THEME_CACHE', 'JS cache');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_HTACCESS_CACHE_CONTROL', 'Htaccess cache control');
     PS_CLI_Utils::add_boolean_configuration_status($table, 'PS_MEDIA_SERVERS', 'Use Media Servers');
     $line = array('PS_CIPHER_ALGORITHM', 'Cipher (0=blowfish, 1=rijndael)');
     if (Configuration::getGlobalValue('PS_CIPHER_ALGORITHM')) {
         array_push($line, 'RIJNDAEL/Mcrypt');
     } else {
         array_push($line, 'Local Blowfish');
     }
     $table->addRow($line);
     $line = array('Const: _PS_CACHE_ENABLED_', 'Cache');
     if (_PS_CACHE_ENABLED_) {
         array_push($line, 'enabled');
     } else {
         array_push($line, 'disabled');
     }
     $table->addRow($line);
     $table->addRow(array('Const: _PS_CACHING_SYSTEM_', 'Active Caching system', _PS_CACHING_SYSTEM_));
     $table->display();
     return;
 }
开发者ID:rodrisan,项目名称:ps-cli,代码行数:44,代码来源:ccc.php

示例13: displayCronInformation

 private function displayCronInformation()
 {
     $this->smarty->assign(array('cron_path' => dirname(__FILE__) . DIRECTORY_SEPARATOR, 'secure_key' => Configuration::getGlobalValue('MEDIAFINANZ_SECURE_KEY')));
     return $this->display(__FILE__, 'views/templates/admin/cron_information.tpl');
 }
开发者ID:jBangiev,项目名称:mediafinanz,代码行数:5,代码来源:mediafinanz.php

示例14: getUpcoming

 /**
  * Load and check the Noair Cache.
  * returns a ready to use array for a smarty template file
  * return false is no progam are available, even after cache refresh
  *
  * @return array / bool
  */
 public function getUpcoming()
 {
     if (!($nbToShow = (int) Configuration::getGlobalValue('NOAIR_UPCOMING_NB_SHOW'))) {
         return false;
     }
     if (!$this->_loadNoAirCache() or $this->_cacheAvailableUpcoming < $nbToShow) {
         $this->_updateNoAirCache();
     }
     return $this->_cacheCurrentProgramId ? array_slice($this->_cacheData, $this->_cacheCurrentProgramId, $nbToShow) : false;
 }
开发者ID:quadra-informatique,项目名称:NolifeTv-PrestaShop,代码行数:17,代码来源:nolifetv.php

示例15: getContent

    public function getContent()
    {
        if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
            $this->_html .= '<div id="pm_backoffice_wrapper" class="pm_bo_ps_' . substr(str_replace('.', '', _PS_VERSION_), 0, 2) . '">';
        }
        $this->_displayTitle($this->displayName);
        if ($this->_checkPermissions()) {
            if (Tools::getValue('makeUpdate')) {
                $this->checkIfModuleIsUpdate(true);
            }
            if (!$this->checkIfModuleIsUpdate(false)) {
                if (Configuration::get('PM_' . self::$_module_prefix . '_LAST_VERSION', false) !== false && version_compare(Configuration::get('PM_' . self::$_module_prefix . '_LAST_VERSION', false), '4.8', '>=') && version_compare(Configuration::get('PM_' . self::$_module_prefix . '_LAST_VERSION', false), '4.9.1', '<=')) {
                    $this->_html .= '
					<div class="warning warn clear">
						' . (version_compare(_PS_VERSION_, '1.5.0.0', '>=') ? '
						<p>' . $this->l('You have an old version of the module, this new version has a new approach for multishop features.') . '</p>
						<p>' . $this->l('Because of a lot of constraints, you will not be able to associate one search engine to multiple shops anymore.') . '</p>
						<p>' . $this->l('If it is your case at this time, we will only associate your search engine to one shop (from all the shops it was currently associated).') . '</p>
						' : '') . '
						<p>' . $this->l('We really recommand you to re-index all the search engines after this update. Thank you for your comprehension.') . '</p>
					</div><br />';
                }
                $this->_html .= '
					<div class="warning warn clear"><p>' . $this->l('We have detected that you installed a new version of the module on your shop') . '</p>
						<p style="text-align: center"><a href="' . $this->_base_config_url . '&makeUpdate=1" class="button">' . $this->l('Please click here in order to finish the installation process') . '</a></p>
					</div>';
                $this->_loadCssJsLibraries();
            } else {
                if (version_compare(_PS_VERSION_, '1.5.0.0', '>=') && Shop::getContext() != Shop::CONTEXT_SHOP) {
                    $this->_loadCssJsLibraries();
                    $this->_html .= '<div class="module_error alert error">' . $this->l('You must select a specific shop in order to continue, you can\'t create/edit a search engine from the "all shop" or "group shop" context.') . '</div>';
                } else {
                    $this->_preProcess();
                    $this->_loadCssJsLibraries();
                    $this->_postProcess();
                    $blocklayered_module = Module::getInstanceByName('blocklayered');
                    if (is_object($blocklayered_module) && isset($blocklayered_module->active) && $blocklayered_module->active == true) {
                        if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
                            $nbBlockLayeredFilters = (int) Db::getInstance()->getValue('SELECT COUNT(*) FROM `' . _DB_PREFIX_ . 'layered_filter` f JOIN `' . _DB_PREFIX_ . 'layered_filter_shop` fs ON (f.`id_layered_filter`= f.`id_layered_filter` AND fs.`id_shop`=' . $this->context->shop->id . ')');
                        } else {
                            $nbBlockLayeredFilters = (int) Db::getInstance()->getValue('SELECT COUNT(*) FROM `' . _DB_PREFIX_ . 'layered_filter`');
                        }
                        if ($nbBlockLayeredFilters) {
                            $this->_showWarning($this->l('Block Layered is not compatible with Advanced Search 4.') . '<br />' . $this->l('You must disable it first, or remove any filters in order to prevent unexpected behaviour on your shop.'));
                        }
                    }
                    $this->_showRating(true);
                    parent::getContent();
                    $this->_html .= '
					<script type="text/javascript">
						  var editTranlate = "' . $this->l('Edit') . '";
						  var reindexationInprogressMsg = "' . addcslashes($this->l('Another reindexing is in progress. Please wait.'), '"') . '";
						  var reindexingCriteriaMsg = "' . addcslashes($this->l('Reindexing criteria group'), '"') . '";
						  var reindexingCriteriaOfMsg = "' . addcslashes($this->l('of'), '"') . '";
						  $jqPm(document).ready(function() {
						  //Initialise the second table specifying a dragClass and an onDrop function that will display an alert
							$jqPm("#wrapConfigTab, #wrapAsTab").tabs({cache:false});
						 });
					  </script>';
                    $advanced_searchs = AdvancedSearchClass::getSearchs($this->_cookie->id_lang, false);
                    $this->_addButton(array('text' => $this->l('Add a new search'), 'href' => $this->_base_config_url . '&pm_load_function=displaySearchForm&class=AdvancedSearchClass&pm_js_callback=closeDialogIframe', 'icon_class' => 'ui-icon ui-icon-circle-plus', 'class' => 'open_on_dialog_iframe', 'rel' => '950_530_1'));
                    $this->_html .= '<br /><br /><div id="wrapAsTab">
										<ul id="asTab">';
                    if ($advanced_searchs && sizeof($advanced_searchs)) {
                        foreach ($advanced_searchs as $k => $advanced_search) {
                            $this->_html .= '<li id="TabSearchAdminPanel' . (int) $advanced_search['id_search'] . '"><a href="' . $this->_base_config_url . '&pm_load_function=displaySearchAdminPanel&id_search=' . $advanced_search['id_search'] . '"><span>' . $advanced_search['internal_name'] . '</span></a></li>';
                        }
                    }
                    $this->_html .= '</ul>';
                    $this->_html .= '</div><br />';
                    $this->_html .= '<div id="msgNoResults" style="' . ($advanced_searchs && sizeof($advanced_searchs) ? 'display:none;' : '') . '">';
                    $this->_showInfo($this->l('You do not have added a search engine yet. Please click on the click "Add a new search" in order to start.'));
                    $this->_html .= '<br /></div>';
                    $this->_html .= '<div id="wrapConfigTab">
										<ul id="configTab">
										  <li><a href="#config-2"><span><img src="' . $this->_path . 'img/document-code.png" /> ' . $this->l('Advanced styles') . '</span></a></li>
										  <li><a href="#config-3"><span><img src="' . $this->_path . 'img/clock.png" /> ' . $this->l('Crontab') . '</span></a></li>
										  <li><a href="#config-4"><span><img src="' . $this->_path . 'img/drill.png" /> ' . $this->l('Maintenance') . '</span></a></li>
										</ul>';
                    $this->_html .= '<div id="config-2">';
                    $this->displayAdvancedConfig();
                    $this->_html .= '</div>';
                    $this->_html .= '<div id="config-3">';
                    $this->_html .= '<br /><div class="conf confirm">' . $this->l('Use this URL for CRON Tasks (reindexation)') . '<br />' . (version_compare(_PS_VERSION_, '1.5.0.0', '>=') ? $this->context->shop->getBaseURL() : Tools::getHttpHost(true, true) . __PS_BASE_URI__) . 'modules/pm_advancedsearch4/cron.php?secure_key=' . (version_compare(_PS_VERSION_, '1.5.0.0', '>=') ? Configuration::getGlobalValue('PM_AS4_SECURE_KEY') : Configuration::get('PM_AS4_SECURE_KEY')) . '</div>';
                    $this->_html .= '</div>';
                    $this->_html .= '<div id="config-4">';
                    $this->displayMaintenance();
                    $this->_html .= '</div>';
                    $this->_html .= '</div>';
                }
            }
        } else {
            $this->_loadCssJsLibraries();
        }
        $this->_displaySupport();
        $this->_html .= '</div>';
        return $this->_html;
    }
开发者ID:acreno,项目名称:pm-ps,代码行数:98,代码来源:pm_advancedsearch4.php


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