Skip to content
Snippets Groups Projects
Commit 57d9f7d7 authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT
Browse files

fix customized input test

parent 8cb636d4
No related merge requests found
Pipeline #48909 passed with stage
in 44 minutes and 1 second
......@@ -244,7 +244,7 @@ class RechercheController extends ZendAfi_Controller_Action
// may use Class_ScriptLoader so must be called first
$html = $this->view->formMultiInputValue($this->_getParam('element'),
$this->_getParam('axe'),
$type,
$this->_getParam('id', bin2hex(random_bytes(8))),
$this->_getParam('value', ''),
$this->_getParam('set-aria', false),
......
......@@ -403,6 +403,13 @@ class Class_CriteresRecherche_AxesParamTypeAuthority
}
public function name() : string {
return sprintf('%s%s',
$this->_name,
$this->_root);
}
public function inputOptions() : array {
return ['facets' => Class_CodifThesaurus::CODE_FACETTE . $this->_root,
'tree_roots' => $this->_tree_roots];
......
......@@ -24,40 +24,19 @@
class ZendAfi_View_Helper_FormMultiInputValue extends ZendAfi_View_Helper_BaseHelper
{
public function formMultiInputValue(string $element_name,
string $axe_name,
?Class_CriteresRecherche_AxesParamType $type,
string $id_extension,
string $value,
bool $aria_enabled,
?Zend_Form $form = null
): string
{
if (!$type = (new Class_CriteresRecherche_AxesParamTypes)->typeFor(['name' => $axe_name]))
return '';
return $this->_render($element_name,
$type,
$axe_name,
$id_extension,
$value,
$aria_enabled,
$form);
}
protected function _render(string $element_name,
Class_CriteresRecherche_AxesParamType $type,
string $axe_name,
string $id_extension,
string $value,
bool $aria_enabled,
?Zend_Form $form
): string
{
if (!$form)
$form = new ZendAfi_Form;
$name = $element_name . '_' . $axe_name;
$name = $element_name . '_' . $type->name();
$id = $name . '_' . $id_extension;
xdebug_break();
$built_element = $form->createElement($type->input(),
$name,
array_merge(['id' => $id],
......
......@@ -131,10 +131,13 @@ class ZendAfi_View_Helper_Template_FormMultiInputFieldset extends ZendAfi_View_H
protected function _axeInput(): string
{
if (!$type = (new Class_CriteresRecherche_AxesParamTypes)->typeFor(['name' => $this->_name]))
return '';
return $this->view
->div(['class' => 'multi_input_value_col'],
$this->view->formMultiInputValue($this->_element_name,
$this->_name,
$type,
$this->_key,
$this->_value,
true,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment