diff --git a/admin-dev/themes/template/form.tpl b/admin-dev/themes/template/form.tpl index 3d6b09e2b..b11a3994b 100644 --- a/admin-dev/themes/template/form.tpl +++ b/admin-dev/themes/template/form.tpl @@ -140,7 +140,17 @@ id="{$value.id}" value="{$value.value|escape:'htmlall':'UTF-8'}" {if $fields_value[$input.name] == $value.value}checked="checked"{/if} /> - + {/foreach} {elseif $input.type == 'textarea'} {if isset($input.lang) && isset($input.attributeLang)} diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index c5719bbca..735dc4f2b 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -64,6 +64,171 @@ class AdminImagesController extends AdminController ) ); + $this->fields_form = array( + 'legend' => array( + 'title' => $this->l('Images'), + 'image' => '../img/admin/picture.gif' + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Type name:'), + 'name' => 'name', + 'required' => true, + 'p' => $this->l('Letters only (e.g., small, medium, large, extra-large)') + ), + array( + 'type' => 'text', + 'label' => $this->l('Width:'), + 'name' => 'width', + 'required' => true, + 'size' => 4, + 'maxlength' => 5, + 'p' => $this->l('Maximum image width in pixels') + ), + array( + 'type' => 'text', + 'label' => $this->l('Height:'), + 'name' => 'height', + 'required' => true, + 'size' => 4, + 'maxlength' => 5, + 'p' => $this->l('Maximum image height in pixels') + ), + array( + 'type' => 'radio', + 'label' => $this->l('Products:'), + 'name' => 'products', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'p' => $this->l('This type will be applied to product images'), + 'values' => array( + array( + 'id' => 'products_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'products_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ), + ) + ), + array( + 'type' => 'radio', + 'label' => $this->l('Categories:'), + 'name' => 'categories', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'p' => $this->l('This type will be applied to categories images'), + 'values' => array( + array( + 'id' => 'categories_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'categories_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ), + ) + ), + array( + 'type' => 'radio', + 'label' => $this->l('Manufacturers:'), + 'name' => 'manufacturers', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'p' => $this->l('This type will be applied to manufacturers images'), + 'values' => array( + array( + 'id' => 'manufacturers_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'manufacturers_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ), + ) + ), + array( + 'type' => 'radio', + 'label' => $this->l('Suppliers:'), + 'name' => 'suppliers', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'p' => $this->l('This type will be applied to suppliers images'), + 'values' => array( + array( + 'id' => 'suppliers_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'suppliers_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ), + ) + ), + array( + 'type' => 'radio', + 'label' => $this->l('Scenes:'), + 'name' => 'scenes', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'p' => $this->l('This type will be applied to scenes images'), + 'values' => array( + array( + 'id' => 'scenes_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'scenes_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ), + ) + ), + array( + 'type' => 'radio', + 'label' => $this->l('stores:'), + 'name' => 'stores', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'p' => $this->l('This type will be applied to stores images'), + 'values' => array( + array( + 'id' => 'stores_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'stores_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ), + ) + ), + ), + 'submit' => array( + 'title' => $this->l(' Save '), + 'class' => 'button' + ) + ); + + parent::__construct(); } @@ -117,91 +282,6 @@ class AdminImagesController extends AdminController $this->_errors[] = Tools::displayError('This name already exists.'); } - public function displayForm($isMainTab = true) - { - parent::displayForm(); - - if (!($obj = $this->loadObject(true))) - return; - - echo $obj->id ? $this->displayWarning($this->l('After modification, do not forget to regenerate thumbnails')) : ''; - - echo ' -
'; - } - /** * Display form for thumbnails regeneration */ @@ -218,7 +298,7 @@ class AdminImagesController extends AdminController $this->content .= '