diff --git a/admin-dev/themes/template/generator/options.tpl b/admin-dev/themes/template/generator/options.tpl new file mode 100644 index 000000000..5b6ce2dfb --- /dev/null +++ b/admin-dev/themes/template/generator/options.tpl @@ -0,0 +1,85 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9548 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} +{extends file="helper/options/options.tpl"} +{block name="defaultOptions"} +
+
{l s='Htaccess file generation'} +

+ {l s='Warning:'} + {l s='this tool can ONLY be used if you are hosted by an Apache web server. Please ask your webhost.'} +

+

+ {l s='This tool will automatically generate a ".htaccess" file that will give you the ability to do URL rewriting and to catch 404 errors.'} +

+ {if $checkConfiguration_ht} +
 
+ +
+ +

{l s='This will add directives to your .htaccess file which should improve caching and compression.'}

+
+
 
+ +
+ +

{l s='Enable only if your server allows URL rewriting.'}

+
+
 
+ +
+ +

{l s='Enable this option only if you have problems with some pages URL rewriting.'}

+
+

{l s='Generate your ".htaccess" file by clicking on the following button:'} +

+

{l s='This will erase your'} {l s='old'} {l s='.htaccess file!'}

+ {else} + +

{l s='Before being able to use this tool, you need to:'}

+

{l s='- create a'} '. $this->l('.htaccess').' {l s='blank file in directory'} '.__PS_BASE_URI__.' +
{l s='- give it write permissions (CHMOD 666 on Unix system)'}

+ {/if} +

+ +

+
+
{l s='Robots file generation'} +

{l s='Warning:'} {l s='Your file robots.txt MUST be in your website\'s root directory and nowhere else.'}

+

{l s='eg: http://www.yoursite.com/robots.txt'}

+

{l s='This tool will automatically generate a "robots.txt" file that you can configure to deny access to search engines for some pages.'}

+ {if $checkConfiguration_rb} + +

{l s='Generate your "robots.txt" file by clicking on the following button:'} +

+

{l s='This will erase your'} {l s='old'} {l s='robots.txt file!'}

+ {else} +

{l s='Before being able to use this tool, you need to:'}

+

{l s='- create a'} '. $this->l('robots.txt').' {l s='blank file in dir:'} {$smarty.const.__PS_BASE_URI__} +
{l s='- give it write permissions (CHMOD 666 on Unix system)'}

+ {/if} +

+
+{/block} diff --git a/admin-dev/themes/template/helper/options/options.tpl b/admin-dev/themes/template/helper/options/options.tpl index efe8b945b..bcecf567f 100644 --- a/admin-dev/themes/template/helper/options/options.tpl +++ b/admin-dev/themes/template/helper/options/options.tpl @@ -26,6 +26,7 @@ +{block name="defaultOptions"}

{/foreach}
+{/block} {block name="after"}{/block} diff --git a/admin-dev/themes/template/webservice/form.tpl b/admin-dev/themes/template/webservice/form.tpl index 9b6411862..b5d6f9126 100644 --- a/admin-dev/themes/template/webservice/form.tpl +++ b/admin-dev/themes/template/webservice/form.tpl @@ -1,3 +1,28 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8971 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} {extends file="helper/form/form.tpl"} {block name="defaultForm"} {$custom_form} diff --git a/classes/Configuration.php b/classes/Configuration.php index 8f88b7d67..b49267209 100644 --- a/classes/Configuration.php +++ b/classes/Configuration.php @@ -187,7 +187,7 @@ class ConfigurationCore extends ObjectModel static public function getMultiple($keys, $langID = NULL, $shopGroupID = NULL, $shopID = NULL) { if (!is_array($keys)) - die(Tools::displayError()); + throw new PrestashopException('keys var is not an array'); $langID = (int)$langID; self::getShopFromContext($shopGroupID, $shopID); @@ -497,4 +497,4 @@ class ConfigurationCore extends ObjectModel '; return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); } -} \ No newline at end of file +} diff --git a/classes/HelperOptions.php b/classes/HelperOptions.php index f6ae3d968..0ec80a1be 100644 --- a/classes/HelperOptions.php +++ b/classes/HelperOptions.php @@ -63,6 +63,9 @@ class HelperOptionsCore extends Helper foreach ($option_list as $category => $category_data) { + if(!is_array($category_data)) + continue; + if (!isset($category_data['image'])) $category_data['image'] = (!empty($tab['module']) && file_exists($_SERVER['DOCUMENT_ROOT']._MODULE_DIR_.$tab['module'].'/'.$tab['class_name'].'.gif') ? _MODULE_DIR_.$tab['module'].'/' : '../img/t/').$tab['class_name'].'.gif'; diff --git a/controllers/admin/AdminContactController.php b/controllers/admin/AdminContactController.php index 766a3ab5b..6927aade1 100644 --- a/controllers/admin/AdminContactController.php +++ b/controllers/admin/AdminContactController.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -class AdminContactController extends AdminController +class AdminContactControllerCore extends AdminController { public function __construct() { diff --git a/admin-dev/tabs/AdminGenerator.php b/controllers/admin/AdminGeneratorController.php similarity index 58% rename from admin-dev/tabs/AdminGenerator.php rename to controllers/admin/AdminGeneratorController.php index 97128e0fd..dc75ce801 100644 --- a/admin-dev/tabs/AdminGenerator.php +++ b/controllers/admin/AdminGeneratorController.php @@ -25,8 +25,10 @@ * International Registered Trademark & Property of PrestaShop SA */ -class AdminGenerator extends AdminTab +class AdminGeneratorControllerCore extends AdminController { + protected $options = array('array for auto display'); + public function __construct() { $this->_htFile = dirname(__FILE__).'/../../.htaccess'; @@ -36,66 +38,17 @@ class AdminGenerator extends AdminTab return parent::__construct(); } - public function display() + public function initContent() { $languages = Language::getLanguages(false); - // Htaccess - echo ' -
-
'.$this->l('Htaccess file generation').' -

'.$this->l('Warning:').' '.$this->l('this tool can ONLY be used if you are hosted by an Apache web server. Please ask your webhost.').'

-

'.$this->l('This tool will automatically generate a ".htaccess" file that will give you the ability to do URL rewriting and to catch 404 errors.').'

'; + $this->tpl_option_vars['checkConfiguration_ht'] = $this->_checkConfiguration($this->_htFile); + $this->tpl_option_vars['checkConfiguration_rb'] = $this->_checkConfiguration($this->_rbFile); + $this->tpl_option_vars['ps_htaccess_cache_control'] = Configuration::get('PS_HTACCESS_CACHE_CONTROL'); + $this->tpl_option_vars['ps_rewriting_settings'] = Configuration::get('PS_REWRITING_SETTINGS'); + $this->tpl_option_vars['ps_htaccess_disable_multiviews'] = Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS'); - if ($this->_checkConfiguration($this->_htFile)) - echo ' -
 
- -
- -

'.$this->l('This will add directives to your .htaccess file which should improve caching and compression.').'

-
-
 
- -
- -

'.$this->l('Enable only if your server allows URL rewriting.').'

-
-
 
- -
- -

'.$this->l('Enable this option only if you have problems with some pages URL rewriting.').'

-
-

'.$this->l('Generate your ".htaccess" file by clicking on the following button:').' -

-

'.$this->l('This will erase your').' '.$this->l('old').' '.$this->l('.htaccess file!').'

'; - else - echo ' -

'.$this->l('Before being able to use this tool, you need to:').'

-

'.$this->l('- create a').' '. $this->l('.htaccess').' '.$this->l('blank file in directory').' '.__PS_BASE_URI__.' -
'.$this->l('- give it write permissions (CHMOD 666 on Unix system)').'

'; - echo '

'; - - // Robots - echo '

-
-
'.$this->l('Robots file generation').' -

'.$this->l('Warning:').' '.$this->l('Your file robots.txt MUST be in your website\'s root directory and nowhere else.').'

-

'.$this->l('eg: http://www.yoursite.com/robots.txt').'.

-

'.$this->l('This tool will automatically generate a "robots.txt" file that you can configure to deny access to search engines for some pages.').'

'; - if ($this->_checkConfiguration($this->_rbFile)) - echo ' -

'.$this->l('Generate your "robots.txt" file by clicking on the following button:').' -

-

'.$this->l('This will erase your').' '.$this->l('old').' '.$this->l('robots.txt file!').'

'; - else - echo ' -

'.$this->l('Before being able to use this tool, you need to:').'

-

'.$this->l('- create a').' '. $this->l('robots.txt').' '.$this->l('blank file in dir:').' '.__PS_BASE_URI__.' -
'.$this->l('- give it write permissions (CHMOD 666 on Unix system)').'

'; - echo '

-
'; + parent::initContent(); } public function _checkConfiguration($file) diff --git a/controllers/admin/AdminLocalizationController.php b/controllers/admin/AdminLocalizationController.php index 493386c13..94b148f76 100644 --- a/controllers/admin/AdminLocalizationController.php +++ b/controllers/admin/AdminLocalizationController.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -class AdminLocalizationController extends AdminController +class AdminLocalizationControllerCore extends AdminController { public function __construct() { diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index d58a909a6..cf36eb35d 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -class AdminThemesController extends AdminController +class AdminThemesControllerCore extends AdminController { /** This value is used in isThemeCompatible method. only version node with an * higher version number will be used in [theme]/config.xml diff --git a/controllers/admin/AdminWebserviceController.php b/controllers/admin/AdminWebserviceController.php index 042649ac5..96e93718b 100755 --- a/controllers/admin/AdminWebserviceController.php +++ b/controllers/admin/AdminWebserviceController.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -class AdminWebserviceController extends AdminController +class AdminWebserviceControllerCore extends AdminController { // this will be filled later public $fields_form = array('webservice form');