Adds options from given array into given container

@param    HTML_QuickForm2_Element_Select_OptionContainer  options will be
added to this container
@param    array   options array
492522
protected function loadOptionsFromArray(
        HTML_QuickForm2_Element_Select_OptionContainer $container, $options
    )
    {
        foreach ($options as $key => $value) {
            if (is_array($value)) {
                $optgroup = $container->addOptgroup($key);
                $this->loadOptionsFromArray($optgroup, $value);
            } else {
                $container->addOption($value, $key);
            }
        }
    }
587028
public DefaultCompositeOption add(final Option... _options) {
        if (_options != null) {
            this.options.addAll(Arrays.asList(_options));
        }
        return this;
    }
1103893
private function addFormElements(array &$form, array $values) {
    $form['filter_controls'] = [
      '#markup' => '
          <div class="container controls-wrapper hidden-sm hidden-md hidden-lg">
          <a href="#" class="btn btn-link transparent-blue add-filters">' . $this->t('Add filters') . '</a>
          <a href="#" class="btn btn-link transparent-blue close-filters hidden">' . $this->t('Close filters') . '</a>
          </div>',
    ];

    $form['selects'] = [
      '#type' => 'container',
      '#attributes' => [
        'class' => [
          'container',
          'selects-container',
          'hidden-xs',
        ],
      ],
    ];

    $form['selects']['location'] = [
      '#type' => 'select',
      '#title' => $this->t('Location'),
      '#options' => $this->getLocationOptions(),
      '#prefix' => '<hr/>',
      '#default_value' => isset($values['location']) ? $values['location'] : 'All',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['program'] = [
      '#type' => 'select',
      '#title' => $this->t('Program'),
      '#options' => $this->getProgramOptions(),
      '#default_value' => isset($values['program']) ? $values['program'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['category'] = [
      '#type' => 'select',
      '#title' => $this->t('Sub-Program'),
      '#options' => $this->getCategoryOptions(),
      '#default_value' => isset($values['category']) ? $values['category'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['class'] = [
      '#type' => 'select',
      '#title' => $this->t('Class'),
      '#options' => $this->getClassOptions(),
      '#default_value' => isset($values['class']) ? $values['class'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['date'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Date'),
      '#default_value' => isset($values['date']) ? $values['date'] : '',
      '#attributes' => [
        'class' => ['openy-schedule-datepicker'],
      ],
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
        // Do not focus current input element after ajax finish.
        'disable-refocus' => TRUE,
      ],
    ];

    $form['selects']['time'] = [
      '#type' => 'select',
      '#title' => $this->t('Start Time:'),
      '#options' => $this->getTimeOptions(),
      '#default_value' => isset($values['time']) ? $values['time'] : 'all',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    $form['selects']['display'] = [
      '#type' => 'checkbox',
      '#title' => $this->t('Weekly View'),
      '#default_value' => isset($values['display']) ? $values['display'] : 0,
      '#title_display' => 'before',
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'wrapper' => 'schedules-search-form-wrapper',
        'event' => 'change',
        'method' => 'replace',
        'effect' => 'fade',
        'progress' => [
          'type' => 'throbber',
        ],
      ],
    ];

    // If on Weekly View, default and disable time field.
    if (isset($values['display']) && $values['display']) {
      $form['selects']['time']['#disabled'] = TRUE;
      $form['selects']['time']['#default_value'] = 'all';
    }

    $form['selects']['button'] = [
      '#type' => 'button',
      '#prefix' => '<div class="actions-wrapper hidden-xs hidden-sm hidden-md hidden-lg">',
      '#suffix' => '</div>',
      '#attributes' => [
        'class' => [
          'btn',
          'blue',
        ]
      ],
      '#value' => $this->t('Apply filters'),
      '#ajax' => [
        'callback' => [$this, 'rebuildAjaxCallback'],
        'method' => 'replace',
        'event' => 'click',
      ],
    ];

    $form['filters'] = [
      '#type' => 'container',
      '#prefix' => '<div class="filters-main-wrapper hidden-sm"><div class="container filters-container">',
      '#suffix' => '</div></div>',
      '#attributes' => [
        'class' => [
          'container',
          'filters-container',
        ],
      ],
      '#markup' => '',
      '#weight' => 99,
      'filters' => self::buildFilters($values),
    ];

    $form['alerts'] = [
      views_embed_view('header_alerts', 'specific_alerts_block', $values['location']),
    ];
    $form['alerts']['#prefix'] = '<div class="alerts-wrapper cleafix"><div class="container"><div class="row"><div class="col-xs-12">';
    $form['alerts']['#suffix'] = '</div></div></div></div>';
    $form['alerts']['#weight'] = 100;
  }
1085559
private function SaveOptions(array $options)
    {
        $prev = null;
        foreach ($options as $value=>$text)
        {
            $option = new SelectOption();
            $option->SetSelectField($this->select);
            $option->SetPrevious($prev);
            $option->SetText($text);
            $option->SetValue($value);
            $option->Save();
            $prev = $option;
        }
    }
121076
public function addFormElement(array $element, $options = array())
    {
        if (array_key_exists($element['name'], $this->formElements)) {
            throw new \Exception('Form element "'.$element['name'].'" is already added, use replaceFormElement() or removeElement() instead');
        }
    	$this->formElements[$element['name']] = $element;
        if (!empty($options) && is_array($options)) {
            $this->formElementOptions[$element['name']] = $options;
        }
        return $this;
    }
303331
private void addOption(CliOptionContainer optionContainer) {

    CliOption cliOption = optionContainer.getOption();
    addOption(cliOption.name(), optionContainer);
    for (String alias : cliOption.aliases()) {
      addOption(alias, optionContainer);
    }
    this.optionList.add(optionContainer);
    String modeId = optionContainer.getOption().mode();
    requireMode(modeId, optionContainer);
  }
254135
function(data, options, add_to_container) {
		
		TL.Util.setData(this, data);
		
		// Merge Options
		TL.Util.mergeData(this.options, options);
		
		this._el.container = TL.Dom.create("div", "tl-text");
		this._el.container.id = this.data.unique_id;
		
		this._initLayout();
		
		if (add_to_container) {
			add_to_container.appendChild(this._el.container);
		};
		
	}
753797
public function addOptions(array $options)
    {
        if ($options) {
            foreach ($this->routes as $route) {
                $route->addOptions($options);
            }
        }
    }
984123
protected function setDefaultOptions(array $options = [])
    {
        $this->options = $this->formHelper->mergeOptions($this->allDefaults(), $this->getDefaults());
        $this->options = $this->prepareOptions($options);
    }
97296
public function addOptions($options)
    {
        if (is_string($options)) {
            $this->mergeOptions($this->optionParser->parseString($options));
        } elseif (is_array($options)) {
            $this->mergeOptions($this->optionParser->parseArray($options));
        } else {
            throw new \InvalidArgumentException("Getopt(): argument must be string or array");
        }
    }
1228338
protected function initializeOptions(array $options)
    {
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (method_exists($this, $method)) {
                call_user_func(array($this, $method), $value);
            }
        }
    }
1142934
function (options) {
			
			inputEx.SelectTwiceField.superclass.setOptions.call(this, options);
			
			this.options.choices = lang.isArray(options.choices) ? options.choices : [];
			
			this.options.valueSeparator = options.valueSeparator || "_";
			
		}
727707
function(options) {
	   inputEx.CheckBox.superclass.setOptions.call(this, options);
	   
	   // Overwrite options:
	   this.options.className = options.className ? options.className : 'inputEx-Field inputEx-CheckBox';
	   
	   this.options.rightLabel = options.rightLabel || '';
	   
	   // Added options
	   this.sentValues = options.sentValues || [true, false];
	   this.options.sentValues = this.sentValues; // for compatibility
	   this.checkedValue = this.sentValues[0];
	   this.uncheckedValue = this.sentValues[1];
	}
136910
protected void checkOption(CliOptionContainer optionContainer) {

    CliOption option = optionContainer.getOption();
    String mode = option.mode();
    if (this.cliState.getMode(mode) == null) {
      handleUndefinedMode(optionContainer);
    }

    checkOptionName(option.name(), optionContainer);
    for (String alias : option.aliases()) {
      checkOptionName(alias, optionContainer);
    }
  }
1054776
function setOptions( $optionArray )
    {
        foreach( $optionArray as $name => $value )
        {
            $this->setOption( $name, $value );
        }
    }
755047
public function addOption($option, $value = null)
    {
        if (is_array($option)) {
            $this->options = $option + $this->options;
        } else {
            $this->options[$option] = $value;
        }
    }
559926
function addComponent(Component, options) {
                var name = options.name,
                    container = options.container;

                if (name === undefined) {
                    throw 'you have to define data.name for component.';
                } else if (container === undefined) {
                    throw 'You have to define container for component.';
                } else if (this.children[name] !== undefined) {
                    throw 'Component using name:' + name + '! already defined.';
                }
                var component = this.setComponent(Component, options),
                    instance = component.run(options.container);
                instance.setContext(this.context);
                this.children[name] = instance;
                return instance;
            }