Merge branch 'Daniil/chooserInterface' into 'master'
select + chooser form, main-folder on top of select list See merge request composer/PHP_Library!6
This commit is contained in:
commit
a8cfe7a685
2 changed files with 12 additions and 1 deletions
|
|
@ -93,7 +93,8 @@ class Form_Form extends View_View {
|
||||||
'radio' => 'Form_SelectOne',
|
'radio' => 'Form_SelectOne',
|
||||||
'filebrowser' => 'TComponentBrowserInput',
|
'filebrowser' => 'TComponentBrowserInput',
|
||||||
'documents' => 'TComponentBrowserInput',
|
'documents' => 'TComponentBrowserInput',
|
||||||
'chooser' => 'Form_Input'
|
'chooser' => 'Form_Input',
|
||||||
|
'select_chooser' => 'Form_SelectOne'
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,16 @@ class Form_OptionFactory {
|
||||||
if (isset($input['default'])) {
|
if (isset($input['default'])) {
|
||||||
array_unshift($field->options, ['value' => 0, 'name' => $input['default']]);
|
array_unshift($field->options, ['value' => 0, 'name' => $input['default']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ставим корневой каталог в начало списка (скорее всего он будет в конце массива)
|
||||||
|
if ($field->options)
|
||||||
|
{
|
||||||
|
$root_elem = array_pop($field->options);
|
||||||
|
if ($root_elem['value'] == '/')
|
||||||
|
array_unshift($field->options, $root_elem);
|
||||||
|
else
|
||||||
|
array_push($field->options, $root_elem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function optionsDB($key, $val, $res) {
|
public function optionsDB($key, $val, $res) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue