diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index d4e45f664d0d7..5ddb0337451ab 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -238,7 +238,6 @@ $target.html(max-$source.val().length); }); } - $(document).ready(function(){ countDown($("#{if isset($input.id)}{$input.id}{else}{$input.name}{/if}"), $("#{if isset($input.id)}{$input.id}{else}{$input.name}{/if}_counter")); }); @@ -247,7 +246,7 @@ {/if} {elseif $input.type == 'textbutton'} {assign var='value_text' value=$fields_value[$input.name]} -
+
{if isset($input.maxchar)}
diff --git a/controllers/admin/AdminPatternsController.php b/controllers/admin/AdminPatternsController.php index 42a275cc8bbb7..d6250598c1d43 100644 --- a/controllers/admin/AdminPatternsController.php +++ b/controllers/admin/AdminPatternsController.php @@ -42,6 +42,12 @@ public function viewAccess() public function renderForm() { + + $this->fields_value = array( + 'type_text' => 'with value', + 'type_text_readonly' => 'with value that you can\'t edit' + ); + $this->fields_form = array( 'legend' => array( 'title' => $this->l('patterns of helper form.tpl'), @@ -96,16 +102,11 @@ public function renderForm() 'name' => 'type_text_maxchar', 'maxchar' => 30 ), - array( - 'type' => 'text', - 'label' => $this->l('input text with suffix'), - 'name' => 'type_text_maxchar' - ), array( 'type' => 'text', 'lang' => true, 'label' => $this->l('input text multilang'), - 'name' => 'type_text_maxchar' + 'name' => 'type_text_multilang' ), array( 'type' => 'text', @@ -113,11 +114,79 @@ public function renderForm() 'readonly' => true, 'name' => 'type_text_readonly' ), + array( + 'type' => 'text', + 'label' => $this->l('input fixed-width-xs'), + 'name' => 'type_text_xs', + 'class' => 'input fixed-width-xs' + ), + array( + 'type' => 'text', + 'label' => $this->l('input fixed-width-sm'), + 'name' => 'type_text_sm', + 'class' => 'input fixed-width-sm' + ), + array( + 'type' => 'text', + 'label' => $this->l('input fixed-width-md'), + 'name' => 'type_text_md', + 'class' => 'input fixed-width-md' + ), + array( + 'type' => 'text', + 'label' => $this->l('input fixed-width-lg'), + 'name' => 'type_text_lg', + 'class' => 'input fixed-width-lg' + ), + array( + 'type' => 'text', + 'label' => $this->l('input fixed-width-xl'), + 'name' => 'type_text_xl', + 'class' => 'input fixed-width-xl' + ), + array( + 'type' => 'text', + 'label' => $this->l('input fixed-width-xxl'), + 'name' => 'type_text_xxl', + 'class' => 'fixed-width-xxl' + ), array( 'type' => 'tags', 'label' => $this->l('input tags'), 'name' => 'type_text_tags' ), + array( + 'type' => 'textbutton', + 'label' => $this->l('input with button'), + 'name' => 'type_textbutton', + 'button' => array( + 'label' => $this->l('do something'), + 'attributes' => array( + 'onclick' => 'alert(\'something done\');' + ) + ) + ), + array( + 'type' => 'select', + 'label' => $this->l('select'), + 'name' => 'type_select', + 'options' => array( + 'query' => Zone::getZones(), + 'id' => 'id_zone', + 'name' => 'name' + ), + ), + array( + 'type' => 'select', + 'label' => $this->l('select with chosen'), + 'name' => 'type_select_chosen', + 'class' => 'chosen', + 'options' => array( + 'query' => Country::getCountries((int)Context::getContext()->cookie->id_lang), + 'id' => 'id_zone', + 'name' => 'name' + ), + ), ), 'submit' => array( 'title' => $this->l('Save'),