Renderers the enrol_user_button.

@param enrol_user_button $button
@return string XHTML
491161
protected function render_enrol_user_button(enrol_user_button $button) {
        $attributes = array('type'     => 'submit',
                            'value'    => $button->label,
                            'disabled' => $button->disabled ? 'disabled' : null,
                            'title'    => $button->tooltip,
                            'class'    => 'btn btn-secondary my-1');

        if ($button->actions) {
            $id = html_writer::random_id('single_button');
            $attributes['id'] = $id;
            foreach ($button->actions as $action) {
                $this->add_action_handler($action, $id);
            }
        }
        $button->initialise_js($this->page);

        // first the input element
        $output = html_writer::empty_tag('input', $attributes);

        // then hidden fields
        $params = $button->url->params();
        if ($button->method === 'post') {
            $params['sesskey'] = sesskey();
        }
        foreach ($params as $var => $val) {
            $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $var, 'value' => $val));
        }

        // then div wrapper for xhtml strictness
        $output = html_writer::tag('div', $output);

        // now the form itself around it
        if ($button->method === 'get') {
            $url = $button->url->out_omit_querystring(true); // url without params, the anchor part allowed
        } else {
            $url = $button->url->out_omit_querystring();     // url without params, the anchor part not allowed
        }
        if ($url === '') {
            $url = '#'; // there has to be always some action
        }
        $attributes = array('method' => $button->method,
                            'action' => $url,
                            'id'     => $button->formid);
        $output = html_writer::tag('form', $output, $attributes);

        // and finally one more wrapper with class
        return html_writer::tag('div', $output, array('class' => $button->class));
    }
736508
protected function renderButton($button)
    {
        if ($button instanceOf SxButton) {
            return $button->render();
        }

        return $this->getView()->plugin('sxb_button')->__invoke($button)->render();
    }
823406
public function renderButton()
    {
        return $this->render('pay-button', [
            'widget' => $this,
            'request' => $this->request,
            'depositRequest' => new DepositRequest([
                'id' => $this->request->id,
                'amount' => $this->depositForm->amount,
                'currency' => $this->depositForm->currency,
                'merchant' => $this->getMerchantName(),
                'finishUrl' => $this->depositForm->finishUrl,
            ])
        ]);
    }
709900
public function renderButtons()
    {
        if (empty($this->headerButtons)) {
            return;
        }

        echo '<div class="bootstrap-toolbar pull-right">';

        if (!empty($this->headerButtons) && is_array($this->headerButtons)) {
            foreach ($this->headerButtons as $button) {
                if (is_string($button)) {
                    echo $button;
                    continue;
                }
                $options = $button;
                $button = $options['class'];
                unset($options['class']);

                if (strpos($button, 'TbButton') === false) {
                    throw new CException('message');
                }

                if (!isset($options['htmlOptions'])) {
                    $options['htmlOptions'] = array();
                }

                $class = isset($options['htmlOptions']['class']) ? $options['htmlOptions']['class'] : '';
                $options['htmlOptions']['class'] = $class . ' pull-right';

                $this->controller->widget($button, $options);
            }
        }

        echo '</div>';
    }
239116
private function renderActionButton()
    {
        $actionButtonOptions = $this->actionButtonOptions;
        Html::addCssClass($actionButtonOptions, $this->linkClasses);

        $this->beginButtonGroup();

        echo Html::button($this->actionsButtonLabel . $this->caretHtml, $actionButtonOptions);

        echo Html::beginTag('ul', ['class' => 'dropdown-menu dropdown-menu-right']);
        foreach ($this->visibleActions as $action) {
            $label = ArrayHelper::getValue($action, $this->actionLabelProperty, '');
            $url = ArrayHelper::getValue($action, $this->actionUrlProperty, null);
            $options = ArrayHelper::getValue($action, $this->actionOptionsProperty, []);

            echo Html::tag('li', Html::a($label, $url, $options));
        }
        echo Html::endTag('ul');

        $this->endButtonGroup();
    }
353541
protected function getForm($button = null)
    {
        // If the first argument isn't a string, that means
        // the user wants us to auto-find the form.

        try {
            if ($button) {
                return $this->crawler->selectButton($button)->form();
            }

            return $this->crawler->filter('form')->form();
        } catch (InvalidArgumentException $e) {
            // We'll catch the exception, in order to provide a
            // more readable failure message for the user.

            throw new InvalidArgumentException(
                "Couldn't find a form that contains a button with text '{$button}'."
            );
        }
    }
1093042
public function renderFooter()
    {
        if (!$this->isAddButtonPositionFooter()) {
            return '';
        }

        $cells = [];
        $cells[] = Html::tag('td', '&nbsp;');
        $cells[] = Html::tag('td', $this->renderAddButton(), [
            'class' => 'list-cell__button'
        ]);

        return Html::tag('tfoot', Html::tag('tr', implode("\n", $cells)));
    }
62051
public function render()
	{
		$attributes	= $this->getAttributes();
		$attributes['onclick']	= 'location.href=\''.ADT_URL_Inference::buildStatic( $this->parameters ).'\';';
		return UI_HTML_Tag::create( 'button', $this->content, $attributes );
	}
854719
public function restart_preview_button() {
        global $OUTPUT;
        if ($this->is_preview() && $this->is_preview_user()) {
            return $OUTPUT->single_button(new moodle_url(
                    $this->start_attempt_url(), array('forcenew' => true)),
                    get_string('startnewpreview', 'quiz'));
        } else {
            return '';
        }
    }
1255430
protected static function encodeValue($button)
    {
        if (isset($button['button']) && $button['button'] == 'link') {
            if (substr($button['value'], 0, 7) == 'mailto:') {
                if (version_compare(VERSION . '.' . BUILD, '3.5.5', '>=')) {
                    $button['value'] = \StringUtil::encodeEmail($button['value']);
                } else {
                    $button['value'] = \String::encodeEmail($button['value']);
                }
            } else {
                $button['value'] = ampersand($button['value']);
            }
        }

        return $button;
    }
1200906
public function get_user_search_button() {
        static $count = 0;
        if (!has_capability('moodle/role:assign', $this->manager->get_context())) {
            return false;
        }
        $count++;
        $url = new moodle_url('/admin/roles/assign.php', array('contextid'=>$this->manager->get_context()->id, 'sesskey'=>sesskey()));
        $control = new single_button($url, get_string('assignroles', 'role'), 'get');
        $control->class = 'singlebutton assignuserrole instance'.$count;
        if ($count == 1) {
            $this->manager->get_moodlepage()->requires->strings_for_js(array(
                    'ajaxoneuserfound',
                    'ajaxxusersfound',
                    'ajaxxmoreusersfound',
                    'ajaxnext25',
                    'enrol',
                    'enrolmentoptions',
                    'enrolusers',
                    'enrolxusers',
                    'errajaxfailedenrol',
                    'errajaxsearch',
                    'foundxcohorts',
                    'none',
                    'usersearch',
                    'unlimitedduration',
                    'startdatetoday',
                    'durationdays',
                    'enrolperiod'), 'enrol');
            $this->manager->get_moodlepage()->requires->string_for_js('assignrole', 'role');

            $modules = array('moodle-enrol-otherusersmanager', 'moodle-enrol-otherusersmanager-skin');
            $function = 'M.enrol.otherusersmanager.init';
            $arguments = array(
                'courseId'=> $this->manager->get_course()->id,
                'ajaxUrl' => '/enrol/ajax.php',
                'url' => $this->manager->get_moodlepage()->url->out(false));
            $this->manager->get_moodlepage()->requires->yui_module($modules, $function, array($arguments));
        }
        return $control;
    }
864857
public function message($message, single_button $button = null) {
        $output  = $this->output->box_start('generalbox boxaligncenter');
        $output .= $message;
        if ($button !== null) {
            $output .= $this->output->box($this->output->render($button), 'lessonbutton standardbutton');
        }
        $output .= $this->output->box_end();
        return $output;
    }
1214149
public function get_user_enrolments($userid) {
        global $DB;
        list($instancessql, $params, $filter) = $this->get_instance_sql();
        $params['userid'] = $userid;
        $userenrolments = $DB->get_records_select('user_enrolments', "enrolid $instancessql AND userid = :userid", $params);
        $instances = $this->get_enrolment_instances();
        $plugins = $this->get_enrolment_plugins(false);
        $inames = $this->get_enrolment_instance_names();
        foreach ($userenrolments as &$ue) {
            $ue->enrolmentinstance     = $instances[$ue->enrolid];
            $ue->enrolmentplugin       = $plugins[$ue->enrolmentinstance->enrol];
            $ue->enrolmentinstancename = $inames[$ue->enrolmentinstance->id];
        }
        return $userenrolments;
    }
613617
public static function renderType(ButtonInterface $button) {
        return null !== $button->getType() ? $button->getPrefix() . $button->getType() : null;
    }
852046
private function renderButton()
    {
        $this->params = Json::encode([
            'btnName' => $this->options['id'],
            'cookieName' => $this->cookie['name'],
            'cookieValue' => addslashes($this->getHashedCookieValue($this->cookie['value'])),
            'cookieOptions' => isset($this->cookie['options']) ? $this->cookie['options'] : null,
        ]);

        if($this->cookie($this->cookie['name'])) {
            Html::addCssClass($this->options, 'active');
        }

        echo Button::widget([
            'label' => $this->encodeLabel ? Html::encode($this->label) : $this->label,
            'encodeLabel' => $this->encodeLabel,
            'options' => ArrayHelper::merge(['data-toggle' => 'button'], $this->options),
        ]);
    }
388283
public function render()
    {
        if ( ! $this->hasPages()) {
            return null;
        }

        return sprintf(
            $this->wrapper,
            $this->getPreviousButton(),
            $this->getLinks(),
            $this->getNextButton()
        );
    }
1052064
protected function renderButton()
    {
        Html::addCssClass($this->options, 'btn');
        $label = $this->label;
        if ($this->encodeLabel) {
            $label = Html::encode($label);
        }
        if (!isset($this->iconOptions['class'])) {
            $this->iconOptions['class'] = 'caret';
        }
        if ($this->split) {
            $options = $this->options;
            $this->options['data-toggle'] = 'dropdown';
            Html::addCssClass($this->options, 'dropdown-toggle');
            $splitButton = Button::widget([
                'label' => Html::tag('span', '', $this->iconOptions),
                'encodeLabel' => false,
                'options' => $this->options,
                'view' => $this->getView(),
            ]);
        } else {
            $label .= ' ' . Html::tag('span', '', $this->iconOptions);
            $options = $this->options;
            if (!isset($options['href'])) {
                $options['href'] = '#';
            }
            Html::addCssClass($options, 'dropdown-toggle');
            $options['data-toggle'] = 'dropdown';
            $splitButton = '';
        }

        return Button::widget([
            'tagName' => $this->tagName,
            'label' => $label,
            'options' => $options,
            'encodeLabel' => false,
            'view' => $this->getView(),
        ]) . "\n" . $splitButton;
    }