Files
dokuwiki-plugin-struct/types/AbstractMultiBaseType.php
2023-09-13 09:45:56 +00:00

36 lines
869 B
PHP

<?php
namespace dokuwiki\plugin\struct\types;
/**
* Class AbstractBaseType
*
* This class implements a standard multi editor that can be reused by user types. The multi-
* edit simply joins all values with commas
*
* @package dokuwiki\plugin\struct\types
* @see Column
*/
abstract class AbstractMultiBaseType extends AbstractBaseType
{
/**
* @param string $name
* @param \string[] $rawvalues
* @param string $htmlID a unique id to be referenced by the label
*
* @return string
*/
public function multiValueEditor($name, $rawvalues, $htmlID)
{
$value = implode(', ', $rawvalues);
return
'<div class="multiwrap">' .
$this->valueEditor($name, $value, $htmlID) .
'</div>' .
'<small>' .
$this->getLang('multi') .
'</small>';
}
}