LSformElement :: textarea : small change to facilitate extend of this LSformElement

This commit is contained in:
Benjamin Renard 2011-04-11 11:10:09 +02:00
parent 64495f578f
commit 5983b264c7
3 changed files with 13 additions and 2 deletions

View file

@ -0,0 +1,4 @@
p.LSformElement_textarea {
margin: 0px;
}

View file

@ -33,6 +33,7 @@
class LSformElement_textarea extends LSformElement { class LSformElement_textarea extends LSformElement {
var $fieldTemplate = 'LSformElement_textarea_field.tpl'; var $fieldTemplate = 'LSformElement_textarea_field.tpl';
var $fieldTemplateExtraClass = '';
/** /**
* Retourne les infos d'affichage de l'élément * Retourne les infos d'affichage de l'élément
@ -52,7 +53,13 @@ class LSformElement_textarea extends LSformElement {
); );
LSsession :: addJSscript('LSformElement_textarea.js'); LSsession :: addJSscript('LSformElement_textarea.js');
} }
$return['html'] = $this -> fetchTemplate(); LSsession :: addCssFile('LSformElement_textarea.css');
$return['html'] = $this -> fetchTemplate(
NULL,
array (
'LSformElement_textarea_extra' => $this -> fieldTemplateExtraClass
)
);
return $return; return $return;
} }
} }

View file

@ -1,5 +1,5 @@
{if $freeze} {if $freeze}
{if $value}{$value}{else}{$noValueTxt}{/if} {if $value}<p class='LSformElement_textarea{if $LSformElement_textarea_extra} {$LSformElement_textarea_extra}{/if}'>{$value}</p>{else}{$noValueTxt}{/if}
{else} {else}
<textarea name='{$attr_name}[]' class='LSform'>{$value}</textarea> <textarea name='{$attr_name}[]' class='LSform'>{$value}</textarea>
{/if} {/if}