Class eabi_dpd_parcelstore_html_helper
Allows to create label and input combinations by <span
class="php-var">$_html_template</span>
where each
get*Html
function creates exactly one input row.
each get*Html
function takes following arguments:
<span class="php-var">$fieldName</span>
- name attribute for designated input element<span class="php-var">$fieldData</span>
- assoc array containing data how to build the input element<span class="php-var">$value</span>
- if this field needs to set a value, then supply it here. Multiselects accept comma separated string values
<span class="php-var">$fieldData</span>
is in
following format:
-
'title' => label attribute for the form element, 'type' => text,textarea,select,multiselect,password are allowed field types. 'description' => if this field is filled, then it is displayed next to input, 'default' => default value for the current field, 'css' => form field elements style attribute, 'validate-if' => validation can be invoked based on conditions defined in assoc array('form-field-name' => 'expected-value', 'another-form-field-name' => 'another-value'), which are processed as <b>validate-if-any</b> is true. 'validate' => array of validation routine names, 'options' => assoc array of select,multiselect options,
When using methods, where smarty
is required, then context and
module instance need to be set.
public
|
|
public
|
#
setModuleInstance( ModuleCore $moduleInstance )
When you need to use smarty, then you need to supply the current module as parameter |
public
|
#
setContext( ContextCore $context )
Current modules context object, when needing to fetch templates from right directory. |
public
string
|
|
public
string
|
#
getPasswordHtml( string $fieldName, array $fieldData, mixed $value = false )
Gets input[type=password] HTML element |
public
string
|
#
getTextareaHtml( string $fieldName, array $fieldData, mixed $value = false )
Returns textarea form element HTML |
public
string
|
#
getSelectHtml( string $fieldName, array $fieldData, mixed $value = false )
Returns select form element HTML |
protected
|
|
public
string
|
#
getMultiselectHtml( string $fieldName, array $fieldData, mixed $value = false )
Returns select[multiple=multiple] form element HTML |
public
|
|
protected
array
|
|
protected
string
|
|
public
string
|
#
getCountrypriceHtml( string $fieldName, array $fieldData, mixed $value = false )
Returns template, which renders price depeding on country form element HTML includes template file:
includes javascript file: includes javascript file: |
public
string
|
#
getMultilangHtml( string $fieldName, array $fieldData, mixed $value = false )
Renders input[type=text] for default setting and then additional per language. Values are posted back as assoc array, where array key is id_language and string '0' for default setting |
public
string
|
#
getMultilangTextareaHtml( string $fieldName, array $fieldData, mixed $value = false )
Renders input[type=text] for default setting and then additional per language. Values are posted back as assoc array, where array key is id_language and string '0' for default setting |
public
|
protected static
|
$_helperModuleInstance |
|
|
protected
string
|
$_html_template | '<tr width="130" style="min-height: 35px;">
<td class="label">${LABEL}</td>
<td class="value">${INPUT}</td>
</tr>' |
#
Default HTML template, where ${LABEL} will be replaced with desired form element label and ${INPUT} will be replaced with desired input element. |
protected
ContextCore
|
$_context |
|
|
protected
ModuleCore
|
$_moduleInstance |
|