Exemplo n.º 1
0
 /**
  * class constructor
  * @param array  $options build options
  * @param string $name    field name
  */
 public function __construct($options, $name = NULL)
 {
     // get the "default_value" index value
     $values = cs_form::array_get_values($this->default_value, $this->options);
     $oldkey_value = end($values);
     // flatten the options array ang get a numeric keyset
     // $this->options = cs_form::array_flatten($this->options);
     $options['options'] = cs_form::array_flatten($options['options']);
     // search the new index
     $this->value = $this->default_value = array_search($oldkey_value, $this->options);
     if (!isset($options['attributes']['class'])) {
         $options['attributes']['class'] = '';
     }
     $options['attributes']['class'] .= ' slider';
     if (isset($options['multiple'])) {
         $options['multiple'] = FALSE;
     }
     parent::__construct($options, $name);
 }