Runs the widget.
This registers the necessary JavaScript code and renders the form open and close tags.

@throws InvalidCallException if `beginField()` and `endField()` calls are not matching.
11594
public function run()
    {
        if (!empty($this->_fields)) {
            throw new InvalidCallException('Each beginField() should have a matching endField() call.');
        }

        $content = ob_get_clean();
        $html = Html::beginForm($this->action, $this->method, $this->options);
        $html .= $content;
        $html .= Html::endForm();

        return $html;
    }
180427
public function run()
    {
        $options = $this->options;
        $tag = ArrayHelper::remove($options, 'tag', 'div');
        echo Html::beginTag($tag, $options) . "\n";
        echo $this->renderItems() . "\n";
        echo Html::endTag($tag) . "\n";
        $this->registerWidget('accordion');
    }
433177
public function run() {
		
		if ($this->selector) {
            $this->registerScript($this->selector, $this->options, $this->callback);
		} else {
			list($name, $id) = $this->resolveNameID();

			if ($this->hasModel()) {
				if ($this->form) {
					echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
				} else {
					echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
				}

			} else {
				echo CHtml::textField($name, $this->value, $this->htmlOptions);
			}

			$this->setLocaleSettings();
            $this->registerScript('#' . $id, $this->options, $this->callback);
		}

	}
1289125
public void run()
    {
        int iSFieldCount = this.getSFieldCount(); // Keep out of loop because of chance of free() during run()
        for (int iFieldSeq = 0; iFieldSeq < iSFieldCount; iFieldSeq++)
        {   // See if any of my children want to handle this command
            ScreenField sField = this.getSField(iFieldSeq);
            if (sField instanceof BasePanel)    // Run every basepanel
            {
                ((BasePanel)sField).run();
            }
        }
    }
529052
public function run()
    {
        $environment    = $this->itemContainer->getEnvironment();
        $inputProvider  = $environment->getInputProvider();
        $sessionStorage = $environment->getSessionStorage();

        // Ajax request.
        // @codingStandardsIgnoreStart - We need POST access here.
        if ($_POST && Environment::get('isAjaxRequest')) // @codingStandardsIgnoreEnd
        {
            $ajax = new Ajax($inputProvider->getValue('action'));
            $ajax->executePreActions();
        }

        $inputTable = $inputProvider->getParameter('table');
        $inputField = $inputProvider->getParameter('field');
        $inputId    = $inputProvider->getParameter('id');

        // Define the current ID.
        \define('CURRENT_ID', ($inputTable ? $sessionStorage->get('CURRENT_ID') : $inputId));

        $dispatcher = $GLOBALS['container']['event-dispatcher'];

        $translator = new TranslatorChain();
        $translator->add(new LangArrayTranslator($dispatcher));

        $this->itemContainer = (new DcGeneralFactory())
            ->setContainerName($inputTable)
            ->setTranslator($translator)
            ->setEventDispatcher($dispatcher)
            ->createDcGeneral();

        $information = (array) $GLOBALS['TL_DCA'][$inputTable]['fields'][$inputField];

        if (!isset($information['eval'])) {
            $information['eval'] = [];
        }

        // Merge with the information from the data container.
        $property = $environment
            ->getDataDefinition()
            ->getPropertiesDefinition()
            ->getProperty($inputField);
        $extra    = $property->getExtra();

        $information['eval'] = \array_merge($extra, $information['eval']);

        $property->setExtra(\array_merge($property->getExtra(), $information['eval']));

        $dataProvider = $environment->getDataProvider();
        $model        = $dataProvider->getEmptyModel();
        if ($inputProvider->getParameter('id')) {
            $modelId = ModelId::fromSerialized($inputProvider->getParameter('id'));
            $model   = $dataProvider->fetch($dataProvider->getEmptyConfig()->setId($modelId->getId()));
        }

        /** @var \ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\TreePicker $treeSelector */
        $treeSelector        = (new WidgetBuilder($environment))->buildWidget($property, $model);
        $treeSelector->value = \array_filter(\explode(',', $inputProvider->getParameter('value')));

        // AJAX request.
        if (isset($ajax)) {
            $treeSelector->generateAjax();
            $ajax->executePostActions(new DcCompat($environment));
        }


        $template = new ContaoBackendViewTemplate('be_main');
        $template
            ->set('isPopup', true)
            ->set('main', $treeSelector->generatePopup())
            ->set('theme', Backend::getTheme())
            ->set('base', Environment::get('base'))
            ->set('language', $GLOBALS['TL_LANGUAGE'])
            ->set('title', StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['treepicker']))
            ->set('charset', $GLOBALS['TL_CONFIG']['characterSet'])
            ->set('addSearch', $treeSelector->searchField)
            ->set('search', $GLOBALS['TL_LANG']['MSC']['search'])
            ->set('action', \ampersand(Environment::get('request')))
            ->set('value', $sessionStorage->get($treeSelector->getSearchSessionKey()))
            ->set('manager', $GLOBALS['TL_LANG']['MSC']['treepickerManager'])
            ->set('breadcrumb', $GLOBALS['TL_DCA'][$treeSelector->foreignTable]['list']['sorting']['breadcrumb'])
            ->set('managerHref', '');

        // Add the manager link.
        if ($treeSelector->managerHref) {
            $template
                ->set('managerHref', 'contao?' . \ampersand($treeSelector->managerHref) . '&amp;popup=1');
        }

        // Prevent debug output at all cost.
        $GLOBALS['TL_CONFIG']['debugMode'] = false;
        $template->output();
    }
209570
public function run()
	{

		list($name, $id) = $this->resolveNameID();

		$this->registerClientScript($id);

		$this->htmlOptions['id'] = $id;

		// Do we have a model?
		if ($this->hasModel()) {
			if ($this->form) {
				$html = $this->form->textArea($this->model, $this->attribute, $this->htmlOptions);
			} else {
				$html = CHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions);
			}
		} else {
			$html = CHtml::textArea($name, $this->value, $this->htmlOptions);
		}
		echo $html;
	}
1222597
public function run()
  {
    $this->renderContent();
    $content=ob_get_clean();
    if($this->hideOnEmpty && trim($content)==='')
      return;
    echo $this->_beginTag;
    echo $content;
    echo '</div>';
    echo Html::endTag($this->tagName);    
  }
614586
public function run()
    {
        $content = ob_get_clean();
        echo Html::tag('span', '', ['id' => $this->id]);
        echo Html::tag('span', $content, ['id' => $this->id . '-content']);

        if (Yii::$app->has('frontendState')) {
            Yii::$app->frontendState->set('form.' . $this->id . '.values', $this->initialValues);
        } else {
            $state = [
                'form' => [
                    $this->id => [
                        'values' => $this->initialValues,
                    ],
                ],
            ];
            \Yii::$app->view->registerJs('window.APP_REDUX_PRELOAD_STATES = [];', View::POS_HEAD);
            \Yii::$app->view->registerJs('window.APP_REDUX_PRELOAD_STATES.push(' . Json::encode($state) . ')', View::POS_HEAD, $this->id . '-state');
        }
    }
605109
public function run() {
        $this->registerFormScripts();
        if ($this->applyJqueryPaymentFormat || $this->applyJqueryPaymentValidation) {
            $this->registerJqueryPaymentScripts();
        }
	    
	return parent::run();
    }
427240
public function run()
    {
        Scripts::initializeClassLoader($this);
        Scripts::initializeSignalSlot($this);
        Scripts::initializePackageManagement($this);

        $this->activeRequestHandler = $this->resolveRequestHandler();
        $this->activeRequestHandler->handleRequest();
    }
887873
@Override
    public void run() {

        try {
            // do the import
            m_htmlImport.startImport(getReport());
        } catch (Exception e) {
            getReport().println(e);
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage());
            }
        }
    }
682482
public function run()
    {
        if ($this->hasModel()) {
            $input = Html::activeTextInput($this->model, $this->attribute, $this->options);
            $this->emailId = Html::getInputId($this->model, $this->emailAttribute);
            $this->formName = $this->model->formName();
        } else {
            //TODO We should not support this.
            $input = Html::textInput($this->name, $this->value, $this->options);
            $this->emailId = $this->name .'_'. $this->getId;
            $this->formName = '';
        }
        $this->registerClientScript();
        $action = Html::a($this->actionLabel, 'javascript:void(0);', $this->actionOptions);
        echo strtr($this->template, [
            '{input}' => $input,
            '{action}' => $action,
        ]);
    }
628679
public function run()
    {
        $view = $this->getView();

        $jsOptions = Json::encode([
            'id' => $this->id
        ]);

        $view->registerJs(<<<JS
        (function(sx, $, _)
        {
            sx.classes.FormUseTabs = sx.classes.Component.extend({

                _init: function()
                {
                    this.activeTab = window.location.hash.replace("#","");
                },

                _onDomReady: function()
                {
                    var self = this;

                    var JForm = $("#" + this.get('id'));
                    
                    var counter = 0;
                    $('.sx-form-tab').each(function(i,s)
                    {
                        counter = counter + 1;

                        var Jcontroll = $("<a>", {
                            'href' : '#' + $(this).attr('id'),
                            'aria-controls' : $(this).attr('id'),
                            'role' : 'tab',
                            'data-toggle' : 'tab',
                            'class' : 'nav-link',
                        }).append($(this).data('name'));

                        Jcontroll.on('click', function()
                        {
                            location.href = $(this).attr("href");
                        });

                        var Jli = $("<li>", {
                            'role' : 'presentation',
                            'class' : 'presentation nav-item',
                        }).append(Jcontroll);


                        if (self.activeTab)
                        {
                             if (self.activeTab == $(this).attr('id'))
                            {
                                Jli.addClass("active");
                                Jcontroll.addClass("active");
                                $(this).addClass("active");
                            }
                        } else
                        {
                            if (counter == 1)
                            {
                                Jli.addClass("active");
                                Jcontroll.addClass("active");
                                $(this).addClass("active");
                            }
                        }

                        $('.sx-form-tab-panel .nav').append(Jli);
                    });
                    
                    _.defer(function()
                    {
                        $('.sx-pre-loader-form', JForm).hide();
                        $('.sx-form-tab-panel', JForm).fadeIn();
                    });
                },
            });

            new sx.classes.FormUseTabs({$jsOptions});

        })(sx, sx.$, sx._);
JS
);

        $html = <<<HTML
            </div>
        </div>
HTML;

        return $html . parent::run();
    }
947911
public function run()
    {        
        $masonry = ob_get_clean();
        echo Html::beginTag('div', $this->options); //opens the container
            echo $masonry;
        echo Html::endTag('div'); //closes the container, opened on init
        $this->registerPlugin();
    }
396123
public function run()
    {
        echo Html::tag('div', '', ['id' => $this->id, 'align' => 'center']);
        $this->getView()->registerJs($this->js);
    }
804413
public function run() {
		
		$this->registerClientScript();
		$buttons=$this->createPageButtons();
		if(empty($buttons))
			return;
		echo CHtml::openTag($this->containerTag, $this->containerHtmlOptions);
		echo $this->header;
		echo CHtml::tag('ul',$this->htmlOptions,implode("\n",$buttons));
		echo '<div style="clear: both;"></div>';
		echo $this->footer;
		echo CHtml::closeTag($this->containerTag);
	}
1316319
public function run()
    {
        // if there is no renderTo id, build the layer with current id and initialize renderTo option
        if (!isset($this->pluginOptions['chart']) || !isset($this->pluginOptions['chart']['renderTo'])) {
            echo CHtml::openTag('div', $this->htmlOptions);
            echo CHtml::closeTag('div');

            if (isset($this->pluginOptions['chart']) && is_array($this->pluginOptions['chart'])) {
                $this->pluginOptions['chart']['renderTo'] = $this->htmlOptions['id'];
            } else {
                $this->pluginOptions['chart'] = array('renderTo' => $this->htmlOptions['id']);
            }

        }
        $this->registerClientScript();
    }