Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Form/DropdownElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ protected function mainElementHTML()
$html = '<select ' . buildAttributes($attr) . '>';
$html = array_reduce(
$this->optGroups,
function ($html, OptGroup $optGroup) {
return $html . $optGroup->toHTML();
},
static fn($html, OptGroup $optGroup) => $html . $optGroup->toHTML(),
$html
);
$html .= '</select>';
Expand Down
30 changes: 15 additions & 15 deletions bureaucracy_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/
class syntax_plugin_bureaucracy_field_dataplugin extends helper_plugin_bureaucracy_field
{
public $opt;
public $tpl;
public $error;
private $args = [];
private $additional;

Expand Down Expand Up @@ -113,21 +116,18 @@ public function renderfield($params, Doku_Form $form, $formid)
$this->additional['required'] = 'required';
}

$form->addElement(call_user_func_array(
'form_makeListboxField',
$this->_parse_tpl(
[
'@@NAME@@[]',
$params['args'],
$params['value'],
'@@DISPLAY@@',
'',
'@@CLASS@@',
$this->additional
],
$params
)
));
$form->addElement(form_makeListboxField(...$this->_parse_tpl(
[
'@@NAME@@[]',
$params['args'],
$params['value'],
'@@DISPLAY@@',
'',
'@@CLASS@@',
$this->additional
],
$params
)));
}
}

Expand Down
30 changes: 15 additions & 15 deletions helper/aliastextbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/
class helper_plugin_data_aliastextbox extends helper_plugin_bureaucracy_field
{
public $opt;
public $tpl;
public $error;
private $args;
private $additional;

Expand Down Expand Up @@ -108,21 +111,18 @@ public function renderfield($params, Doku_Form $form, $formid)
$this->additional['required'] = 'required';
}

$form->addElement(call_user_func_array(
'form_makeListboxField',
$this->_parse_tpl(
[
'@@NAME@@[]',
$params['args'],
$params['value'],
'@@DISPLAY@@',
'',
'@@CLASS@@',
$this->additional
],
$params
)
));
$form->addElement(form_makeListboxField(...$this->_parse_tpl(
[
'@@NAME@@[]',
$params['args'],
$params['value'],
'@@DISPLAY@@',
'',
'@@CLASS@@',
$this->additional
],
$params
)));
}
}

Expand Down
5 changes: 2 additions & 3 deletions syntax/entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,8 @@ public function saveData($data, $id, $title)
* @fixme replace this madness
* @return bool|mixed
*/
public function replaceQuery()
public function replaceQuery(...$args)
{
$args = func_get_args();
$argc = func_num_args();

if ($argc > 1) {
Expand All @@ -320,7 +319,7 @@ public function replaceQuery()
$sqlite = $this->dthlp->getDB();
if (!$sqlite) return false;

return call_user_func_array(array(&$sqlite, 'query'), $args);
return $sqlite->query(...$args);
}


Expand Down