xref: /plugin/struct/types/AbstractMultiBaseType.php (revision 717bfc62d049b0ffaef694932effb49d348f9256)
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     * @param string $name
18     * @param \string[] $rawvalues
19     * @param string $htmlID   a unique id to be referenced by the label
20     *
21     * @return string
22     */
23    public function multiValueEditor($name, $rawvalues, $htmlID) {
24        $value = join(', ', $rawvalues);
25
26        return
27            '<div class="multiwrap">' .
28            $this->valueEditor($name, $value, $htmlID) .
29            '</div>' .
30            '<small>' .
31            $this->getLang('multi') .
32            '</small>';
33    }
34
35}
36