/** * Register CSS files * * @return array */ public function getCSSFiles() { $list = parent::getCSSFiles(); $list[] = 'modules/XC/PitneyBowes/lib/lou-multi-select/css/multi-select.css'; $list[] = 'modules/XC/PitneyBowes/country_select/style.css'; return $list; }
/** * Get option attributes * * @param mixed $value Value * @param mixed $text Text * * @return array */ protected function getOptionAttributes($value, $text) { $attributes = parent::getOptionAttributes($value, $text); if ($this->isOptionSelected($value)) { $attributes['checked'] = 'checked'; } if (isset($attributes['selected'])) { unset($attributes['selected']); } $attributes['type'] = 'checkbox'; $attributes['name'] = $this->getName() . '[' . $value . ']'; $fieldAttributes = $this->getAttributes(); if (!empty($fieldAttributes['disabled'])) { $attributes['disabled'] = 'disabled'; } return $attributes; }
/** * Get value container class * * @return string */ protected function getValueContainerClass() { return parent::getValueContainerClass() . ' checkbox-list' . $this->getCommonClass(); }
/** * Set common attributes * * @param array $attrs Field attributes to prepare * * @return array */ protected function setCommonAttributes(array $attrs) { return parent::setCommonAttributes($attrs) + array('data-header' => '0'); }
/** * getJSFiles * * @return array */ public function getJSFiles() { $list = parent::getJSFiles(); $list[] = $this->getDir() . '/select_classes.js'; return $list; }
/** * Set common attributes * * @param array $attrs Field attributes to prepare * * @return array */ protected function setCommonAttributes(array $attrs) { return parent::setCommonAttributes($attrs) + array('data-placeholder' => static::t('Enter keywords'), 'data-selected-text' => static::t('# selected')); }