Executes widget
@return string link tag with hreflang
438638
public function run()
    {
        /** @var \DevGroup\Multilingual\Multilingual $multilingual */
        $multilingual = Yii::$app->get('multilingual');
        /** @var Language[] $languages */
        $languages = $multilingual->getAllLanguages();

        $result = '';

        foreach ($languages as $language) {
            if (
                $language->id === $multilingual->language_id
                || $language->rulesForContext(Yii::$app->multilingual->context_id) === null
            ) {
                // skip current language
                continue;
            }
            $result .= Html::tag(
                'link',
                '',
                [
                    'rel' => 'alternate',
                    'hreflang' => $language->iso_639_1,
                    'href' => $multilingual->translateCurrentRequest($language->id),
                ]
            ) . "\n";
        }

        return $result;
    }
1372818
public function execute()
    {
        if ($this->hasOption('start')) {
            $this->options[] = 'doNotSelfQlose';
            echo new HTML\Tag('script', $this->args, $this->options);

            return;
        }

        $options = $this->options;
        $options[] = 'doNotSelfQlose';
        if (in_array('compressJs', $options)) {
            $options[] = 'inlineInner';
        }

        $Tag = new HTML\Tag('script', $this->args, $options);

        $Tag->open();
        $Tag->content();
        $Tag->close();
    }
30218
public function run()
    {
        $tag = ArrayHelper::remove($this->options, 'tag', 'div');
        $html[] = Html::beginTag($tag, $this->options);
        $html[] = Html::beginTag('div', $this->carouselOptions);
        $html[] = $this->renderFixedItem();
        $html[] = $this->renderItems();
        $html[] = Html::endTag('div');
        $html[] = Html::endTag($tag);

        return implode("\n", $html);
    }
149575
public function run()
    {
        $html[] = Html::beginTag('div', $this->options);

        if ($this->flashColors !== false) {
            foreach ($this->colors as $color) {
                Html::addCssClass($this->spinnerOptions, ['color' => 'spinner-' . $color]);

                $html[] = Html::beginTag('div', $this->spinnerOptions);
                $html[] = $this->renderSpinner();
                $html[] = Html::endTag('div');

                Html::removeCssClass($this->spinnerOptions, ['color' => 'spinner-' . $color]);
            }
        } else {
            $html[] = Html::beginTag('div', $this->spinnerOptions);
            $html[] = $this->renderSpinner();
            $html[] = Html::endTag('div');
        }

        $html[] = Html::endTag('div');

        return implode("\n", $html);
    }
309409
public function run() {
    if($this->tagName == 'a') {
      echo Html::a($this->encodeLabel ? Html::encode($this->label) : $this->label, $this->url, $this->options);
    } else {
      $this->options['tabindex'] = '0';
      echo Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
    }
  }
232119
public function run() {

		$post = yii::$app->request->post();

		if( isset( $this->model ) && isset( $post[ 'list' ] ) ) {

			$modelTagService = Yii::$app->factory->get( 'modelTagService' );

			$parentId	= $this->model->id;
			$parentType	= $this->parentType;
			$tags		= $post[ 'list' ];

			$modelTagService->createFromCsv( $parentId, $parentType, $tags );

			$modelTags = $this->model->activeModelTags;

			$data = [];

			foreach( $modelTags as $modelTag ) {

				$data[]	= [ 'cid' => $modelTag->id, 'name' => $modelTag->model->name ];
			}

			// Trigger Ajax Success
			return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ), $data );
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
983740
public function run()
    {
        if ($this->label !== false) {
            $label = $this->encodeLabel ? Html::encode($this->label) : $this->label;
        } else {
            $label = '';
        }

        $content = $this->renderIcon() . $label;

        return $this->tagName === 'button' ? Html::button($content, $this->options) : Html::tag($this->tagName, $content, $this->options);
    }
866844
public function execute()
    {
        $id = $this->getRequest()->getParam('template_id');

        if ($id) {
            $model = $this->templateRepository->getById($id);

            if (!$model->getId()) {
                $this->messageManager->addErrorMessage(__('This post no longer exists.'));
                /** \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
                $resultRedirect = $this->resultRedirectFactory->create();

                return $resultRedirect->setPath('*/*/');
            }
        } else {
            $model = $this->pdfgeneratorFactory->create();
        }

        /** @var Session $data */
        $data = $this->session->getFormData(true);

        if (!empty($data)) {
            $model->setData($data);
        }

        $this->coreRegistry->register('pdfgenerator_template', $model);

        $resultPage = $this->_initAction();
        $resultPage->addBreadcrumb(
            $id ? __('Edit Template') : __('New Template'),
            $id ? __('Edit Template') : __('New Template')
        );

        $resultPage->getConfig()->getTitle()->prepend(__('Template'));
        $resultPage->getConfig()->getTitle()
            ->prepend(
                $model->getData('template_id') ? __('Template ') . $model->getTemplateName() : __('New Template')
            );

        return $resultPage;
    }
292335
public function run()
	{
		$id = $this->id;
		$content = array();
		$items = $this->normalizeTabs($this->tabs, $content);

		ob_start();
		if ($this->addTabsNavBar) {
			echo '<div class="navbar"><div class="navbar-inner">';
		}
		$this->controller->widget(
			'booster.widgets.TbMenu',
			array(
				'stacked' => $this->stacked,
				'type' => $this->type,
				'encodeLabel' => $this->encodeLabel,
				'items' => $items,
			)
		);
		if ($this->addTabsNavBar) {
			echo '</div></div>';
		}
		$tabs = ob_get_clean();

		ob_start();
		echo '<div class="tab-content">';
		echo implode('', $content);
		echo $this->pagerContent;
		echo '</div>';
		$content = ob_get_clean();

		echo CHtml::openTag('div', $this->htmlOptions);
		echo $this->placement === self::PLACEMENT_BELOW ? $content . $tabs : $tabs . $content;
		echo '</div>';

		/** @var CClientScript $cs */
		$cs = Yii::app()->getClientScript();

		$cs->registerPackage('bootstrap.wizard');

		// Override options
		if ($this->type && !isset($this->options['class'])) {
			$this->options['class'] = $this->type;
		}

		$options = CJavaScript::encode($this->options);

		$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').bootstrapWizard({$options});");

		foreach ($this->events as $name => $handler) {
			$handler = CJavaScript::encode($handler);
			$cs->registerScript(__CLASS__ . '#' . $id . '_' . $name, "jQuery('#{$id}').on('{$name}', {$handler});");
		}
	}
1214959
public function run()
    {
        $res = '';
        if (!$this->_renderTo) {
            $this->clientOptions['chart']['renderTo'] = $this->options['id'];
            $options = $this->options;
            $tag = ArrayHelper::remove($options, 'tag', 'div');
            $res = Html::tag($tag, '', $options);
        }
        $this->registerClientScript();
        return $res;
    }
19986
public function run($widget)
    {
        $navigation = app('navigation')->findOrFail($widget->param('navigation_id'));

        if (! $navigation->menus()->count()) {
            return ''; // return empty string if navigation does not have menu items
        }

        return view($widget->present()->template(), [
            'config' => $this->config,
            'widget' => $widget,
            'menu'   => 'menu_' . $navigation->type,
        ]);
    }
370298
public function execute()
    {

        $template = $this->_initTemplate();

        try {
            $parts = $this->emailConfig->parseTemplateIdParts(self::INVOICE_TMEPLTE_ID);
            $templateId = $parts['templateId'];
            $theme = $parts['theme'];

            if ($theme) {
                $template->setForcedTheme($templateId, $theme);
            }

            $template->setForcedArea($templateId);

            $template->loadDefault($templateId);
            $template->setData('orig_template_code', $templateId);
            $template->setData(
                'template_variables',
                Zend_Json::encode($template->getVariablesOptionArray(true))
            );

            $templateBlock = $this->_view->getLayout()->createBlock(
                \Magento\Email\Block\Adminhtml\Template\Edit::class
            );
            $template->setData(
                'orig_template_currently_used_for',
                $templateBlock->getCurrentlyUsedForPaths(false)
            );

            $this->getResponse()->representJson(
                $this->jsonHelperData
                    ->jsonEncode($template->getData())
            );
        } catch (Exception $e) {
            $this->messageManager->addErrorMessage($e, 'There was a problem:' . $e->getMessage());
        }

        $customVariables = $this->variableModel
            ->getVariablesOptionArray(true);
        $storeContactVariables = $this->variablesFacrory->create()->toOptionArray(true);
        /** @var Json $resultJson */
        $resultJson = $this->resultJsonFactory->create();
        return $resultJson->setData([
            $storeContactVariables,
            $customVariables,
            $template->getVariablesOptionArray(true)
        ]);
    }
354922
public function getWidgetUrl($languageId = null, $inAdmin = null, $urlParameters = [])
    {
        $utilsUrl = Registry::getUtilsUrl();
        $widgetUrl = $this->isSsl() ? $this->getSslShopUrl($languageId) : $this->getShopUrl($languageId, $inAdmin);
        $widgetUrl = $utilsUrl->processUrl($widgetUrl . 'widget.php', false);

        if (!isset($languageId)) {
            $language = Registry::getLang();
            $languageId = $language->getBaseLanguage();
        }
        $urlLang = $utilsUrl->getUrlLanguageParameter($languageId);
        $widgetUrl = $utilsUrl->appendUrl($widgetUrl, $urlLang, true);

        $widgetUrl = $utilsUrl->appendUrl($widgetUrl, $urlParameters, true, true);

        return $widgetUrl;
    }
78451
public function getTag()
    {
        $piwikUrl = $this->getPiwikUrl();

        $tag = <<<'EOT'
<script type="text/javascript">
var _paq = _paq || [];
(function(){ var u=(("https:" == document.location.protocol) ? "%s/" : "%s/");
_paq.push(['setSiteId', %s]);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js';
s.parentNode.insertBefore(g,s); })();
</script>
<!-- End Piwik Code -->
EOT;

        return sprintf(
            $tag,
            $this->convertUrl($piwikUrl, true),
            $this->convertUrl($piwikUrl, false),
            $this->getSiteId()
        );
    }
222701
public function execute()
    {

        $resultPage = $this->resultPageFactory->create();
        $pageTitle = $this->scopeConfig->getValue(self::META_TITLE_CONFIG_PATH, ScopeInterface::SCOPE_STORE);
        $resultPage->getConfig()->getTitle()->set($pageTitle);
        $resultPage->getConfig()->setDescription(
            $this->scopeConfig->getValue(self::META_DESCRIPTION_CONFIG_PATH, ScopeInterface::SCOPE_STORE)
        );
        $resultPage->getConfig()->setKeywords(
            $this->scopeConfig->getValue(self::META_KEYWORDS_CONFIG_PATH, ScopeInterface::SCOPE_STORE)
        );
        if ($this->scopeConfig->isSetFlag(self::BREADCRUMBS_CONFIG_PATH, ScopeInterface::SCOPE_STORE)) {
            
            /** @var \Magento\Theme\Block\Html\Breadcrumbs $breadcrumbsBlock */
            $breadcrumbsBlock = $resultPage->getLayout()->getBlock('breadcrumbs');
            if ($breadcrumbsBlock) {
                $breadcrumbsBlock->addCrumb(
                    'home',
                    [
                        'label'    => __('Home'),
                        'link'     => $this->_url->getUrl('')
                    ]
                );
                $breadcrumbsBlock->addCrumb(
                    'stockists',
                    [
                        'label'    => $pageTitle,
                    ]
                );
            }
        }
        
        return $resultPage;

    }
31105
public function run()
	{
		$id = $this->htmlOptions['id'];

		echo CHtml::openTag('div', $this->htmlOptions);

		foreach ($this->alerts as $type => $alert)
		{
			if (is_string($alert))
			{
				$type = $alert;
				$alert = array();
			}

			if (isset($alert['visible']) && $alert['visible'] === false)
				continue;

			if (Yii::app()->user->hasFlash($type))
			{
				$classes = array('alert in');

				if (!isset($alert['block']))
					$alert['block'] = $this->block;

				if ($alert['block'] === true)
					$classes[] = 'alert-block';

				if (!isset($alert['fade']))
					$alert['fade'] = $this->fade;

				if ($alert['fade'] === true)
					$classes[] = 'fade';

				$validTypes = array(self::TYPE_SUCCESS, self::TYPE_INFO, self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_DANGER);

				if (in_array($type, $validTypes))
					$classes[] = 'alert-'.$type;

				if (!isset($alert['htmlOptions']))
					$alert['htmlOptions'] = array();

				$classes = implode(' ', $classes);
				if (isset($alert['htmlOptions']['class']))
					$alert['htmlOptions']['class'] .= ' '.$classes;
				else
					$alert['htmlOptions']['class'] = $classes;

				echo CHtml::openTag('div', $alert['htmlOptions']);

				if ($this->closeText !== false && !isset($alert['closeText']))
					$alert['closeText'] = $this->closeText;
				else
					$alert['closeText'] = false;

				if (isset($alert['closeText']) && $alert['closeText'] !== false)
					echo '<a class="close" data-dismiss="alert">'.$alert['closeText'].'</a>';

				echo Yii::app()->user->getFlash($type);

				echo '</div>';
			}
		}

		echo '</div>';

		$selector = "#{$id} .alert";
		$id .= '_'.self::$_containerId++;

		/** @var CClientScript $cs */
		$cs = Yii::app()->getClientScript();
		//$cs->registerScript(__CLASS__.'#'.$id, "jQuery('{$selector}').alert();");

		foreach ($this->events as $name => $handler)
		{
			$handler = CJavaScript::encode($handler);
			$cs->registerScript(__CLASS__.'#'.$id.'_'.$name, "jQuery('{$selector}').on('{$name}', {$handler});");
		}
	}
85002
public function run()
	{
		if(empty($this->options['id'])) {
			$this->options['id'] = $this->id;
		}
		
		if($this->encodeLabel) {
			$this->label = Html::encode($this->label);
		}
		
		$perPage = !empty($_GET[$this->pageSizeParam]) ? $_GET[$this->pageSizeParam] : $this->defaultPageSize;
		
		$listHtml = Html::dropDownList($this->pageSizeParam, $perPage, $this->sizes, $this->options);
		$labelHtml = Html::label($this->label, $this->options['id'], $this->labelOptions);
		
		$output = str_replace(['{list}', '{label}'], [$listHtml, $labelHtml], $this->template);
		
		return $output;
	}