// update preferences tab

This commit is contained in:
Sarah Lorenzini
2013-07-31 17:43:48 +02:00
parent 9debffe910
commit ca253bcda2
10 changed files with 90 additions and 86 deletions
+4 -4
View File
@@ -185,10 +185,10 @@ function getPath($urlBase, $id_category, $path = '', $highlight = '', $categoryT
$edit = '<a href="'.$urlBase.'&id_cms_category='.$category->id.'&addcategory&token=' . Tools::getAdminToken('AdminCmsContent'.(int)(Tab::getIdFromClassName('AdminCmsContent')).(int)$context->employee->id).'"> $edit = '<a href="'.$urlBase.'&id_cms_category='.$category->id.'&addcategory&token=' . Tools::getAdminToken('AdminCmsContent'.(int)(Tab::getIdFromClassName('AdminCmsContent')).(int)$context->employee->id).'">
<img src="../img/admin/edit.gif" alt="Modify" /></a> '; <img src="../img/admin/edit.gif" alt="Modify" /></a> ';
if ($category->id == 1) if ($category->id == 1)
$edit = '<a href="'.$urlBase.'&id_cms_category='.$category->id.'&viewcategory&token=' . Tools::getAdminToken('AdminCmsContent'.(int)(Tab::getIdFromClassName('AdminCmsContent')).(int)$context->employee->id).'"> $edit = '<li><a href="'.$urlBase.'&id_cms_category='.$category->id.'&viewcategory&token=' . Tools::getAdminToken('AdminCmsContent'.(int)(Tab::getIdFromClassName('AdminCmsContent')).(int)$context->employee->id).'">
<img src="../img/admin/home.gif" alt="Home" /></a> '; <i class="icon-home"></i></a></li> ';
$path = $edit.'<a href="'.$urlBase.'&id_cms_category='.$category->id.'&viewcategory&token=' . Tools::getAdminToken('AdminCmsContent'.(int)(Tab::getIdFromClassName('AdminCmsContent')).(int)$context->employee->id).'"> $path = $edit.'<li><a href="'.$urlBase.'&id_cms_category='.$category->id.'&viewcategory&token=' . Tools::getAdminToken('AdminCmsContent'.(int)(Tab::getIdFromClassName('AdminCmsContent')).(int)$context->employee->id).'">
'.$name.'</a> > '.$path; '.$name.'</a></li> > '.$path;
if ($category->id == 1) if ($category->id == 1)
return substr($path, 0, strlen($path) - 3); return substr($path, 0, strlen($path) - 3);
return getPath($urlBase, $category->id_parent, $path, '', 'cms'); return getPath($urlBase, $category->id_parent, $path, '', 'cms');
@@ -23,9 +23,9 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
{if isset($cms_breadcrumb)} {if isset($cms_breadcrumb)}
<div class="cat_bar"> <ul class="breadcrumb cat_bar">
<span style="color: #3C8534;">{l s='Current category'} :</span>&nbsp;&nbsp;&nbsp;{$cms_breadcrumb} {$cms_breadcrumb}
</div> </ul>
{/if} {/if}
{$content} {$content}
@@ -41,8 +41,7 @@
{/block} {/block}
{block name="after"} {block name="after"}
<br/><br/> <fieldset id="prestastore-content" class="col-lg-12"></fieldset>
<fieldset id="prestastore-content" class="width3"></fieldset>
<script type="text/javascript"> <script type="text/javascript">
$.post( $.post(
"ajax-tab.php", "ajax-tab.php",
@@ -53,7 +52,7 @@
action:'getAddonsThemes', action:'getAddonsThemes',
page:'themes' page:'themes'
}, function(a){ }, function(a){
$("#prestastore-content").html("<legend><img src='../img/admin/prestastore.gif' class='middle' />{l s='Live from PrestaShop Addons!'}</legend>"+a); $("#prestastore-content").html("<h3><i class='icon-puzzle-piece'></i> {l s='Live from PrestaShop Addons!'}</h3>"+a);
}); });
</script> </script>
{/block} {/block}
@@ -124,7 +124,7 @@
<p class="radio"> <p class="radio">
<input type="radio" name="{$key}" id="{$key}_{$k}" value="{$k}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/> <input type="radio" name="{$key}" id="{$key}_{$k}" value="{$k}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
<label class="col-lg-3" for="{$key}_{$k}"> {$v}</label> <label class="col-lg-6" for="{$key}_{$k}"> {$v}</label>
</p> </p>
{/foreach} {/foreach}
</div> </div>
@@ -163,11 +163,11 @@
</div> </div>
{elseif $field['type'] == 'file'} {elseif $field['type'] == 'file'}
{if isset($field['thumb']) && $field['thumb']} {if isset($field['thumb']) && $field['thumb']}
<div class="col-lg-9"> <div class="col-lg-3">
<img src="{$field['thumb']}" alt="{$field['title']}" title="{$field['title']}" /> <img src="{$field['thumb']}" alt="{$field['title']}" title="{$field['title']}" />
</div> </div>
{/if} {/if}
<div class="col-lg-9"> <div class="col-lg-5">
<input type="file" name="{$key}" /> <input type="file" name="{$key}" />
</div> </div>
{elseif $field['type'] == 'color'} {elseif $field['type'] == 'color'}
@@ -37,6 +37,7 @@ class AdminCmsContentControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
/* Get current category */ /* Get current category */
$id_cms_category = (int)Tools::getValue('id_cms_category', Tools::getValue('id_cms_category_parent', 1)); $id_cms_category = (int)Tools::getValue('id_cms_category', Tools::getValue('id_cms_category_parent', 1));
self::$category = new CMSCategory($id_cms_category); self::$category = new CMSCategory($id_cms_category);
@@ -28,6 +28,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->className = 'Configuration'; $this->className = 'Configuration';
$this->table = 'configuration'; $this->table = 'configuration';
@@ -51,7 +52,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_REGISTRATION_PROCESS_TYPE' => array( 'PS_REGISTRATION_PROCESS_TYPE' => array(
'title' => $this->l('Registration process type'), 'title' => $this->l('Registration process type'),
'desc' => $this->l('The "Only account creation" registration option allows the customer to register faster, and create his/her address later.'), 'hint' => $this->l('The "Only account creation" registration option allows the customer to register faster, and create his/her address later.'),
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'select', 'type' => 'select',
@@ -60,21 +61,21 @@ class AdminCustomerPreferencesControllerCore extends AdminController
), ),
'PS_ONE_PHONE_AT_LEAST' => array( 'PS_ONE_PHONE_AT_LEAST' => array(
'title' => $this->l('Phone number'), 'title' => $this->l('Phone number'),
'desc' => $this->l('If you chose yes, your customer will have to provide at least one phone number to register.'), 'hint' => $this->l('If you chose yes, your customer will have to provide at least one phone number to register.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
), ),
'PS_CART_FOLLOWING' => array( 'PS_CART_FOLLOWING' => array(
'title' => $this->l('Cart re-display at login'), 'title' => $this->l('Cart re-display at login'),
'desc' => $this->l('After customer logs in, you can recall and display the content of his/her last shopping cart.'), 'hint' => $this->l('After customer logs in, you can recall and display the content of his/her last shopping cart.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
), ),
'PS_CUSTOMER_CREATION_EMAIL' => array( 'PS_CUSTOMER_CREATION_EMAIL' => array(
'title' => $this->l('Send an email after registration'), 'title' => $this->l('Send an email after registration'),
'desc' => $this->l('Send an email with summary account (email, password) after registration.'), 'hint' => $this->l('Send an email with summary account (email, password) after registration.'),
'validation' => 'isUnsignedInt', 'validation' => 'isUnsignedInt',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -82,7 +83,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController
), ),
'PS_PASSWD_TIME_FRONT' => array( 'PS_PASSWD_TIME_FRONT' => array(
'title' => $this->l('Regenerate password'), 'title' => $this->l('Regenerate password'),
'desc' => $this->l('Minimum time required to regenerate a password.'), 'hint' => $this->l('Minimum time required to regenerate a password.'),
'validation' => 'isUnsignedInt', 'validation' => 'isUnsignedInt',
'cast' => 'intval', 'cast' => 'intval',
'size' => 5, 'size' => 5,
@@ -91,7 +92,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController
), ),
'PS_B2B_ENABLE' => array( 'PS_B2B_ENABLE' => array(
'title' => $this->l('Enable B2B mode'), 'title' => $this->l('Enable B2B mode'),
'desc' => $this->l('Activate or deactivate B2B mode. When this option is enabled, B2B features will be made available.'), 'hint' => $this->l('Activate or deactivate B2B mode. When this option is enabled, B2B features will be made available.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
+34 -31
View File
@@ -35,6 +35,7 @@ class AdminMetaControllerCore extends AdminController
{ {
parent::__construct(); parent::__construct();
$this->bootstrap = true;
$this->ht_file = _PS_ROOT_DIR_.'/.htaccess'; $this->ht_file = _PS_ROOT_DIR_.'/.htaccess';
$this->rb_file = _PS_ROOT_DIR_.'/robots.txt'; $this->rb_file = _PS_ROOT_DIR_.'/robots.txt';
$this->sm_file = _PS_ROOT_DIR_.'/sitemap.xml'; $this->sm_file = _PS_ROOT_DIR_.'/sitemap.xml';
@@ -58,22 +59,22 @@ class AdminMetaControllerCore extends AdminController
$general_fields = array( $general_fields = array(
'PS_REWRITING_SETTINGS' => array( 'PS_REWRITING_SETTINGS' => array(
'title' => $this->l('Friendly URL'), 'title' => $this->l('Friendly URL'),
'desc' => ($mod_rewrite ? $this->l('Enable only if your server allows URL rewriting (recommended).') : ''), 'hint' => ($mod_rewrite ? $this->l('Enable only if your server allows URL rewriting (recommended).') : ''),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'rewriting_settings', 'type' => 'bool',
'mod_rewrite' => $mod_rewrite 'mod_rewrite' => $mod_rewrite
), ),
'PS_ALLOW_ACCENTED_CHARS_URL' => array( 'PS_ALLOW_ACCENTED_CHARS_URL' => array(
'title' => $this->l('Accented URL'), 'title' => $this->l('Accented URL'),
'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.').' '.$this->l('You should only activate this option if you are using non-latin characters ; for all the latin charsets, your SEO will be better without this option.'), 'hint' => $this->l('Enable if you want to allow accented characters in your friendly URLs.').' '.$this->l('You should only activate this option if you are using non-latin characters ; for all the latin charsets, your SEO will be better without this option.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
), ),
'PS_CANONICAL_REDIRECT' => array( 'PS_CANONICAL_REDIRECT' => array(
'title' => $this->l('Automatically redirect to the canonical URL'), 'title' => $this->l('Automatically redirect to the canonical URL'),
'desc' => $this->l('Recommended, but your theme must be compliant.'), 'hint' => $this->l('Recommended, but your theme must be compliant.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
@@ -85,7 +86,7 @@ class AdminMetaControllerCore extends AdminController
{ {
$general_fields['PS_HTACCESS_DISABLE_MULTIVIEWS'] = array( $general_fields['PS_HTACCESS_DISABLE_MULTIVIEWS'] = array(
'title' => $this->l('Disable apache multiviews'), 'title' => $this->l('Disable apache multiviews'),
'desc' => $this->l('Enable this option only if you have problems with URL rewriting.'), 'hint' => $this->l('Enable this option only if you have problems with URL rewriting.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool', 'type' => 'bool',
@@ -93,7 +94,7 @@ class AdminMetaControllerCore extends AdminController
$general_fields['PS_HTACCESS_DISABLE_MODSEC'] = array( $general_fields['PS_HTACCESS_DISABLE_MODSEC'] = array(
'title' => $this->l('Disable apache mod security'), 'title' => $this->l('Disable apache mod security'),
'desc' => $this->l('Some features could not work correctly with a specific configuration of apache mod security. We recommend to turn it off.'), 'hint' => $this->l('Some features could not work correctly with a specific configuration of apache mod security. We recommend to turn it off.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool', 'type' => 'bool',
@@ -102,22 +103,22 @@ class AdminMetaControllerCore extends AdminController
else else
{ {
$url_description = $this->l('Before being able to use this tool, you need to:'); $url_description = $this->l('Before being able to use this tool, you need to:');
$url_description .= '<br />- '.$this->l('Create a blank .htaccess in your root directory.'); $url_description .= $this->l('Create a blank .htaccess in your root directory.');
$url_description .= '<br />- '.$this->l('Give it write permissions (CHMOD 666 on Unix system)'); $url_description .= $this->l('Give it write permissions (CHMOD 666 on Unix system)');
} }
// Options to generate robot.txt // Options to generate robot.txt
$robots_description = $this->l('Your robots.txt file MUST be in your website\'s root directory and nowhere else (e.g. http://www.yoursite.com/robots.txt).'); $robots_description = $this->l('Your robots.txt file MUST be in your website\'s root directory and nowhere else (e.g. http://www.yoursite.com/robots.txt).');
if ($this->checkConfiguration($this->rb_file)) if ($this->checkConfiguration($this->rb_file))
{ {
$robots_description .= '<br />'.$this->l('Generate your "robots.txt" file by clicking on the following button (this will erase the old robots.txt file)'); $robots_description .= $this->l('Generate your "robots.txt" file by clicking on the following button (this will erase the old robots.txt file)');
$robots_submit = array('name' => 'submitRobots', 'title' => $this->l('Generate robots.txt file')); $robots_submit = array('name' => 'submitRobots', 'title' => $this->l('Generate robots.txt file'));
} }
else else
{ {
$robots_description .= '<br />'.$this->l('Before being able to use this tool, you need to:'); $robots_description .= $this->l('Before being able to use this tool, you need to:');
$robots_description .= '<br />- '.$this->l('Create a blank robots.txt file in your root directory.'); $robots_description .= $this->l('Create a blank robots.txt file in your root directory.');
$robots_description .= '<br />- '.$this->l('Give it write permissions (CHMOD 666 on Unix system)'); $robots_description .= $this->l('Give it write permissions (CHMOD 666 on Unix system)');
} }
$robots_options = array( $robots_options = array(
@@ -145,21 +146,18 @@ class AdminMetaControllerCore extends AdminController
'title' => $this->l('Shop domain'), 'title' => $this->l('Shop domain'),
'validation' => 'isString', 'validation' => 'isString',
'type' => 'text', 'type' => 'text',
'size' => 70,
'defaultValue' => $this->url->domain, 'defaultValue' => $this->url->domain,
), ),
'domain_ssl' => array( 'domain_ssl' => array(
'title' => $this->l('SSL domain'), 'title' => $this->l('SSL domain'),
'validation' => 'isString', 'validation' => 'isString',
'type' => 'text', 'type' => 'text',
'size' => 70,
'defaultValue' => $this->url->domain_ssl, 'defaultValue' => $this->url->domain_ssl,
), ),
'uri' => array( 'uri' => array(
'title' => $this->l('Base URI'), 'title' => $this->l('Base URI'),
'validation' => 'isString', 'validation' => 'isString',
'type' => 'text', 'type' => 'text',
'size' => 70,
'defaultValue' => $this->url->physical_uri, 'defaultValue' => $this->url->physical_uri,
), ),
); );
@@ -250,7 +248,7 @@ class AdminMetaControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Meta tags'), 'title' => $this->l('Meta tags'),
'image' => '../img/admin/metatags.gif' 'icon' => 'icon-tags'
), ),
'input' => array( 'input' => array(
array( array(
@@ -273,7 +271,7 @@ class AdminMetaControllerCore extends AdminController
'query' => 'query', 'query' => 'query',
), ),
), ),
'desc' => $this->l('Name of the related page'), 'hint' => $this->l('Name of the related page'),
'required' => true, 'required' => true,
'empty_message' => '<p>'.$this->l('There is no page available!').'</p>', 'empty_message' => '<p>'.$this->l('There is no page available!').'</p>',
), ),
@@ -282,27 +280,31 @@ class AdminMetaControllerCore extends AdminController
'label' => $this->l('Page title:'), 'label' => $this->l('Page title:'),
'name' => 'title', 'name' => 'title',
'lang' => true, 'lang' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}', 'hint' => array(
'desc' => $this->l('Title of this page'), $this->l('Title of this page.'),
'size' => 30 $this->l('Invalid characters:').' &lt;&gt;;=#{}'
)
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Meta description:'), 'label' => $this->l('Meta description:'),
'name' => 'description', 'name' => 'description',
'lang' => true, 'lang' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}', 'hint' => array(
'desc' => $this->l('A short description of your shop'), $this->l('Invalid characters:').' &lt;&gt;;=#{}',
'size' => 50 $this->l('A short description of your shop')
)
), ),
array( array(
'type' => 'tags', 'type' => 'tags',
'label' => $this->l('Meta keywords:'), 'label' => $this->l('Meta keywords:'),
'name' => 'keywords', 'name' => 'keywords',
'lang' => true, 'lang' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}', 'hint' => array(
'desc' => $this->l('List of keywords for search engines').' '.$this->l('To add "tags," click in the field, write something, and then press "Enter."'), $this->l('Invalid characters:').' &lt;&gt;;=#{}',
'size' => 50 $this->l('List of keywords for search engines'),
$this->l('To add "tags," click in the field, write something, and then press "Enter."')
)
), ),
array( array(
'type' => 'text', 'type' => 'text',
@@ -310,14 +312,15 @@ class AdminMetaControllerCore extends AdminController
'name' => 'url_rewrite', 'name' => 'url_rewrite',
'lang' => true, 'lang' => true,
'required' => true, 'required' => true,
'hint' => $this->l('Only letters and hyphens are allowed'), 'hint' => array(
'desc' => $this->l('e.g. "contacts" for http://mysite.com/shop/contacts to redirect to http://mysite.com/shop/contact-form.php'), $this->l('Only letters and hyphens are allowed'),
'size' => 50 $this->l('e.g. "contacts" for http://mysite.com/shop/contacts to redirect to http://mysite.com/shop/contact-form.php'),
)
), ),
), ),
'submit' => array( 'submit' => array(
'title' => $this->l(' Save '), 'title' => $this->l('Save'),
'class' => 'button' 'class' => 'btn btn-primary'
) )
); );
return parent::renderForm(); return parent::renderForm();
@@ -28,6 +28,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->className = 'Configuration'; $this->className = 'Configuration';
$this->table = 'configuration'; $this->table = 'configuration';
@@ -123,21 +124,21 @@ class AdminOrderPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_GIFT_WRAPPING' => array( 'PS_GIFT_WRAPPING' => array(
'title' => $this->l('Offer gift wrapping'), 'title' => $this->l('Offer gift wrapping'),
'desc' => $this->l('Suggest gift-wrapping to customers.'), 'hint' => $this->l('Suggest gift-wrapping to customers.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
), ),
'PS_GIFT_WRAPPING_PRICE' => array( 'PS_GIFT_WRAPPING_PRICE' => array(
'title' => $this->l('Gift-wrapping price'), 'title' => $this->l('Gift-wrapping price'),
'desc' => $this->l('Set a price for gift wrapping'), 'hint' => $this->l('Set a price for gift wrapping'),
'validation' => 'isPrice', 'validation' => 'isPrice',
'cast' => 'floatval', 'cast' => 'floatval',
'type' => 'price' 'type' => 'price'
), ),
'PS_GIFT_WRAPPING_TAX_RULES_GROUP' => array( 'PS_GIFT_WRAPPING_TAX_RULES_GROUP' => array(
'title' => $this->l('Gift-wrapping tax'), 'title' => $this->l('Gift-wrapping tax'),
'desc' => $this->l('Set a tax for gift wrapping'), 'hint' => $this->l('Set a tax for gift wrapping'),
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'select', 'type' => 'select',
@@ -146,7 +147,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
), ),
'PS_RECYCLABLE_PACK' => array( 'PS_RECYCLABLE_PACK' => array(
'title' => $this->l('Offer recycled packaging'), 'title' => $this->l('Offer recycled packaging'),
'desc' => $this->l('Suggest recycled packaging to customer'), 'hint' => $this->l('Suggest recycled packaging to customer'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
@@ -28,6 +28,7 @@ class AdminPPreferencesControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->className = 'Configuration'; $this->className = 'Configuration';
$this->table = 'configuration'; $this->table = 'configuration';
@@ -39,7 +40,7 @@ class AdminPPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_CATALOG_MODE' => array( 'PS_CATALOG_MODE' => array(
'title' => $this->l('Catalog mode'), 'title' => $this->l('Catalog mode'),
'desc' => $this->l('When active, all shopping features will be disabled.'), 'hint' => $this->l('When active, all shopping features will be disabled.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'required' => false, 'required' => false,
@@ -47,7 +48,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_COMPARATOR_MAX_ITEM' => array( 'PS_COMPARATOR_MAX_ITEM' => array(
'title' => $this->l('Product comparison'), 'title' => $this->l('Product comparison'),
'desc' => $this->l('Set the maximum number of products that can be selected for comparison.').' '.$this->l('Set to "0" to disable this feature.'), 'hint' => $this->l('Set the maximum number of products that can be selected for comparison. Set to "0" to disable this feature.'),
'validation' => 'isUnsignedId', 'validation' => 'isUnsignedId',
'required' => true, 'required' => true,
'cast' => 'intval', 'cast' => 'intval',
@@ -61,7 +62,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_CART_REDIRECT' => array( 'PS_CART_REDIRECT' => array(
'title' => $this->l('Redirect after adding product to cart'), 'title' => $this->l('Redirect after adding product to cart'),
'desc' => $this->l('Only for non-AJAX versions of the cart.'), 'hint' => $this->l('Only for non-AJAX versions of the cart.'),
'cast' => 'intval', 'cast' => 'intval',
'show' => true, 'show' => true,
'required' => false, 'required' => false,
@@ -74,7 +75,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_PRODUCT_SHORT_DESC_LIMIT' => array( 'PS_PRODUCT_SHORT_DESC_LIMIT' => array(
'title' => $this->l('Max size of short description'), 'title' => $this->l('Max size of short description'),
'desc' => $this->l('Set the maximum size of product short description (in characters).'), 'hint' => $this->l('Set the maximum size of product short description (in characters).'),
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
@@ -82,7 +83,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_QTY_DISCOUNT_ON_COMBINATION' => array( 'PS_QTY_DISCOUNT_ON_COMBINATION' => array(
'title' => $this->l('Quantity discounts based on'), 'title' => $this->l('Quantity discounts based on'),
'desc' => $this->l('How to calculate quantity discounts'), 'hint' => $this->l('How to calculate quantity discounts'),
'cast' => 'intval', 'cast' => 'intval',
'show' => true, 'show' => true,
'required' => false, 'required' => false,
@@ -100,14 +101,14 @@ class AdminPPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_PRODUCTS_PER_PAGE' => array( 'PS_PRODUCTS_PER_PAGE' => array(
'title' => $this->l('Products per page'), 'title' => $this->l('Products per page'),
'desc' => $this->l('Number of products displayed per page. Default is 10.'), 'hint' => $this->l('Number of products displayed per page. Default is 10.'),
'validation' => 'isUnsignedInt', 'validation' => 'isUnsignedInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text' 'type' => 'text'
), ),
'PS_PRODUCTS_ORDER_BY' => array( 'PS_PRODUCTS_ORDER_BY' => array(
'title' => $this->l('Default order by'), 'title' => $this->l('Default order by'),
'desc' => $this->l('The order in which products are displayed in the product list.'), 'hint' => $this->l('The order in which products are displayed in the product list.'),
'type' => 'select', 'type' => 'select',
'list' => array( 'list' => array(
array('id' => '0', 'name' => $this->l('Product name')), array('id' => '0', 'name' => $this->l('Product name')),
@@ -122,7 +123,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_PRODUCTS_ORDER_WAY' => array( 'PS_PRODUCTS_ORDER_WAY' => array(
'title' => $this->l('Default order method'), 'title' => $this->l('Default order method'),
'desc' => $this->l('Default order method for product list'), 'hint' => $this->l('Default order method for product list'),
'type' => 'select', 'type' => 'select',
'list' => array( 'list' => array(
array( array(
@@ -143,7 +144,7 @@ class AdminPPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_DISPLAY_QTIES' => array( 'PS_DISPLAY_QTIES' => array(
'title' => $this->l('Display available quantities on the product page'), 'title' => $this->l('Display available quantities on the product page'),
'desc' => '', 'hint' => '',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'required' => false, 'required' => false,
@@ -151,7 +152,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_LAST_QTIES' => array( 'PS_LAST_QTIES' => array(
'title' => $this->l('Display remaining quantities when the qty is lower than'), 'title' => $this->l('Display remaining quantities when the qty is lower than'),
'desc' => $this->l('Set to "0" to disable this feature.'), 'hint' => $this->l('Set to "0" to disable this feature.'),
'validation' => 'isUnsignedId', 'validation' => 'isUnsignedId',
'required' => true, 'required' => true,
'cast' => 'intval', 'cast' => 'intval',
@@ -159,7 +160,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_DISPLAY_JQZOOM' => array( 'PS_DISPLAY_JQZOOM' => array(
'title' => $this->l('Enable JqZoom instead of Thickbox on the product page'), 'title' => $this->l('Enable JqZoom instead of Thickbox on the product page'),
'desc' => '', 'hint' => '',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'required' => false, 'required' => false,
@@ -167,7 +168,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_DISP_UNAVAILABLE_ATTR' => array( 'PS_DISP_UNAVAILABLE_ATTR' => array(
'title' => $this->l('Display unavailable product attributes on the product page'), 'title' => $this->l('Display unavailable product attributes on the product page'),
'desc' => '', 'hint' => '',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'required' => false, 'required' => false,
@@ -175,7 +176,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array( 'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array(
'title' => $this->l('Display the "add to cart" button when a product has attributes'), 'title' => $this->l('Display the "add to cart" button when a product has attributes'),
'desc' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'), 'hint' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
@@ -187,7 +188,7 @@ class AdminPPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_ORDER_OUT_OF_STOCK' => array( 'PS_ORDER_OUT_OF_STOCK' => array(
'title' => $this->l('Allow ordering of out-of-stock products'), 'title' => $this->l('Allow ordering of out-of-stock products'),
'desc' => $this->l('Add to cart button is hidden when a product is unavailable'), 'hint' => $this->l('Add to cart button is hidden when a product is unavailable'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'required' => false, 'required' => false,
@@ -195,7 +196,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_STOCK_MANAGEMENT' => array( 'PS_STOCK_MANAGEMENT' => array(
'title' => $this->l('Enable stock management'), 'title' => $this->l('Enable stock management'),
'desc' => '', 'hint' => '',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'required' => false, 'required' => false,
@@ -207,7 +208,7 @@ class AdminPPreferencesControllerCore extends AdminController
), ),
'PS_ADVANCED_STOCK_MANAGEMENT' => array( 'PS_ADVANCED_STOCK_MANAGEMENT' => array(
'title' => $this->l('Enable advanced-stock management'), 'title' => $this->l('Enable advanced-stock management'),
'desc' => $this->l('Allows you to manage physical stock, warehouses and supply orders.'), 'hint' => $this->l('Allows you to manage physical stock, warehouses and supply orders.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'required' => false, 'required' => false,
+14 -16
View File
@@ -94,12 +94,13 @@ class AdminThemesControllerCore extends AdminController
public function init() public function init()
{ {
// No cache for auto-refresh uploaded logo // No cache for auto-refresh uploaded logo
header('Cache-Control: no-cache, must-revalidate'); header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
parent::init(); parent::init();
$this->bootstrap = true;
$this->can_display_themes = (!Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP) ? true : false; $this->can_display_themes = (!Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP) ? true : false;
$this->fields_options = array( $this->fields_options = array(
@@ -116,13 +117,15 @@ class AdminThemesControllerCore extends AdminController
), ),
), ),
), ),
/* TO DO - DESC à revoir*/
'appearance' => array( 'appearance' => array(
'title' => $this->l('Appearance'), 'title' => $this->l('Appearance'),
'icon' => 'email', 'icon' => 'email',
'fields' => array( 'fields' => array(
'PS_LOGO' => array( 'PS_LOGO' => array(
'title' => $this->l('Header logo'), 'title' => $this->l('Header logo'),
'desc' => $this->l('Will appear on main page.').' '.$this->l('Recommended height: 52px. Maximum height on default theme: 65px.'), 'hint' => $this->l('Will appear on main page. Recommended height: 52px. Maximum height on default theme: 65px.'),
'type' => 'file', 'type' => 'file',
'thumb' => _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time() 'thumb' => _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time()
), ),
@@ -153,27 +156,27 @@ class AdminThemesControllerCore extends AdminController
'PS_FAVICON' => array( 'PS_FAVICON' => array(
'title' => $this->l('Favicon'), 'title' => $this->l('Favicon'),
'hint' => $this->l('Only ICO format allowed'), 'hint' => $this->l('Only ICO format allowed'),
'desc' => $this->l('Will appear in the address bar of your web browser.'), 'hint' => $this->l('Will appear in the address bar of your web browser.'),
'type' => 'file', 'type' => 'file',
'thumb' => _PS_IMG_.Configuration::get('PS_FAVICON').'?date='.time() 'thumb' => _PS_IMG_.Configuration::get('PS_FAVICON').'?date='.time()
), ),
'PS_STORES_ICON' => array( 'PS_STORES_ICON' => array(
'title' => $this->l('Store icon'), 'title' => $this->l('Store icon'),
'hint' => $this->l('Only GIF format allowed.'), 'hint' => $this->l('Only GIF format allowed.'),
'desc' => $this->l('Will appear on the store locator (inside Google Maps).').'<br />'.$this->l('Suggested size: 30x30, Transparent GIF'), 'hint' => $this->l('Will appear on the store locator (inside Google Maps).').'<br />'.$this->l('Suggested size: 30x30, Transparent GIF'),
'type' => 'file', 'type' => 'file',
'thumb' => _PS_IMG_.Configuration::get('PS_STORES_ICON').'?date='.time() 'thumb' => _PS_IMG_.Configuration::get('PS_STORES_ICON').'?date='.time()
), ),
'PS_NAVIGATION_PIPE' => array( 'PS_NAVIGATION_PIPE' => array(
'title' => $this->l('Navigation pipe'), 'title' => $this->l('Navigation pipe'),
'desc' => $this->l('Used for the navigation path inside categories/product.'), 'hint' => $this->l('Used for the navigation path inside categories/product.'),
'cast' => 'strval', 'cast' => 'strval',
'type' => 'text', 'type' => 'text',
'size' => 20 'size' => 20
), ),
'PS_ALLOW_MOBILE_DEVICE' => array( 'PS_ALLOW_MOBILE_DEVICE' => array(
'title' => $this->l('Enable the mobile theme.'), 'title' => $this->l('Enable the mobile theme.'),
'desc' => $this->l('Allows visitors browsing on mobile devices to view a lighter version of your website.'), 'hint' => $this->l('Allows visitors browsing on mobile devices to view a lighter version of your website.'),
'type' => 'radio', 'type' => 'radio',
'required' => true, 'required' => true,
'validation' => 'isGenericName', 'validation' => 'isGenericName',
@@ -186,7 +189,7 @@ class AdminThemesControllerCore extends AdminController
), ),
'PS_MAIL_COLOR' => array( 'PS_MAIL_COLOR' => array(
'title' => $this->l('Mail color'), 'title' => $this->l('Mail color'),
'desc' => $this->l('Your mail will be highlighted in this color. HTML colors only, please (e.g.').' "lightblue", "#CC6600")', 'hint' => $this->l('Your mail will be highlighted in this color. HTML colors only, please (e.g.').' "lightblue", "#CC6600")',
'type' => 'color', 'type' => 'color',
'name' => 'PS_MAIL_COLOR', 'name' => 'PS_MAIL_COLOR',
'size' => 30, 'size' => 30,
@@ -201,15 +204,12 @@ class AdminThemesControllerCore extends AdminController
'id_theme' => array( 'id_theme' => array(
'title' => $this->l('ID'), 'title' => $this->l('ID'),
'align' => 'center', 'align' => 'center',
'width' => 20,
), ),
'name' => array( 'name' => array(
'title' => $this->l('Name'), 'title' => $this->l('Name'),
'width' => 'auto',
), ),
'directory' => array( 'directory' => array(
'title' => $this->l('Directory'), 'title' => $this->l('Directory'),
'width' => 'auto',
), ),
); );
} }
@@ -252,14 +252,13 @@ class AdminThemesControllerCore extends AdminController
'tinymce' => false, 'tinymce' => false,
'legend' => array( 'legend' => array(
'title' => $this->l('Theme'), 'title' => $this->l('Theme'),
'image' => '../img/admin/themes.gif' 'icon' => 'icon-picture'
), ),
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Name of the theme:'), 'label' => $this->l('Name of the theme:'),
'name' => 'name', 'name' => 'name',
'size' => 48,
'required' => true, 'required' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}', 'hint' => $this->l('Invalid characters:').' <>;=#{}',
), ),
@@ -277,7 +276,7 @@ class AdminThemesControllerCore extends AdminController
'label' => $this->l('Name of the theme\'s directory:'), 'label' => $this->l('Name of the theme\'s directory:'),
'name' => 'directory', 'name' => 'directory',
'required' => true, 'required' => true,
'desc' => $this->l('If the directory does not exists, it will be created.'), 'hint' => $this->l('If the directory does not exists, it will be created.'),
); );
$theme_query = Theme::getThemes(); $theme_query = Theme::getThemes();
@@ -285,7 +284,7 @@ class AdminThemesControllerCore extends AdminController
'type' => 'select', 'type' => 'select',
'name' => 'based_on', 'name' => 'based_on',
'label' => $this->l('Copy missing files from existing theme:'), 'label' => $this->l('Copy missing files from existing theme:'),
'desc' => $this->l('If you create a new theme, it\'s recommended that you use default theme files.'), 'hint' => $this->l('If you create a new theme, it\'s recommended that you use default theme files.'),
'options' => array( 'options' => array(
'id' => 'id', 'name' => 'name', 'id' => 'id', 'name' => 'name',
'default' => array('value' => 0, 'label' => '&nbsp;-&nbsp;'), 'default' => array('value' => 0, 'label' => '&nbsp;-&nbsp;'),
@@ -300,10 +299,9 @@ class AdminThemesControllerCore extends AdminController
'name' => 'directory', 'name' => 'directory',
'required' => true, 'required' => true,
'br' => true, 'br' => true,
'class' => 't',
'values' => $available_theme_dir, 'values' => $available_theme_dir,
'selected' => $selected_theme_dir, 'selected' => $selected_theme_dir,
'desc' => $this->l('Please select a valid theme directory.'), 'hint' => $this->l('Please select a valid theme directory.'),
); );
return parent::renderForm(); return parent::renderForm();