xref: /plugin/struct/types/Text.php (revision 7fe2cdf28c472c686961bf42f0123eb33d2f3e60) !
1083afc55SAndreas Gohr<?php
2d6d97f60SAnna Dabrowska
3ba766201SAndreas Gohrnamespace dokuwiki\plugin\struct\types;
4083afc55SAndreas Gohr
5d6d97f60SAnna Dabrowskaclass Text extends AbstractMultiBaseType
6d6d97f60SAnna Dabrowska{
79ebd2ed6SAndreas Gohr    use TraitFilterPrefix;
8083afc55SAndreas Gohr
9*7fe2cdf2SAndreas Gohr    protected $config = [
10*7fe2cdf2SAndreas Gohr        'prefix' => '',
11*7fe2cdf2SAndreas Gohr        'postfix' => ''
12*7fe2cdf2SAndreas Gohr    ];
13083afc55SAndreas Gohr
14083afc55SAndreas Gohr    /**
15083afc55SAndreas Gohr     * Output the stored data
16083afc55SAndreas Gohr     *
17797f0dfeSAndreas Gohr     * @param string|int $value the value stored in the database
18797f0dfeSAndreas Gohr     * @param \Doku_Renderer $R the renderer currently used to render the data
19797f0dfeSAndreas Gohr     * @param string $mode The mode the output is rendered in (eg. XHTML)
20797f0dfeSAndreas Gohr     * @return bool true if $mode could be satisfied
21083afc55SAndreas Gohr     */
22d6d97f60SAnna Dabrowska    public function renderValue($value, \Doku_Renderer $R, $mode)
23d6d97f60SAnna Dabrowska    {
24797f0dfeSAndreas Gohr        $R->cdata($this->config['prefix'] . $value . $this->config['postfix']);
25797f0dfeSAndreas Gohr        return true;
26083afc55SAndreas Gohr    }
27083afc55SAndreas Gohr}
28