Source of file ColorPickerField.php
Size: 0,835 Bytes - Last Modified: 2021-12-23T10:28:54+00:00
/var/www/docs.ssmods.com/process/src/src/Forms/ColorPickerField.php
12345678910111213141516171819202122232425262728293031323334 | <?php namespace SilverStripe\Colorpicker\Forms; use SilverStripe\Forms\SingleSelectField; class ColorPickerField extends SingleSelectField { public function __construct($name, $title = null, $source = array(), $value = null) { parent::__construct($name, $title, $source, $value); $this->addExtraClass('color-picker-field'); } public function getSchemaDataDefaults() { $schemaData = parent::getSchemaDataDefaults(); $schemaData['source'] = $this->getSource(); $schemaData['name'] = $this->getName(); $schemaData['value'] = $this->Value(); return $schemaData; } public function getSourceValues() { return array_merge([''], array_map(function ($color) { return $color['CSSClass']; }, $this->getSource())); } } |