xref: /plugin/struct/types/AbstractMultiBaseType.php (revision 7234bfb14e712ff548d9266ef32fdcc8eaf2d04e)
15c36a1f6SAndreas Gohr<?php
25c36a1f6SAndreas Gohr
3ba766201SAndreas Gohrnamespace dokuwiki\plugin\struct\types;
45c36a1f6SAndreas Gohr
55c36a1f6SAndreas Gohr/**
65c36a1f6SAndreas Gohr * Class AbstractBaseType
75c36a1f6SAndreas Gohr *
85c36a1f6SAndreas Gohr * This class implements a standard multi editor that can be reused by user types. The multi-
95c36a1f6SAndreas Gohr * edit simply joins all values with commas
105c36a1f6SAndreas Gohr *
11ba766201SAndreas Gohr * @package dokuwiki\plugin\struct\types
125c36a1f6SAndreas Gohr * @see Column
135c36a1f6SAndreas Gohr */
14d6d97f60SAnna Dabrowskaabstract class AbstractMultiBaseType extends AbstractBaseType
15d6d97f60SAnna Dabrowska{
165c36a1f6SAndreas Gohr    /**
175c36a1f6SAndreas Gohr     * @param string $name
18c0230d2cSAndreas Gohr     * @param \string[] $rawvalues
19ee983135SMichael Große     * @param string $htmlID a unique id to be referenced by the label
20ee983135SMichael Große     *
215c36a1f6SAndreas Gohr     * @return string
225c36a1f6SAndreas Gohr     */
23d6d97f60SAnna Dabrowska    public function multiValueEditor($name, $rawvalues, $htmlID)
24d6d97f60SAnna Dabrowska    {
25*7234bfb1Ssplitbrain        $value = implode(', ', $rawvalues);
265c36a1f6SAndreas Gohr
275c36a1f6SAndreas Gohr        return
285c36a1f6SAndreas Gohr            '<div class="multiwrap">' .
29ee983135SMichael Große            $this->valueEditor($name, $value, $htmlID) .
305c36a1f6SAndreas Gohr            '</div>' .
315c36a1f6SAndreas Gohr            '<small>' .
325c36a1f6SAndreas Gohr            $this->getLang('multi') .
335c36a1f6SAndreas Gohr            '</small>';
345c36a1f6SAndreas Gohr    }
355c36a1f6SAndreas Gohr}
36