-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhelper.php
28 lines (26 loc) · 945 Bytes
/
helper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author lpaulsen93
*/
class helper_plugin_fields extends DokuWiki_Plugin {
function ODTSetUserField(&$renderer, $name, $value) {
if (!method_exists ($renderer, 'addUserField')) {
$name = $this->_fieldsODTFilterUserFieldName($name);
$renderer->fields[$name] = $value;
} else {
$renderer->addUserField($name, $value);
}
}
function ODTDisplayUserField(&$renderer, $name) {
if (!method_exists ($renderer, 'insertUserField')) {
$name = $this->_fieldsODTFilterUserFieldName($name);
if (array_key_exists($name, $renderer->fields)) {
return '<text:user-field-get text:name="'.$name.'">'.$renderer->fields[$name].'</text:user-field-get>';
}
} else {
$renderer->insertUserField($name);
}
return '';
}
}