Generate all global operation buttons for a view.

@return string
482919
public function render()
    {
        /** @var CommandInterface[] $commands */
        $commands = $this
            ->environment
            ->getDataDefinition()
            ->getDefinition(Contao2BackendViewDefinitionInterface::NAME)
            ->getGlobalCommands()
            ->getCommands();

        if (!\is_array($commands)) {
            $commands = [];
        }

        $buttons = [];
        foreach ($commands as $command) {
            if ($command->isDisabled()) {
                continue;
            }
            $buttons[$command->getName()] = $this->renderButton($command);
        }

        $buttonsEvent = new GetGlobalButtonsEvent($this->environment);
        $buttonsEvent->setButtons($buttons);
        $this->dispatcher->dispatch(GetGlobalButtonsEvent::NAME, $buttonsEvent);

        return '<div id="tl_buttons">' . \implode('', $buttonsEvent->getButtons()) . '</div>';
    }
1353405
public function render()
    {
        if (!$this->enableDelete) {
            $this->actions->shift();
        }

        if ($this->actions->isEmpty()) {
            return '';
        }

        $this->setUpScripts();

        $data = [
            'actions'                 => $this->actions,
            'selectAllName'           => $this->grid->getSelectAllName(),
            'isHoldSelectAllCheckbox' => $this->isHoldSelectAllCheckbox,
        ];

        return view('admin::grid.batch-actions', $data)->render();
    }
268079
public static function renderActions() : string {
		$result = '';
		$data = \Application::get(array('layout', 'actions'));
		if (!empty($data)) {
			// sorting first
			array_key_sort($data, ['order' => SORT_ASC], ['order' => SORT_NUMERIC]);
			// looping through data and building html
			$temp = [];
			foreach ($data as $k => $v) {
				if (empty($v)) continue;
				$icon = !empty($v['icon']) ? (\HTML::icon(['type' => $v['icon']]) . ' ') : '';
				$onclick = !empty($v['onclick']) ? $v['onclick'] : '';
				$value = !empty($v['value']) ? i18n(null, $v['value']) : '';
				$href = $v['href'] ?? 'javascript:void(0);';
				$temp[] = \HTML::a(['value' => $icon . $value, 'href' => $href, 'onclick' => $onclick, 'title' => $v['title'] ?? '']);
			}
			$result = implode(' ', $temp);
		}
		return $result;
	}
893547
protected function initUserIndexButton()
    {
        if (!isset($this->buttons['userindex'])) {
            $this->buttons['userindex'] = function ($url, $model, $key) {
                return Html::a('<span class="glyphicon glyphicon-user"></span>', $url, array_merge([
                    'title' => \Yii::t('yii', '角色用户管理'),
                    'data-pjax' => '0',
                ], $this->buttonOptions));
            };
        }
    }
161280
protected function setEditButtons()
    {
        global $APPLICATION;

        if (!$APPLICATION->GetShowIncludeAreas() || $this->showEditButtons === false)
        {
            return false;
        }

        $buttons = \CIBlock::GetPanelButtons(
            $this->arParams['IBLOCK_ID'],
            $this->arResult['ID'],
            $this->arParams['SECTION_ID'],
            []
        );

        $this->addIncludeAreaIcons(\CIBlock::GetComponentMenu($APPLICATION->GetPublicShowMode(), $buttons));

        if (is_array($buttons['intranet']))
        {
            Asset::getInstance()->addJs(BX_ROOT.'/js/main/utils.js');

            foreach ($buttons['intranet'] as $button)
            {
                $this->addEditButton($button);
            }
        }
    }
1296675
protected function renderPageButtons()
    {
        $pageCount = $this->pagination->getPageCount();
        if ($pageCount < 2 && $this->hideOnSinglePage) {
            return '';
        }

        $buttons = [];
        $currentPage = $this->pagination->getPage();

        // next page
        if ($this->nextPageLabel !== false) {
            if (($page = $currentPage + 1) >= $pageCount - 1) {
                $page = $pageCount - 1;
            }
            $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1);
        }

        return Html::tag('ul', implode("\n", $buttons), $this->options);
    }
372399
public function run()
    {
        list($name, $id) = $this->resolveNameID();

        $id .= '_' . (!empty($this->defaults['mainClass']) ? $this->defaults['mainClass'] : '');
        $this->registerScript($id, $name);
        
        $singleMode = false;
        if ($this->singleMode && !$this->singleModeBottom && $this->additionalCode == '') {
            if (is_array($this->data) && isset($this->data[0])) {
                $singleMode = true;
            }
        }
        
        return $this->render('field', [
            'attribute'               => $this->attribute,
            'buttonLabel'             => $this->buttonLabel(),
            'data'                    => $this->data,
            'defaults'                => $this->defaults,
            'extraButtonLabel'        => $this->extraButtonLabel,
            'extraButtonOptions'      => $this->extraButtonOptions,
            'htmlOptionsButton'       => $this->htmlOptionsButton($singleMode),
            'htmlOptionsButtons'      => $this->htmlOptionsButtons(),
            'htmlOptionsExtraButton'  => $this->htmlOptionsExtraButton(),
            'htmlOptionsGroup'        => $this->htmlOptionsGroup(),
            'htmlOptionsInput'        => $this->htmlOptionsInput($singleMode),
            'htmlOptionsMain'         => $this->htmlOptionsMain($id),
            'htmlOptionsRemoveSingle' => $this->htmlOptionsRemoveSingle($singleMode),
            'htmlOptionsResults'      => $this->htmlOptionsResults(),
            'htmlOptionsSelected'     => $this->htmlOptionsSelected(),
            'model'                   => $this->model,
            'name'                    => $this->name,
            'removeSingleLabel'       => $this->removeSingleLabel(),
            'results'                 => $this->results(),
            'singleMode'              => $singleMode,          
        ]);
    }
580179
protected function evalToolbarButtons()
    {
        $buttons = $this->toolbarButtons;

        if (is_string($buttons)) {
            $buttons = array_map(function ($button) {
                return strlen($button) ? $button : '|';
            }, explode('|', $buttons));
        }

        return $buttons;
    }
194106
protected function renderToggleButton()
    {
        if (!isset($this->toggleButtonOptions['options']['data-target'])) {
            $this->toggleButtonOptions['options']['data-target'] = $this->options['id'];
        }
        Html::addCssClass($this->toggleButtonOptions['options'], ['toggle-button' => 'dropdown-trigger']);

        return Button::widget($this->toggleButtonOptions);
    }
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;
    }
113288
protected function renderButtons()
    {
        if (!empty($this->buttons)) {
            $html = '';

            foreach ($this->buttons as $button) {
                    $html .= "$button\n";
            }

            return Html::tag('div', $html, ['class' => 'actions btn-set']);
        }

        return '';
    }
1357136
public static function getActionableViews() {
		static $views;
		if (isset($views)) {
			return $views;
		}

		$views = [];

		$plugin = elgg_get_plugin_from_id('hypeInteractions');
		$settings = $plugin->getAllSettings();
		foreach ($settings as $key => $value) {
			if (!$value) {
				continue;
			}
			list ($prefix, $view) = explode(':', $key);
			if ($prefix !== 'stream_object') {
				continue;
			}
			$views[] = $view;
		}

		return $views;
	}
983212
private function returnGlobalEvents()
	{
		static $returnedEvents;
		$out = "";

		if (!isset($returnedEvents)) {
			$returnedEvents = array();
		}

		if (!empty($this->globalEvents)) {
			foreach ($this->globalEvents as $eventName => $handlers) {
				foreach ($handlers as $handler => $code) {
					if (!isset($returnedEvents[$eventName])) {
						$returnedEvents[$eventName] = array();
					}
					// Return only new events
					if (!in_array($code, $returnedEvents[$eventName])) {
						$out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
						$returnedEvents[$eventName][] = $code;
					}
				}
			}
		}

		return $out;
	}
393666
public function getPaginationButtonModeOptions()
    {
        return [
            self::BUTTON_MODE_ICON => _t(__CLASS__ . '.ICON', 'Icon Only'),
            self::BUTTON_MODE_TEXT => _t(__CLASS__ . '.TEXT', 'Text Only'),
            self::BUTTON_MODE_BOTH => _t(__CLASS__ . '.BOTH', 'Both Icon and Text')
        ];
    }
843933
protected function initDefaultButtons()
    {
        if (!isset($this->buttons['view'])) {
            $this->buttons['view'] = function ($url, $model, $key) {
                $options = ArrayHelper::merge([
                    'title' => Yii::t('yii', 'View'),
                    'aria-label' => Yii::t('yii', 'View'),
                ], $this->buttonOptions);
                return Html::a(Icon::widget([
                    'name' => 'visibility',
                ]), $url, $options);
            };
        }
        if (!isset($this->buttons['update'])) {
            $this->buttons['update'] = function ($url, $model, $key) {
                $options = ArrayHelper::merge([
                    'title' => Yii::t('yii', 'Update'),
                    'aria-label' => Yii::t('yii', 'Update'),
                ], $this->buttonOptions);
                return Html::a(Icon::widget([
                    'name' => 'edit',
                ]), $url, $options);
            };
        }
        if (!isset($this->buttons['delete'])) {
            $this->buttons['delete'] = function ($url, $model, $key) {
                $options = ArrayHelper::merge([
                    'title' => Yii::t('yii', 'Delete'),
                    'aria-label' => Yii::t('yii', 'Delete'),
                    'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'),
                    'data-method' => 'post',
                ], $this->buttonOptions);
                return Html::a(Icon::widget([
                    'name' => 'delete',
                ]), $url, $options);
            };
        }
    }
577826
public function getButtons()
	{
		if($this->_buttons===null)
			$this->_buttons=new CFormElementCollection($this,true);
		return $this->_buttons;
	}
714443
public function getGlobals()
    {
        if (!$this->runtimeInitialized && !$this->extensionInitialized) {
            return $this->initGlobals();
        }

        if (null === $this->globals) {
            $this->globals = $this->initGlobals();
        }

        return $this->globals;
    }