Skip to content

feature: hidden fields in bueraucracy form from struct fields #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
22 changes: 22 additions & 0 deletions helper/fieldhidden.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Allows adding a single struct field as a bureaucracy hidden field
*
* This class is used when a field of the type struct_fieldhidden is encountered in the
* bureaucracy syntax.
*/
class helper_plugin_struct_fieldhidden extends helper_plugin_struct_field {
/**
* Render the field as XHTML
*
* Outputs the represented field using the passed Doku_Form object.
*
* @param array $params Additional HTML specific parameters
* @param Doku_Form $form The target Doku_Form object
* @param int $formid unique identifier of the form which contains this field
*/
function renderfield($params, Doku_Form $form, $formid) {
$this->_handlePreload();
$form->addHidden($params['name'], $this->getParam('value') . '');
}
}