juergen-aus-zuendorf Finally your suggestion didn't work for me. However I found, that I can modify syntax.php
to print out the HTML form before the result of the posted form. See the additional $R->doc .= $this->_htmlform($data['fields'])
below:
public function render($format, Doku_Renderer $R, $data) {
if($format != 'xhtml') return false;
$R->info['cache'] = false; // don't cache
/**
* replace some time and name placeholders in the default values
* @var $field helper_plugin_bureaucracy_field
*/
foreach($data['fields'] as &$field) {
if(isset($field->opt['value'])) {
$field->opt['value'] = $this->replace($field->opt['value']);
}
}
if($data['labels']) $this->loadlabels($data);
$this->form_id++;
if(isset($_POST['bureaucracy']) && checkSecurityToken() && $_POST['bureaucracy']['$$id'] == $this->form_id) {
$success = $this->_handlepost($data);
if($success !== false) {
# render the form prior to printing out the result
$R->doc .= $this->_htmlform($data['fields']);
$R->doc .= '<div class="bureaucracy__plugin" id="scroll__here">' . $success . '</div>';
return true;
}
}
$R->doc .= $this->_htmlform($data['fields']);
return true;
}
For the time being that works just fine for me, but I will try to make this configurable per form and also solve some smaller things (clear the fields before printing the form ecc.)
Thanks anyway for your suggestion, which brought me to this idea.