[+] BO : added new input type tags
This commit is contained in:
@@ -72,15 +72,33 @@
|
||||
{block name="start_field_block"}
|
||||
<div class="margin-form">
|
||||
{/block}
|
||||
{if $input.type == 'text'}
|
||||
{if $input.type == 'text' || $input.type == 'tags'}
|
||||
{if isset($input.lang)}
|
||||
<div class="translatable">
|
||||
{foreach $languages as $language}
|
||||
<div class="lang_{$language.id_lang}" style="display:{if $language.id_lang == $defaultFormLanguage}block{else}none{/if}; float: left;">
|
||||
|
||||
{if $input.type == 'tags'}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
$().ready(function () {
|
||||
var input_id = '{/literal}{if isset($input.id)}{$input.id}_{$language.id_lang}{else}{$input.name}_{$language.id_lang}{/if}{literal}';
|
||||
$('#'+input_id).tagify({addTagPrompt: '{/literal}{l s='add tag'}{literal}'});
|
||||
$({/literal}'#{$table}{literal}_form').submit( function() {
|
||||
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
{/if}
|
||||
<input type="text"
|
||||
name="{$input.name}_{$language.id_lang}"
|
||||
id="{if isset($input.id)}{$input.id}_{$language.id_lang}{else}{$input.name}_{$language.id_lang}{/if}"
|
||||
value="{$fields_value[$input.name][$language.id_lang]}"
|
||||
class="{if $input.type == 'tags'}tagify {/if}"
|
||||
{if isset($input.size)}size="{$input.size}"{/if}
|
||||
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if}
|
||||
{if isset($input.class)}class="{$input.class}"{/if}
|
||||
@@ -91,10 +109,26 @@
|
||||
{/foreach}
|
||||
</div>
|
||||
{else}
|
||||
{if $input.type == 'tags'}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
$().ready(function () {
|
||||
var input_id = '{/literal}{if isset($input.id)}{$input.id}{else}{$input.name}{/if}{literal}';
|
||||
$('#'+input_id).tagify();
|
||||
$('#'+input_id).tagify({addTagPrompt: '{/literal}{l s='Add tag'}{literal}'});
|
||||
$({/literal}'#{$table}{literal}_form').submit( function() {
|
||||
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
{/if}
|
||||
<input type="text"
|
||||
name="{$input.name}"
|
||||
id="{if isset($input.id)}{$input.id}{else}{$input.name}{/if}"
|
||||
value="{$fields_value[$input.name]}"
|
||||
class="{if $input.type == 'tags'}tagify {/if}"
|
||||
{if isset($input.size)}size="{$input.size}"{/if}
|
||||
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if}
|
||||
{if isset($input.class)}class="{$input.class}"{/if}
|
||||
|
||||
@@ -87,6 +87,13 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJqueryUi('ui.widget');
|
||||
$this->addJqueryPlugin('tagify');
|
||||
}
|
||||
|
||||
public function initList()
|
||||
{
|
||||
@@ -259,7 +266,7 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
'hint' => $this->l('Forbidden characters:').' <>;=#{}'
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'type' => 'tags',
|
||||
'label' => $this->l('Meta keywords:'),
|
||||
'name' => 'meta_keywords',
|
||||
'lang' => true,
|
||||
|
||||
@@ -89,7 +89,13 @@ class AdminManufacturersControllerCore extends AdminController
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJqueryUi('ui.widget');
|
||||
$this->addJqueryPlugin('tagify');
|
||||
}
|
||||
|
||||
public function initListManufacturer()
|
||||
{
|
||||
@@ -284,7 +290,7 @@ class AdminManufacturersControllerCore extends AdminController
|
||||
'hint' => $this->l('Forbidden characters:').' <>;=#{}'
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'type' => 'tags',
|
||||
'label' => $this->l('Meta keywords:'),
|
||||
'name' => 'meta_keywords',
|
||||
'lang' => true,
|
||||
|
||||
@@ -76,7 +76,14 @@ class AdminMetaControllerCore extends AdminController
|
||||
$this->options['routes']['submit'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJqueryUi('ui.widget');
|
||||
$this->addJqueryPlugin('tagify');
|
||||
}
|
||||
|
||||
public function addFieldRoute($routeID, $title)
|
||||
{
|
||||
$keywords = array();
|
||||
@@ -122,7 +129,6 @@ class AdminMetaControllerCore extends AdminController
|
||||
'desc' => $this->l('Name of the related page'),
|
||||
'required' => true,
|
||||
'empty_message' => '<p>'.$this->l('There is no page available!').'</p>',
|
||||
'size' => 30
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
@@ -143,7 +149,7 @@ class AdminMetaControllerCore extends AdminController
|
||||
'size' => 50
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'type' => 'tags',
|
||||
'label' => $this->l('Meta keywords:'),
|
||||
'name' => 'keywords',
|
||||
'lang' => true,
|
||||
|
||||
@@ -53,7 +53,14 @@ class AdminSuppliersControllerCore extends AdminController
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJqueryUi('ui.widget');
|
||||
$this->addJqueryPlugin('tagify');
|
||||
}
|
||||
|
||||
public function initForm()
|
||||
{
|
||||
$this->fields_form = array(
|
||||
@@ -101,7 +108,7 @@ class AdminSuppliersControllerCore extends AdminController
|
||||
'hint' => $this->l('Forbidden characters:').' <>;=#{}'
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'type' => 'tags',
|
||||
'label' => $this->l('Meta keywords:'),
|
||||
'name' => 'meta_keywords',
|
||||
'lang' => true,
|
||||
|
||||
Reference in New Issue
Block a user