function add_options($options, $overwrite = false)
    {

        // continue only if parameter is an array
        if (is_array($options)) {

            // get some properties of the select control
            $attributes = $this->get_attributes(array('options', 'multiple'));

            // if there are no options so far AND
            // we're not overwriting existing options AND
            // the "multiple" attribute is not set
            if (empty($attributes['options']) && $overwrite === false && !isset($attributes['multiple']))

                // add the default value
                // we'll replace the value with the appropriate language
                $options = array('' => $this->form_properties['language']['select']) + $options;

            // set the options attribute of the control
            $this->set_attributes(

				array(

				    'options'   =>  ($overwrite ? $options : $attributes['options'] + $options)

				)

			);

        // if options are not specified as an array
        } else {

            // trigger an error message
            _zebra_form_show_error('
                Selectable values for the <strong>' . $this->attributes['id'] . '</strong> control must be specified as
                an array
            ');

        }

    }
function add_options($options, $overwrite = false)
    {

        // continue only if parameter is an array
        if (is_array($options)) {

            // get some properties of the select control
            $attributes = $this->get_attributes(array('options', 'multiple'));

            // if there are no options so far AND
            // we're not overwriting existing options AND
            // the "multiple" attribute is not set
            if (empty($attributes['options']) && $overwrite === false && !isset($attributes['multiple']))

                // add the default value
                // we'll replace the value with the appropriate language
                $options = array('' => $this->form_properties['language']['select']) + $options;

            // set the options attribute of the control
            $this->set_attributes(

				array(

				    'options'   =>  ($overwrite ? $options : $attributes['options'] + $options)

				)

			);

        // if options are not specified as an array
        } else {

            // trigger an error message
            _zebra_form_show_error('
                Selectable values for the <strong>' . $this->attributes['id'] . '</strong> control must be specified as
                an array
            ');

        }

    }
function add_options ( $ options , $ overwrite = false ) { // continue only if parameter is an array if ( is_array ( $ options ) ) { // get some properties of the select control $ attributes = $ this -> get_attributes ( array ( 'options' , 'multiple' ) ) ; // if there are no options so far AND // we're not overwriting existing options AND // the "multiple" attribute is not set if ( empty ( $ attributes [ 'options' ] ) && $ overwrite === false && ! isset ( $ attributes [ 'multiple' ] ) ) // add the default value // we'll replace the value with the appropriate language $ options = array ( '' => $ this -> form_properties [ 'language' ] [ 'select' ] ) + $ options ; // set the options attribute of the control $ this -> set_attributes ( array ( 'options' => ( $ overwrite ? $ options : $ attributes [ 'options' ] + $ options ) ) ) ; // if options are not specified as an array } else { // trigger an error message _zebra_form_show_error ( '
                Selectable values for the <strong>' . $ this -> attributes [ 'id' ] . '</strong> control must be specified as
                an array
            ' ) ; } }
Adds options to the select box control

<b>If the "multiple" attribute is not set, the first option will be always considered as the "nothing is selected"
state of the control!</b>

@param  array   $options    An associative array of options where the key is the value of the option and the
value is the actual text to be displayed for the option.

<b>Option groups</b> can be set by giving an array of associative arrays as argument:

<code>
// add as groups:
$obj->add_options(array(
'group' => array('option 1', 'option 2')
));
</code>

@param  boolean $overwrite  (Optional) By default, succesive calls of this method will appended the options
given as arguments to the already existing options.

Setting this argument to TRUE will instead overwrite the previously existing options.

Default is FALSE

@return void
Adds options to the select box control