[*] BO : #PSFV-94 - added AdminCurrencuesController
This commit is contained in:
@@ -1,247 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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 <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 7300 $
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
include_once(_PS_ADMIN_DIR_.'/../classes/AdminTab.php');
|
||||
|
||||
class AdminCurrencies extends AdminTab
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = 'currency';
|
||||
$this->className = 'Currency';
|
||||
$this->lang = false;
|
||||
$this->edit = true;
|
||||
$this->delete = true;
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_currency' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'name' => array('title' => $this->l('Currency'), 'width' => 100),
|
||||
'iso_code' => array('title' => $this->l('ISO code'), 'align' => 'center', 'width' => 35),
|
||||
'iso_code_num' => array('title' => $this->l('ISO code num'), 'align' => 'center', 'width' => 35),
|
||||
'sign' => array('title' => $this->l('Symbol'), 'width' => 20, 'align' => 'center', 'orderby' => false, 'search' => false),
|
||||
'conversion_rate' => array('title' => $this->l('Conversion rate'), 'float' => true, 'align' => 'center', 'width' => 50, 'search' => false),
|
||||
'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false),
|
||||
);
|
||||
$this->_where = 'AND a.`deleted` = 0';
|
||||
|
||||
$this->optionsList = array(
|
||||
'general' => array(
|
||||
'title' => $this->l('Currencies options'),
|
||||
'fields' => array(
|
||||
'PS_CURRENCY_DEFAULT' => array(
|
||||
'title' => $this->l('Default currency:'),
|
||||
'desc' => $this->l('The default currency used in shop')
|
||||
.'<div class=warn"><img src="../img/admin/warn2.png" />'.$this->l('If you change default currency, you will have to manually edit every product price.').'</div>',
|
||||
'cast' => 'intval',
|
||||
'type' => 'select',
|
||||
'identifier' => 'id_currency',
|
||||
'list' => Currency::getCurrencies()
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (isset($_GET['delete'.$this->table]))
|
||||
{
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
{
|
||||
if (Validate::isLoadedObject($object = $this->loadObject()))
|
||||
{
|
||||
if ($object->id == Configuration::get('PS_CURRENCY_DEFAULT'))
|
||||
$this->_errors[] = $this->l('You can\'t delete the default currency');
|
||||
elseif ($object->delete())
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=1'.'&token='.$this->token);
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('An error occurred during deletion.');
|
||||
}
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
|
||||
}
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('You do not have permission to delete here.');
|
||||
}
|
||||
elseif ((isset($_GET['status'.$this->table]) OR isset($_GET['status'])) AND Tools::getValue($this->identifier))
|
||||
{
|
||||
if ($this->tabAccess['edit'] === '1')
|
||||
{
|
||||
if (Validate::isLoadedObject($object = $this->loadObject()))
|
||||
{
|
||||
if ($object->active AND $object->id == Configuration::get('PS_CURRENCY_DEFAULT'))
|
||||
$this->_errors[] = $this->l('You can\'t disable the default currency');
|
||||
elseif ($object->toggleStatus())
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$this->token);
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('An error occurred while updating status.');
|
||||
}
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
|
||||
}
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
|
||||
}
|
||||
elseif (Tools::isSubmit('submitExchangesRates'))
|
||||
{
|
||||
if (!$this->_errors[] = Currency::refreshCurrencies())
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=6'.'&token='.$this->token);
|
||||
}
|
||||
else
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
public function updateOptionPsCurrencyDefault($value)
|
||||
{
|
||||
Configuration::updateValue('PS_CURRENCY_DEFAULT', $value);
|
||||
Currency::refreshCurrencies();
|
||||
}
|
||||
|
||||
public function displayOptionsList()
|
||||
{
|
||||
parent::displayOptionsList();
|
||||
|
||||
$dir = explode(DIRECTORY_SEPARATOR, dirname(__FILE__));
|
||||
for ($i = 0; $i < 2; ++$i)
|
||||
$adminDir = array_pop($dir);
|
||||
|
||||
echo '<br /><br />
|
||||
<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/exchangesrate.gif" />'.$this->l('Currency rates').'</legend>
|
||||
<label>'.$this->l('Update currency rates').'</label>
|
||||
<div class="margin-form">
|
||||
<p>'.$this->l('Update your currencies exchanges rates with a real-time tool').'</p>
|
||||
</div>
|
||||
<div class="margin-form">
|
||||
<input type="submit" value="'.$this->l('Update currency rates').'" name="submitExchangesRates" class="button" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>';
|
||||
echo '<br /></br />
|
||||
<fieldset>
|
||||
<legend><img src="../img/admin/tab-tools.gif" />'.$this->l('Currency rates update').'</legend>
|
||||
<p>'.$this->l('Place this URL in crontab or call it manually daily').':<br />
|
||||
<b>'.Tools::getShopDomain(true, true). __PS_BASE_URI__.$adminDir.'/cron_currency_rates.php?secure_key='.md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME')).'</b></p>
|
||||
</fieldset>';
|
||||
}
|
||||
|
||||
public function displayForm($isMainTab = true)
|
||||
{
|
||||
parent::displayForm();
|
||||
|
||||
if (!($obj = $this->loadObject(true)))
|
||||
return;
|
||||
|
||||
echo '
|
||||
<form action="'.self::$currentIndex.'&submitAdd'.$this->table.'=1&token='.$this->token.'" method="post">
|
||||
'.($obj->id ? '<input type="hidden" name="id_'.$this->table.'" value="'.$obj->id.'" />' : '').'
|
||||
<fieldset><legend><img src="../img/admin/money.gif" />'.$this->l('Currencies').'</legend>
|
||||
<label>'.$this->l('Currency:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="30" maxlength="32" name="name" value="'.htmlentities($this->getFieldValue($obj, 'name'), ENT_COMPAT, 'UTF-8').'" /> <sup>*</sup>
|
||||
<span class="hint" name="help_box">'.$this->l('Only letters and the minus character are allowed').'<span class="hint-pointer"> </span></span>
|
||||
<p class="clear">'.$this->l('Will appear on Front Office, e.g., euro, dollar').'...</p>
|
||||
</div>
|
||||
<label>'.$this->l('ISO code:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="30" maxlength="32" name="iso_code" value="'.htmlentities($this->getFieldValue($obj, 'iso_code'), ENT_COMPAT, 'UTF-8').'" /> <sup>*</sup>
|
||||
<span class="hint-pointer"> </span>
|
||||
<p class="clear">'.$this->l('ISO code, e.g., USD for dollar, EUR for euro').'...</p>
|
||||
</div>
|
||||
<label>'.$this->l('Numeric ISO code:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="30" maxlength="32" name="iso_code_num" value="'.htmlentities($this->getFieldValue($obj, 'iso_code_num'), ENT_COMPAT, 'UTF-8').'" /> <sup>*</sup>
|
||||
<span class="hint-pointer"> </span>
|
||||
<p class="clear">'.$this->l('Numeric ISO code, e.g., 840 for dollar, 978 for euro').'...</p>
|
||||
</div>
|
||||
<label>'.$this->l('Symbol:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="3" maxlength="8" name="sign" value="'.$this->getFieldValue($obj, 'sign').'" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Will appear on Front Office, e.g., €, $').'...</p>
|
||||
</div>
|
||||
<label>'.$this->l('Conversion rate:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="3" maxlength="11" name="conversion_rate" value="'.htmlentities($this->getFieldValue($obj, 'conversion_rate')).'" /> <sup>*</sup>
|
||||
<p class="clear">'.$this->l('Conversion rate from one unit of your shop\'s default currency (for example, 1€) to this currency. For example, if the default currency is euros and this currency is dollars, type \'1.20\'').' 1€ = $1.20</p>
|
||||
</div>
|
||||
<label>'.$this->l('Formatting:').' </label>
|
||||
<div class="margin-form">
|
||||
<select name="format">';
|
||||
$currency_formats = array(
|
||||
1 => 'X0,000.00 ('.$this->l('as with dollars').')',
|
||||
2 => '0 000,00X ('.$this->l('as with euros').')',
|
||||
3 => 'X0.000,00',
|
||||
4 => '0,000.00X',
|
||||
);
|
||||
foreach ($currency_formats AS $nb => $desc)
|
||||
echo '<option value="'.$nb.'"'.($this->getFieldValue($obj, 'format') == $nb ? 'selected="selected"' : '').'>'.$desc.'</option>';
|
||||
echo '
|
||||
</select>
|
||||
<p class="clear">'.$this->l('Applies to all prices, e.g.,').' $1,240.15</p>
|
||||
</div>
|
||||
<label>'.$this->l('Decimals:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="decimals" id="decimals_on" value="1" '.($this->getFieldValue($obj, 'decimals') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="decimals_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Yes').'" title="'.$this->l('Yes').'" /></label>
|
||||
<input type="radio" name="decimals" id="decimals_off" value="0" '.(!$this->getFieldValue($obj, 'decimals') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="decimals_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('No').'" title="'.$this->l('No').'" /></label>
|
||||
<p>'.$this->l('Display decimals on prices').'</p>
|
||||
</div>
|
||||
<label>'.$this->l('Blank:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="blank" id="blank_on" value="1" '.($this->getFieldValue($obj, 'blank') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="blank_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Enabled').'" /></label>
|
||||
<input type="radio" name="blank" id="blank_off" value="0" '.(!$this->getFieldValue($obj, 'blank') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="blank_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||
<p>'.$this->l('Include a blank between sign and price, e.g.,').'<br />$1,240.15 -> $ 1,240.15</p>
|
||||
</div>
|
||||
<label>'.$this->l('Enable:').' </label>
|
||||
<div class="margin-form">
|
||||
<input type="radio" name="active" id="active_on" value="1" '.($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="'.$this->l('Enabled').'" title="'.$this->l('Enabled').'" /></label>
|
||||
<input type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
|
||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||
</div>';
|
||||
if (Shop::isMultiShopActivated())
|
||||
{
|
||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||
$this->displayAssoShop();
|
||||
echo '</div>';
|
||||
}
|
||||
echo '
|
||||
<div class="margin-form">
|
||||
<input type="submit" value="'.$this->l(' Save ').'" name="submitAdd'.$this->table.'" class="button" />
|
||||
</div>
|
||||
<div class="small"><sup>*</sup> '.$this->l('Required field').'</div>
|
||||
</fieldset>
|
||||
</form>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +204,11 @@
|
||||
{elseif $input.type == 'file'}
|
||||
<input type="file" name="{$input.name}" />
|
||||
<img src="{$fields_value[$input.name]}" />
|
||||
{elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop}
|
||||
<label>{l s='Shop association:'}</label>
|
||||
<div class="margin-form">
|
||||
{$asso_shop}
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($input.required) && $input.required} <sup>*</sup>{/if}
|
||||
{if isset($input.p)}
|
||||
|
||||
@@ -25,130 +25,139 @@
|
||||
*}
|
||||
<br />
|
||||
<form action="{$current}&submitOptions{$table}=1&token={$token}" method="post" enctype="multipart/form-data">
|
||||
{foreach $optionsList AS $category => $categoryData}
|
||||
{if isset($categoryData['top'])}{$categoryData['top']}{/if}
|
||||
<fieldset {if isset($categoryData['class'])}class="{$categoryData['class']}"{/if}>
|
||||
{* Options category title *}
|
||||
<legend>
|
||||
<img src="{$img_legend}"/>
|
||||
{if isset($categoryData['title'])}{$categoryData['title']}{else}{l s='Options'}{/if}
|
||||
</legend>
|
||||
|
||||
{* Category description *}
|
||||
{if (isset($categoryData['description']) && $categoryData['description'])}
|
||||
<p class="optionsDescription">{$categoryData['description']}</p>
|
||||
{/if}
|
||||
|
||||
{foreach $categoryData['fields'] AS $key => $field}
|
||||
<div style="clear: both; padding-top:15px;" id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}>
|
||||
{if $field['title']}
|
||||
<label class="conf_title">
|
||||
{if (isset($field['required']) && $field['required'])}
|
||||
<sup>*</sup>
|
||||
{/if}
|
||||
{$field['title']}</label>
|
||||
{foreach $option_list AS $category => $categoryData}
|
||||
{if isset($categoryData['top'])}{$categoryData['top']}{/if}
|
||||
<fieldset {if isset($categoryData['class'])}class="{$categoryData['class']}"{/if}>
|
||||
{* Options category title *}
|
||||
<legend>
|
||||
<img src="{$categoryData['image']}"/>
|
||||
{if isset($categoryData['title'])}{$categoryData['title']}{else}{l s='Options'}{/if}
|
||||
</legend>
|
||||
|
||||
{* Category description *}
|
||||
{if (isset($categoryData['description']) && $categoryData['description'])}
|
||||
<p class="optionsDescription">{$categoryData['description']}</p>
|
||||
{/if}
|
||||
<div class="margin-form">
|
||||
|
||||
{if $field['type'] == 'select'}
|
||||
<select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}">
|
||||
{foreach $field['list'] AS $k => $option}
|
||||
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
|
||||
{* Category info *}
|
||||
{if (isset($categoryData['info']) && $categoryData['info'])}
|
||||
<p>{$categoryData['info']}</p>
|
||||
{/if}
|
||||
|
||||
{foreach $categoryData['fields'] AS $key => $field}
|
||||
<div style="clear: both; padding-top:15px;" id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}>
|
||||
{if $field['title']}
|
||||
<label class="conf_title">
|
||||
{if (isset($field['required']) && $field['required'])}
|
||||
<sup>*</sup>
|
||||
{/if}
|
||||
{$field['title']}</label>
|
||||
{/if}
|
||||
<div class="margin-form">
|
||||
|
||||
{if $field['type'] == 'select'}
|
||||
<select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}">
|
||||
{foreach $field['list'] AS $k => $option}
|
||||
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{elseif $field['type'] == 'bool'}
|
||||
<label class="t" for="{$key}_on"><img src="../img/admin/enabled.gif" alt="{l s='Yes'}" title="{l s='Yes'}" /></label>
|
||||
<input type="radio" name="{$key}" id="{$key}_on" value="1" {if $field['value']} checked="checked"{/if}{if isset($field['js']['on'])} {$field['js']['on']}{/if}/>
|
||||
<label class="t" for="{$key}_on"> {l s='Yes'}</label>
|
||||
<label class="t" for="{$key}_off"><img src="../img/admin/disabled.gif" alt="{l s='No'}" title="{l s='No'}" style="margin-left: 10px;" /></label>
|
||||
<input type="radio" name="{$key}" id="{$key}_off" value="0" {if !$field['value']} checked="checked"{/if}{if isset($field['js']['off'])} {$field['js']['off']}{/if}/>
|
||||
<label class="t" for="{$key}_off"> {l s='No'}</label>
|
||||
{elseif $field['type'] == 'radio'}
|
||||
{foreach $field['choices'] AS $k => $v}
|
||||
<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="t" for="{$key}_{$k}"> {$v}</label><br />
|
||||
{/foreach}
|
||||
</select>
|
||||
{elseif $field['type'] == 'bool'}
|
||||
<label class="t" for="{$key}_on"><img src="../img/admin/enabled.gif" alt="{l s='Yes'}" title="{l s='Yes'}" /></label>
|
||||
<input type="radio" name="{$key}" id="{$key}_on" value="1" {if $field['value']} checked="checked"{/if}{if isset($field['js']['on'])} {$field['js']['on']}{/if}/>
|
||||
<label class="t" for="{$key}_on"> {l s='Yes'}</label>
|
||||
<label class="t" for="{$key}_off"><img src="../img/admin/disabled.gif" alt="{l s='No'}" title="{l s='No'}" style="margin-left: 10px;" /></label>
|
||||
<input type="radio" name="{$key}" id="{$key}_off" value="0" {if !$field['value']} checked="checked"{/if}{if isset($field['js']['off'])} {$field['js']['off']}{/if}/>
|
||||
<label class="t" for="{$key}_off"> {l s='No'}</label>
|
||||
{elseif $field['type'] == 'radio'}
|
||||
{foreach $field['choices'] AS $k => $v}
|
||||
<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="t" for="{$key}_{$k}"> {$v}</label><br />
|
||||
{/foreach}
|
||||
<br />
|
||||
{*{elseif $field['type'] == 'checkbox'}
|
||||
{foreach $field['choices'] AS $k => $v}
|
||||
<input type="checkbox" name="{$key}" id="{$key}{$k}_on" value="{$k|intval}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
|
||||
<label class="t" for="{$key}{$k}_on"> {$v}</label><br />
|
||||
{/foreach}
|
||||
<br />
|
||||
<br />
|
||||
{*{elseif $field['type'] == 'checkbox'}
|
||||
{foreach $field['choices'] AS $k => $v}
|
||||
<input type="checkbox" name="{$key}" id="{$key}{$k}_on" value="{$k|intval}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
|
||||
<label class="t" for="{$key}{$k}_on"> {$v}</label><br />
|
||||
{/foreach}
|
||||
<br />
|
||||
*}
|
||||
{elseif $field['type'] == 'text'}
|
||||
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />
|
||||
{if isset($field['next'])} {$field['next']|strval}{/if}
|
||||
{elseif $field['type'] == 'password'}
|
||||
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="" />
|
||||
{if isset($field['next'])} {$field['next']|strval}{/if}
|
||||
{elseif $field['type'] == 'textarea'}
|
||||
<textarea name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'htmlall':'UTF-8'}</textarea>
|
||||
{elseif $field['type'] == 'file'}
|
||||
{if isset($field['thumb']) && $field['thumb'] && $field['thumb']['pos'] == 'before'}
|
||||
<img src="{$field['thumb']['file']}" alt="{$field['title']}" title="{$field['title']}" /><br />
|
||||
{/if}
|
||||
<input type="file" name="{$key}" />
|
||||
{* {elseif $field['type'] == 'image'}
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
$i = 0;
|
||||
foreach ($field['list'] as $theme)
|
||||
{
|
||||
<td class="center" style="width: 180px; padding:0px 20px 20px 0px;">
|
||||
<input type="radio" name="{$key}" id="{$key}_{$theme['name']}_on" style="vertical-align: text-bottom;" value="{$theme['name']}"'.(_THEME_NAME_ == $theme['name'] ? 'checked="checked"' : '').' />';
|
||||
echo '<label class="t" for="{$key}_'.$theme['name'].'_on"> '.Tools::strtolower($theme['name']).'</label>';
|
||||
echo '<br />';
|
||||
echo '<label class="t" for="{$key}_'.$theme['name'].'_on">';
|
||||
echo '<img src="../themes/'.$theme['name'].'/preview.jpg" alt="'.Tools::strtolower($theme['name']).'">';
|
||||
echo '</label>';
|
||||
echo '</td>';
|
||||
if (isset($field['max']) && ($i +1 ) % $field['max'] == 0)
|
||||
echo '</tr><tr>';
|
||||
$i++;
|
||||
}
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
*}
|
||||
{elseif $field['type'] == 'text'}
|
||||
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />
|
||||
{if isset($field['next'])} {$field['next']|strval}{/if}
|
||||
{elseif $field['type'] == 'password'}
|
||||
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="" />
|
||||
{if isset($field['next'])} {$field['next']|strval}{/if}
|
||||
{elseif $field['type'] == 'textarea'}
|
||||
<textarea name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'htmlall':'UTF-8'}</textarea>
|
||||
{elseif $field['type'] == 'file'}
|
||||
{if isset($field['thumb']) && $field['thumb'] && $field['thumb']['pos'] == 'before'}
|
||||
<img src="{$field['thumb']['file']}" alt="{$field['title']}" title="{$field['title']}" /><br />
|
||||
{elseif $field['type'] == 'textLang'}
|
||||
{foreach $field['languages'] AS $id_lang => $value}
|
||||
<div id="{$key}_{$id_lang}" style="margin-bottom:8px; display: {if $id_lang == $current_id_lang}'block'{else}'none'{/if}; float: left; vertical-align: top;">
|
||||
<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}_{$id_lang}" value="{$value}" />
|
||||
</div>
|
||||
{/foreach}
|
||||
{$field['flags']}
|
||||
{elseif $field['type'] == 'textareaLang'}
|
||||
{foreach $field['languages'] AS $id_lang => $value}
|
||||
<div id="{$key}_{$id_lang}" style="display: {if $id_lang == $current_id_lang}block{else}none{/if}; float: left;">
|
||||
<textarea rows="{$field['rows']}" cols="{$field['cols']|intval}" name="{$key}_{$id_lang}">{$value|replace:'\r\n':"\n"}</textarea>
|
||||
</div>
|
||||
{/foreach}
|
||||
{$field['flags']}
|
||||
<br style="clear:both">
|
||||
|
||||
|
||||
{/if}
|
||||
<input type="file" name="{$key}" />
|
||||
{* {elseif $field['type'] == 'image'}
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
$i = 0;
|
||||
foreach ($field['list'] as $theme)
|
||||
{
|
||||
<td class="center" style="width: 180px; padding:0px 20px 20px 0px;">
|
||||
<input type="radio" name="{$key}" id="{$key}_{$theme['name']}_on" style="vertical-align: text-bottom;" value="{$theme['name']}"'.(_THEME_NAME_ == $theme['name'] ? 'checked="checked"' : '').' />';
|
||||
echo '<label class="t" for="{$key}_'.$theme['name'].'_on"> '.Tools::strtolower($theme['name']).'</label>';
|
||||
echo '<br />';
|
||||
echo '<label class="t" for="{$key}_'.$theme['name'].'_on">';
|
||||
echo '<img src="../themes/'.$theme['name'].'/preview.jpg" alt="'.Tools::strtolower($theme['name']).'">';
|
||||
echo '</label>';
|
||||
echo '</td>';
|
||||
if (isset($field['max']) && ($i +1 ) % $field['max'] == 0)
|
||||
echo '</tr><tr>';
|
||||
$i++;
|
||||
}
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
*}
|
||||
{elseif $field['type'] == 'textLang'}
|
||||
{foreach $field['languages'] AS $id_lang => $value}
|
||||
<div id="{$key}_{$id_lang}" style="margin-bottom:8px; display: {if $id_lang == $current_id_lang}'block'{else}'none'{/if}; float: left; vertical-align: top;">
|
||||
<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}_{$id_lang}" value="{$value}" />
|
||||
{if isset($field['method'])}$field['method']{/if}
|
||||
|
||||
{if ($field['multishop_default'])}
|
||||
<div class="preference_default_multishop">
|
||||
<label>
|
||||
<input type="checkbox" name="configUseDefault['{$key}']" value="1" {if $field['is_disabled']} checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" /> {l s='Use default value'}
|
||||
</label>
|
||||
</div>
|
||||
{/foreach}
|
||||
{$field['flags']}
|
||||
{elseif $field['type'] == 'textareaLang'}
|
||||
{foreach $field['languages'] AS $id_lang => $value}
|
||||
<div id="{$key}_{$id_lang}" style="display: {if $id_lang == $current_id_lang}block{else}none{/if}; float: left;">
|
||||
<textarea rows="{$field['rows']}" cols="{$field['cols']|intval}" name="{$key}_{$id_lang}">{$value|replace:'\r\n':"\n"}</textarea>
|
||||
</div>
|
||||
{/foreach}
|
||||
{$field['flags']}
|
||||
<br style="clear:both">
|
||||
|
||||
|
||||
{/if}
|
||||
{if isset($field['method'])}$field['method']{/if}
|
||||
|
||||
{if ($field['multishop_default'])}
|
||||
<div class="preference_default_multishop">
|
||||
<label>
|
||||
<input type="checkbox" name="configUseDefault['{$key}']" value="1" {if $field['is_disabled']} checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" /> {l s='Use default value'}
|
||||
</label>
|
||||
{/if}
|
||||
{if isset($field['desc'])}<p class="preference_description">{$field['desc']}</p>{/if}
|
||||
{if $field['is_invisible']}<p class="multishop_warning">{l s='You can\'t change the value of this configuration field in this shop context'}</p>{/if}
|
||||
</div></div>
|
||||
{/foreach}
|
||||
{if isset($categoryData['submit'])}
|
||||
<div class="margin-form">
|
||||
<input type="submit"
|
||||
value="{if isset($categoryData['submit']['title'])}{$categoryData['submit']['title']}{else}{l s=' Save '}{/if}"
|
||||
name="{if isset($categoryData['submit']['name'])}$categoryData['submit']['name']{else}submit{$category|ucfirst}{$table}{/if}"
|
||||
class="{if isset($categoryData['submit']['class'])}{$categoryData['submit']['class']}{else}button{/if}"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($field['desc'])}<p class="preference_description">{$field['desc']}</p>{/if}
|
||||
{if $field['is_invisible']}<p class="multishop_warning">{l s='You can\'t change the value of this configuration field in this shop context'}</p>{/if}
|
||||
</div></div>
|
||||
{if $field['required']}
|
||||
<div class="small"><sup>*</sup> {l s='Required field'}</div>
|
||||
{/if}
|
||||
</fieldset><br />
|
||||
{if isset($categoryData['bottom'])}{$categoryData['bottom']}{/if}
|
||||
{/foreach}
|
||||
|
||||
<div align="center" style="margin-top: 20px;">
|
||||
<input type="submit" value="{l s=' Save '}" name="submit{$category|ucfirst}{$table}" class="button" />
|
||||
</div>
|
||||
{if $field['required']}
|
||||
<div class="small"><sup>*</sup> {l s='Required field'}</div>
|
||||
{/if}
|
||||
</fieldset><br />
|
||||
{if isset($categoryData['bottom'])}{$categoryData['bottom']}{/if}
|
||||
{/foreach}
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user