From b39732858892cfef2dfc3a768a61c9737d721236 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Tue, 11 Oct 2011 16:22:39 +0000 Subject: [PATCH] [*] BO #PSFV-94 : update of the displayform method by helperForm in AdminSearchEnginesController --- .../themes/template/adminSearchEngines.tpl | 50 ------------------- .../admin/AdminSearchEnginesController.php | 48 +++++++++--------- 2 files changed, 25 insertions(+), 73 deletions(-) delete mode 100644 admin-dev/themes/template/adminSearchEngines.tpl diff --git a/admin-dev/themes/template/adminSearchEngines.tpl b/admin-dev/themes/template/adminSearchEngines.tpl deleted file mode 100644 index 86c6fd4a4..000000000 --- a/admin-dev/themes/template/adminSearchEngines.tpl +++ /dev/null @@ -1,50 +0,0 @@ -{* -* 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 -*} - -{if isset($tab_form)} -
- {if $tab_form['id']}{/if} -
- {l s ='Referrer'} - - -
- * -
- -
- * -
-
- -
-
* {l s ='Required field'}
-
-
- -{/if} - -{$content} \ No newline at end of file diff --git a/controllers/admin/AdminSearchEnginesController.php b/controllers/admin/AdminSearchEnginesController.php index e4743e72b..4c9f2ca64 100644 --- a/controllers/admin/AdminSearchEnginesController.php +++ b/controllers/admin/AdminSearchEnginesController.php @@ -49,33 +49,35 @@ class AdminSearchEnginesControllerCore extends AdminController 'getvar' => array('title' => $this->l('GET variable'), 'width' => 40) ); - $this->template = 'adminSearchEngines.tpl'; + $this->fields_form = array( + 'legend' => array( + 'title' => $this->l('Referrer') + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Server:'), + 'name' => 'server', + 'size' => 20, + 'required' => true + ), + array( + 'type' => 'text', + 'label' => $this->l('$_GET variable:'), + 'name' => 'getvar', + 'size' => 40, + 'required' => true + ) + ), + 'submit' => array( + 'title' => $this->l(' Save '), + 'class' => 'button' + ) + ); parent::__construct(); } - public function postProcess() - { - parent::postProcess(); - } - - public function displayForm($is_main_tab = true) - { - parent::displayForm($is_main_tab); - - if (!($obj = $this->loadObject(true))) - return; - - $this->context->smarty->assign('tab_form', array( - 'current' => self::$currentIndex, - 'table' => $this->table, - 'token' => $this->token, - 'id' => $obj->id, - 'server' => $this->getFieldValue($obj, 'server'), - 'getvar' => $this->getFieldValue($obj, 'getvar') - )); - } - public function initContent() { if ($this->display != 'edit')