示例#1
0
 /**
  * Return field value
  *
  * @return mixed
  */
 public function getValue()
 {
     $result = $value = parent::getValue();
     $options = $this->getOptions();
     if (!(isset($value) && isset($options[$value]))) {
         $value = array_keys($options);
         $result = array_shift($value);
     }
     return $result;
 }
示例#2
0
 /**
  * getOptions
  *
  * @return array
  */
 protected function getOptions()
 {
     $list = parent::getOptions();
     $list += $this->getCategories();
     if ($this->getParam(static::PARAM_DISPLAY_ROOT_CATEGORY)) {
         $list = array($this->getRootCategoryId() => static::t('Root category')) + $list;
     }
     if ($this->getParam(static::PARAM_DISPLAY_ANY_CATEGORY)) {
         $list = array(static::t('Any category')) + $list;
     }
     return $list;
 }
示例#3
0
文件: Multiple.php 项目: kingsj/core
 /**
  * Get common attributes
  *
  * @return array
  */
 protected function getCommonAttributes()
 {
     $list = parent::getCommonAttributes();
     $list['name'] .= '[]';
     return $list;
 }
示例#4
0
 /**
  * Assemble classes
  *
  * @param array $classes Classes
  *
  * @return array
  */
 protected function assembleClasses(array $classes)
 {
     $classes = parent::assembleClasses($classes);
     $classes[] = 'multiple-selector';
     return $classes;
 }