Answers an array of HTML tag attributes for the button.

@return array
342672
public function getButtonAttributes()
    {
        $attributes = [
            'type' => 'button',
            'class' => $this->ButtonClass,
            'title' => $this->ButtonLabel,
            'aria-label' => $this->ButtonLabel,
            'aria-expanded' => 'false',
            'aria-controls' => $this->CollapseHTMLID,
            'data-target' => $this->CollapseCSSID,
            'data-toggle' => 'collapse'
        ];
        
        $this->extend('updateButtonAttributes', $attributes);
        
        return $attributes;
    }
129649
public function getHtmlAttributes()
    {
        if ( $this->getValue()) {
            $this->_attributes['checked'] = 'checked';
        }
        $text = parent::getHtmlAttributes();
        $text = str_replace('form-control', '', $text);
        return $text;
    }
933573
public function getLinkClassNames()
    {
        if ($this->isButtonLink() || !$this->LinkInFooter) {
            return [];
        }
        
        $classes = [
            $this->style('button'),
            $this->ButtonTypeClass
        ];
        
        if ($this->ButtonExtraClass) {
            $classes[] = $this->ButtonExtraClass;
        }
        
        return $classes;
    }
1249602
protected function getDataAttrs(): array
    {
        $attrs = array_filter($this->html->getAttributes(), static function ($v, $k) {
            return strpos($k, 'data-') === 0;
        }, ARRAY_FILTER_USE_BOTH);

        $dataAttrs = [];

        foreach ($attrs as $key => $value) {
            $key = substr($key, 5);

            $dataAttrs[$key] = $value;
        }

        return $dataAttrs;
    }
9444
public function getHTML() {
        $tag = '<form';
        $q = $this->quoteType;

        //build attribute strings
        foreach( $this->attrs as $name=>$value ) {
            //if true, such as CHECKED, we just add the name
            if( $value === true )
                    $tag .= " $name";
            elseif( is_string( $value ) ) //if it's a string, we add attr="value"
                    $tag .= " {$name}={$q}{$value}{$q}";
        }

        //not a short tag, close it
        $tag .= '>';

        //add the children if they exist
        if( $this->hasChildren() ) {
            for( $i = 0; $i < count( $this->children ); $i++ ) {
                //datalists are hidden and should not be decorated
                if( $this->children[$i] instanceof Element\Datalist ) {
                    $tag .= $this->children[$i]->getHTML();
                } else {
                    $tag .= $this->decorator->element( $this->children[$i]->getHTML(), $this->titles[$i] );
                }
            }
        }

        //closing tag
        $tag .= "</form>";

        return $this->decorator->form( $tag );
    }
932262
public function toOptionArray() {
        return [
            [
                'value' => self::BUTTON_BLACK,
                'label' => __('Black')
            ],
            [
                'value' => self::BUTTON_WHITE,
                'label' => __('White')
            ],
            [
                'value' => self::BUTTON_WHITE_LINE,
                'label' => __('White with line')
            ],
        ];
    }
474967
public function getVariables() 
	{
		if(isset($this->attributes['class'])) {
			$this->attributes['class'] = trim($this
			->attributes['class'].' form-control');
		} else {
			$this->attributes['class'] = 'form-control';
		}
		
		return array(
			'attributes' 	=> $this->attributes,
			'items'			=> $this->items,
			'selected'		=> $this->value);
	}
1116158
public function getOpeningTag(): string
    {
        $attributes = [];

        foreach ($this->attributes as $name => $value) {
            $attributes[] = self::getHtmlAttribute($name, $value);
        }

        $attributes = implode(' ', array_filter($attributes));

        return sprintf('<%s%s>', $this->nodeName, $attributes === '' ? '' : " {$attributes}");
    }
1292261
public function attributes()
    {
        $attributes = \yii\base\Model::attributes();
        foreach (self::rules() as $rule) {
            if (is_string(reset($rule))) {
                continue;
            }
            foreach (reset($rule) as $attribute) {
                if (substr_compare($attribute, '!', 0, 1) === 0) {
                    $attribute = mb_substr($attribute, 1);
                }
                $attributes[$attribute] = $attribute;
            }
        }

        return array_values($attributes);
    }
893285
public function getAttributes()
    {
        $ret = array();

        if (count($this->attributes)) {
            foreach ($this->attributes as $name => $value) {
                $ret[] = sprintf($name . '="%s"', $value);
            }
        }

        if (count($this->varAttr)) {
            foreach ($this->varAttr as $name => $value) {
                $ret[] = sprintf($name . '="%s"', $value);
            }
        }

        if (strlen($className = $this->getClassName())) {
            $ret[] = sprintf('class="%s"', $className);
        }
        return ' ' . implode(' ', $ret);
    }
859788
public function get_question_buttons() {
        $buttons = array();
        foreach ($this->attemptobj->get_slots() as $slot) {
            if ($heading = $this->attemptobj->get_heading_before_slot($slot)) {
                $buttons[] = new quiz_nav_section_heading(format_string($heading));
            }

            $qa = $this->attemptobj->get_question_attempt($slot);
            $showcorrectness = $this->options->correctness && $qa->has_marks();

            $button = new quiz_nav_question_button();
            $button->id          = 'quiznavbutton' . $slot;
            $button->number      = $this->attemptobj->get_question_number($slot);
            $button->stateclass  = $qa->get_state_class($showcorrectness);
            $button->navmethod   = $this->attemptobj->get_navigation_method();
            if (!$showcorrectness && $button->stateclass == 'notanswered') {
                $button->stateclass = 'complete';
            }
            $button->statestring = $this->get_state_string($qa, $showcorrectness);
            $button->page        = $this->attemptobj->get_question_page($slot);
            $button->currentpage = $this->showall || $button->page == $this->page;
            $button->flagged     = $qa->is_flagged();
            $button->url         = $this->get_question_url($slot);
            if ($this->attemptobj->is_blocked_by_previous_question($slot)) {
                $button->url = null;
                $button->stateclass = 'blocked';
                $button->statestring = get_string('questiondependsonprevious', 'quiz');
            }
            $buttons[] = $button;
        }

        return $buttons;
    }
325301
public function attributes()
    {
        $attributes = [];
        foreach ($this->rules() as $rule) {
            $names = reset($rule);
            if (is_string($names)) {
                $names = [$names];
            }
            foreach ($names as $name) {
                if (substr_compare($name, '!', 0, 1) === 0) {
                    $name = mb_substr($name, 1);
                }
                $attributes[$name] = $name;
            }
        }

        return array_values($attributes);
    }
231618
protected function getAttributesAsHtml()
	{
		$htmlAttrs = '';
		
		foreach($this->attributes as $attrName => $attrValue) {
			$htmlAttrs .= ' ' . $attrName . (($attrValue === null || strlen($attrValue) === 0)?null:'="' . $attrValue . '"');
		}
		
		return $htmlAttrs;
	}
518117
protected function getAttributes()
    {
        $terminal = null;
        if ($this->hasLaravel() === true) {
            try {
                $controller = $this->laravel->make(TerminalController::class);
                $response = $this->laravel->call([$controller, 'index'], ['view' => 'panel']);
                $terminal = $response->getContent();
            } catch (Exception $e) {
                $terminal = $e->getMessage();
            }
        }

        return [
            'terminal' => $terminal,
        ];
    }
669282
public function renderToggleButton()
    {
        if ($this->toggleButton !== null) {
            $tag   = ArrayHelper::removeValue($this->toggleButton, 'tag', 'button');
            $label = ArrayHelper::removeValue($this->toggleButton, 'label', 'Show');
            if ($tag === 'button' && !isset($this->toggleButton['type'])) {
                $this->toggleButton['type'] = 'button';
            }
            $this->toggleButton['data-reveal-id'] = $this->getId();
            return \CHtml::tag($tag, $this->toggleButton, $label);
        } else {
            return null;
        }
    }
1081842
protected function getEditButtons()
    {
        $buttons         = [];
        $basicDefinition = $this->getDataDefinition()->getBasicDefinition();

        $buttonTemplate = new ContaoBackendViewTemplate('dc_general_button');

        $buttonTemplate->setData(
            [
                'label'      => $this->getButtonLabel('save'),
                'attributes' => [
                    'type'      => 'submit',
                    'name'      => 'save',
                    'id'        => 'save',
                    'class'     => 'tl_submit',
                    'accesskey' => 's'
                ]
            ]
        );
        $buttons['save'] = $buttonTemplate->parse();

        $buttonTemplate->setData(
            [
                'label'      => $this->getButtonLabel('saveNclose'),
                'attributes' => [
                    'type'      => 'submit',
                    'name'      => 'saveNclose',
                    'id'        => 'saveNclose',
                    'class'     => 'tl_submit',
                    'accesskey' => 'c'
                ]
            ]
        );
        $buttons['saveNclose'] = $buttonTemplate->parse();

        if (!$this->isPopup() && $basicDefinition->isCreatable()) {
            $buttonTemplate->setData(
                [
                    'label'      => $this->getButtonLabel('saveNcreate'),
                    'attributes' => [
                        'type'      => 'submit',
                        'name'      => 'saveNcreate',
                        'id'        => 'saveNcreate',
                        'class'     => 'tl_submit',
                        'accesskey' => 'n'
                    ]
                ]
            );
            $buttons['saveNcreate'] = $buttonTemplate->parse();
        }

        if ($this->getEnvironment()->getInputProvider()->hasParameter('s2e')) {
            $buttonTemplate->setData(
                [
                    'label'      => $this->getButtonLabel('saveNedit'),
                    'attributes' => [
                        'type'      => 'submit',
                        'name'      => 'saveNedit',
                        'id'        => 'saveNedit',
                        'class'     => 'tl_submit',
                        'accesskey' => 'e'
                    ]
                ]
            );
            $buttons['saveNedit'] = $buttonTemplate->parse();
        } elseif (!$this->isPopup()
                  && ((BasicDefinitionInterface::MODE_PARENTEDLIST === $basicDefinition->getMode())
                      || '' !== $basicDefinition->getParentDataProvider()
                      || $basicDefinition->isSwitchToEditEnabled()
                  )
        ) {
            $buttonTemplate->setData(
                [
                    'label'      => $this->getButtonLabel('saveNback'),
                    'attributes' => [
                        'type'      => 'submit',
                        'name'      => 'saveNback',
                        'id'        => 'saveNback',
                        'class'     => 'tl_submit',
                        'accesskey' => 'g'
                    ]
                ]
            );
            $buttons['saveNback'] = $buttonTemplate->parse();
        }

        $event = new GetEditModeButtonsEvent($this->getEnvironment());
        $event->setButtons($buttons);

        $this->getEnvironment()->getEventDispatcher()->dispatch($event::NAME, $event);

        $submitButtons = ['toggleIcon' => Image::getHtml('navcol.svg')];
        $editButtons   = $event->getButtons();
        if (\array_key_exists('save', $editButtons)) {
            $submitButtons['save'] = $editButtons['save'];
            unset($editButtons['save']);
        }

        if (\count($editButtons)) {
            $submitButtons['buttonGroup'] = $editButtons;
        }

        $submitButtonTemplate = new ContaoBackendViewTemplate('dc_general_submit_button');
        $submitButtonTemplate->setData($submitButtons);

        return \preg_replace('/(\s\s+|\t|\n)/', '', $submitButtonTemplate->parse());
    }
960551
public function getAttributes(): array
    {
        $attributes = [];
        foreach ($this->attributes as $attributeName => $attribute) {
            $value = $attribute->value;
            $attributes[$attributeName] = $value !== '' ? (strstr($value, 'html5-dom-document-internal-entity') !== false ? $this->updateResult($value) : $value) : '';
        }
        return $attributes;
    }