xref: /plugin/struct/types/AbstractMultiBaseType.php (revision 8ec87814898d9c0f4ea1082a8bacaa17ac6b1bf7)
1<?php
2
3namespace dokuwiki\plugin\struct\types;
4
5/**
6 * Class AbstractBaseType
7 *
8 * This class implements a standard multi editor that can be reused by user types. The multi-
9 * edit simply joins all values with commas
10 *
11 * @package dokuwiki\plugin\struct\types
12 * @see Column
13 */
14abstract class AbstractMultiBaseType extends AbstractBaseType
15{
16
17    /**
18     * @param string $name
19     * @param \string[] $rawvalues
20     * @param string $htmlID   a unique id to be referenced by the label
21     *
22     * @return string
23     */
24    public function multiValueEditor($name, $rawvalues, $htmlID)
25    {
26        $value = join(', ', $rawvalues);
27
28        return
29            '<div class="multiwrap">' .
30            $this->valueEditor($name, $value, $htmlID) .
31            '</div>' .
32            '<small>' .
33            $this->getLang('multi') .
34            '</small>';
35    }
36}
37