Creates a detailed pairing with a select

@param string $label
@param string $name
@param array $options
@param string $selected
@param bool $nothing
@param array $attributes
@param string|null $description
@return string
177939
protected function backup_detail_select($label, $name, $options, $selected = '', $nothing = false, array $attributes = array(), $description = null) {
        if (!empty ($description)) {
            $description = html_writer::tag('span', $description, array('class' => 'description'));
        } else {
            $description = '';
        }
        return $this->backup_detail_pair($label, html_writer::select($options, $name, $selected, false, $attributes).$description);
    }
1313404
public function withOption($name, $description, $default = '', array $choices = [])
    {
        $this->choices[$name] = $choices;

        return $this->addOption($name, null, InputOption::VALUE_OPTIONAL, $description, $default);
    }
192400
private function option_checkbox($name, $on, $label) {
        if ($on) {
            $checked = ' checked="checked"';
        } else {
            $checked = '';
        }
        $name = 'userselector_' . $name;
        // For the benefit of brain-dead IE, the id must be different from the name of the hidden form field above.
        // It seems that document.getElementById('frog') in IE will return and element with name="frog".
        $output = '<div class="form-check"><input type="hidden" name="' . $name . '" value="0" />' .
                    '<label class="form-check-label" for="' . $name . 'id">' .
                        '<input class="form-check-input" type="checkbox" id="' . $name . 'id" name="' . $name .
                            '" value="1"' . $checked . ' /> ' . $label .
                    "</label>
                   </div>\n";
        user_preference_allow_ajax_update($name, PARAM_BOOL);
        return $output;
    }
857605
public function checkbox($name, $label = null, $value = 1, $checked = null, array $options = [])
    {
        $inputElement = $this->checkboxElement($name, $label, $value, $checked, false, $options);

        $wrapperOptions = $this->isHorizontal() ? ['class' => implode(' ', [$this->getLeftColumnOffsetClass(), $this->getRightColumnClass()])] : [];
        $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . $this->getHelpText($name, $options) . '</div>';

        return $this->getFormGroup($name, null, $wrapperElement);
    }
877400
public static function button(
        string $label, 
        string $type = "submit", 
        string $onclick = null, 
        array $attributes = []
    ) : string
    {
        $buttonPreAttributes = [
            "type" => $type,
        ];
        
        if ($onclick) {
            $buttonPreAttributes["onclick"] = $onclick;
        }
        $buttonAttributes = array_merge($buttonPreAttributes, $attributes);        
        
        return self::tag("button", $label, $buttonAttributes);
    }
22891
public function addOptgroup($label, $attributes = null)
    {
        $optgroup = new HTML_QuickForm2_Element_Select_Optgroup(
                            $this->values, $this->possibleValues,
                            $label, $attributes
                        );
        $this->options[] = $optgroup;
        return $optgroup;
    }
701452
public function createButton($label, array $attributes = [])
    {
        $button = new Components\Form\Elements\Button($label);

        if ( ! array_key_exists('class', $attributes)) {
            $button->attributes->addAttributeClass(['btn', 'my-2', 'my-sm-0']);
        }

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $button->attributes->addAttribute($name, $value);
            }
        }

        $this->childNodes->push($button);

        return $this->childNodes->last();
    }
51378
public function plainSelect($name, $list = array(), $selected = null, array $selectAttributes = [], array $optionsAttributes = [])
    {
        return parent::select($name, $list, $selected, $selectAttributes, $optionsAttributes);
    }
241942
public function select($name, $options = null, $attributes = array())
    {
        $attributes['name'] = $name;

        if (!isset($attributes['id'])) {
            $attributes['id'] = str_replace(array('[', ']'), array('_', ''), $name);
        }

        if (is_array($options)) {
            $options = array_merge(array('options' => array(), 'selected' => null), $options);
            $options = $this->options($options['options'], @$options['selected']);
        }

        return $this->tag('select', (string) $options, $attributes);
    }
510921
public function add($name, $label = '', array $attributes = array(), array $rules = array())
	{
		return $this->fieldset()->add($name, $label, $attributes, $rules);
	}
536757
public static function select($name,
                           $class,
                           $id,
                           array $options,
                           $opt_value = NULL,
                           $label = NULL,
                           $attrs = array())
    {
        $attrs['name'] = $name;
        
        $opts = array();
        foreach($options as $value => $msg)
        {
            $opt_attr = array(
              'value' => $value 
            );
            
            if(($opt_value) && $value == $opt_value)
                $opt_attr['selected'] = 'selected';
            
            $opts[] = self::tag('option', $msg, NULL, NULL, $opt_attr);
            
        }
        
        $opts = self::parseBreak(implode(PHP_EOL, $opts));
        $ret = NULL;
        if($label)
            $ret = PHP_EOL . self::formatLabel($label, $id);
            
        $ret .= self::parseBreak(self::tag('select', $opts, $class, $id, $attrs));
        return $ret;
    }
530879
public function addButton($name, $label = '%s', $link = '#', $binds = [], $attr = [] )
    {
        $c = new Column\Button($name, $label, $link, $binds, $attr);
        $c->setOptionAsDefault();
        $this->addColumn($c);

        return $c;
    }
515734
public function selectTag($name, $optionTags, array $options = [])
    {
        # This is found also in Form::select()
        if (!is_string($optionTags)) {
            if (is_array($optionTags) && isset($optionTags[0]) && isset($optionTags[1])) {
                list ($optionTags, $value) = $optionTags;
            } else {
                $value = null;
            }
            $optionTags = $this->optionsForSelect($optionTags, $value);
        }
        
        $this->normalizeSelectOptions($options, $optionTags);
        
        return $this->formFieldTag('select', $name, $optionTags, $options, true);
    }
448263
static function laraform($name, $attributes = null, array $data = []) {
        $el = new ElementSelectTwbs($name, $attributes, $data);
        $el->addClass('form-control');
        return $el;
    }
251354
public function createSelect(array $options = [], $selected = null, array $attributes = [])
    {
        $select = new Form\Elements\Select($attributes);

        if (count($options)) {
            $select->createOptions($options, $selected);
        }

        $this->childNodes->push($select);

        return $this->childNodes->last();
    }
267409
public function openGroup($name, $label = null, $options = array())
    {
        $options = $this->appendClassToOptions(Config::get('form-builder.group-class'), $options);

        $this->groupStack[] = $name;

        if ($this->hasErrors($name)) {
            $options = $this->appendClassToOptions(Config::get('form-builder.error-class'), $options);
        }

        $label = $label ? $this->label($name, $label) : '';

        return $this->toHtmlString('<div'.$this->html->attributes($options).'>'.$label);
    }
1165443
public static function createDropdown($label, array $attributes = array(), $fromFieldset = false)
    {
        $dropdown = new Dropdown();
        $dropdown->setLabel($label);

        static::applyAttributes($dropdown, $attributes, $fromFieldset);

        return $dropdown;
    }