From 8b46abe6deaa58ea6a5667a1eca3798670a72f7e Mon Sep 17 00:00:00 2001
From: mMarinetti
Date: Sun, 13 Nov 2011 18:51:01 +0000
Subject: [PATCH] [+] BO : #PSFV-94 AdminGenerator is now a controller // + now
form in options.tpl is inside a block // newly made controller are now
controllerCore // Configuration die2Exception // added license text in newly
made admin templates
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10070 b9a71923-0436-4b27-9f14-aed3839534dd
---
.../themes/template/generator/options.tpl | 85 +++++++++++++++++++
.../template/helper/options/options.tpl | 2 +
admin-dev/themes/template/webservice/form.tpl | 25 ++++++
classes/Configuration.php | 4 +-
classes/HelperOptions.php | 3 +
controllers/admin/AdminContactController.php | 2 +-
.../admin/AdminGeneratorController.php | 67 +++------------
.../admin/AdminLocalizationController.php | 2 +-
controllers/admin/AdminThemesController.php | 2 +-
.../admin/AdminWebserviceController.php | 2 +-
10 files changed, 131 insertions(+), 63 deletions(-)
create mode 100644 admin-dev/themes/template/generator/options.tpl
rename admin-dev/tabs/AdminGenerator.php => controllers/admin/AdminGeneratorController.php (58%)
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"}
+
+
+
+
+
+{/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"}
+{/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 '
- ';
-
- // Robots
- 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');