Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 /**
  * Get value container class
  *
  * @return string
  */
 protected function getValueContainerClass()
 {
     return parent::getValueContainerClass() . ' checkbox-list' . $this->getCommonClass();
 }
Пример #4
0
 /**
  * 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');
 }
Пример #5
0
 /**
  * getJSFiles
  *
  * @return array
  */
 public function getJSFiles()
 {
     $list = parent::getJSFiles();
     $list[] = $this->getDir() . '/select_classes.js';
     return $list;
 }
Пример #6
0
 /**
  * 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'));
 }