### .run()

Runs the widget.
@since  9/21/12 8:13 PM  antonio ramirez <antonio@clevertech.biz>
Updated to use stacked progress bars
350634
public function run() {
		
		echo CHtml::openTag('div', $this->htmlOptions);
		if (empty($this->stacked)) {
			echo '<div class="'.implode(' ', $this->progressBarClasses).'" style="width: ' . $this->percent . '%;">' . $this->content . '</div>';
		} elseif (is_array($this->stacked)) {
			foreach ($this->stacked as $bar) {
				$options = isset($bar['htmlOptions']) ? $bar['htmlOptions'] : array();
				if (empty($options['style'])) {
					$options['style'] = '';
				} else {
					$options['style'] .= ' ';
				}
				$options['style'] .= 'width: ' . $bar['percent'] . '%';

				if (empty($options['class'])) {
					$options['class'] = '';
				} else {
					$options['style'] .= ' ';
				}
				$options['class'] .= 'progress-bar progress-bar-' . $bar['context'];

				echo '<div ' . CHtml::renderAttributes($options) . '>' . @$bar['content'] . '</div>';
			}
		}
		echo CHtml::closeTag('div');
	}
609311
public function run()
    {
        if (null !== $this->date) {
            $this->htmlOptions['title'] = $this->date;
            echo CHtml::tag($this->tagName, $this->htmlOptions, '&nbsp;');
        }
        $this->registerClientScript();
    }
56095
public function run()
	{
		switch ($this->type)
		{
			case self::TYPE_CHECKBOX:
				$this->checkBox();
				break;

			case self::TYPE_CHECKBOXLIST:
				$this->checkBoxList();
				break;

			case self::TYPE_CHECKBOXLIST_INLINE:
				$this->checkBoxListInline();
				break;

			case self::TYPE_DROPDOWN:
				$this->dropDownList();
				break;

			case self::TYPE_FILE:
				$this->fileField();
				break;

			case self::TYPE_PASSWORD:
				$this->passwordField();
				break;

			case self::TYPE_RADIO:
				$this->radioButton();
				break;

			case self::TYPE_RADIOLIST:
				$this->radioButtonList();
				break;

			case self::TYPE_RADIOLIST_INLINE:
				$this->radioButtonListInline();
				break;

			case self::TYPE_RADIOBUTTONGROUPSLIST:
				$this->radioButtonGroupsList();
				break;

			case self::TYPE_TEXTAREA:
				$this->textArea();
				break;

			case self::TYPE_TEXT:
				$this->textField();
				break;

			case self::TYPE_CAPTCHA:
				$this->captcha();
				break;

			case self::TYPE_UNEDITABLE:
				$this->uneditableField();
				break;

			case self::TYPE_DATEPICKER:
				$this->datepickerField();
				break;

			case self::TYPE_REDACTOR:
				$this->redactorJs();
				break;

			case self::TYPE_MARKDOWNEDITOR:
				$this->markdownEditorJs();
				break;

			case self::TYPE_HTML5EDITOR:
				$this->html5Editor();
				break;

			case self::TYPE_DATERANGEPICKER:
				$this->dateRangeField();
				break;

			case self::TYPE_TOGGLEBUTTON:
				$this->toggleButton();
				break;

			case self::TYPE_COLORPICKER:
				$this->colorpickerField();
				break;

			case self::TYPE_CKEDITOR:
				$this->ckEditor();
				break;

			// Adding timepicker (Sergii)
			case self::TYPE_TIMEPICKER:
				$this->timepickerField();
				break;

			case self::TYPE_SELECT2:
				$this->select2Field();
				break;

			default:
				throw new CException(__CLASS__ . ': Failed to run widget! Type is invalid.');
		}
	}
1283929
public function run()
    {
        $this->isAjax = false;
        $layer = $this->setLayer();
        $layer::widget($this->layerOptions);

        $this->getFlashes();
        $this->getDiv();
        $this->registerJs();

        parent::run();
    }
838193
public function run()
	{
		$this->registerClientScript();
		$buttons=$this->createPageButtons();
		if(empty($buttons))
			return;
		//echo $this->header;
		echo CHtml::tag('ul', $this->htmlOptions,implode("\n",$buttons));
		echo $this->footer;
	}
518026
public function run()
    {
        $id = $this->options['id'];
        $options = Json::htmlEncode($this->getClientOptions());
        $view = $this->getView();
        GridViewAsset::register($view);
        $view->registerJs("jQuery('#$id').yiiGridView($options);");

        $options = array_merge($this->defaultBoxOptions, [
            'options' => $this->options,
            'title' => $this->title,
            'tools' => $this->tools,
            'content' => '<div class="table-responsive">'.$this->renderItems().'</div>',
            'footer' => $this->renderFooter(),
        ], $this->boxOptions);

        echo \webtoolsnz\AdminLte\widgets\Box::widget($options);
    }
1070041
public function run()
    {
        $this->registerClientScript();

        if ($this->hasModel()) {
            $input = Html::activeHiddenInput($this->model, $this->attribute, $this->options);
        } else {
            $input = Html::hiddenInput($this->name, $this->value, $this->options);
        }

        echo strtr($this->template, [
            '{input}' => $input,
            '{jstree}' => Html::tag('div', '', ['id' => $this->getJsTreeId()]),
        ]);
    }
667438
public function run()
    {
        if (($flashMessages = Yii::$app->session->getAllFlashes())) {
            echo '<div class="flashes">';
            foreach ($flashMessages as $key => $messages) {
                $cssClasses = 'alert alert-'.(isset($this->_map[$key]) ? $this->_map[$key] : $key);
                if (!is_array($messages)) {
                    $messages = [$messages];
                }
                foreach ($messages as $message) {
                    echo '<div class="'.$cssClasses.'">'.$message.'</div>';
                }
            }
            echo '</div>';
        }
    }
130466
public function run()
	{
		$script = '';
		$script = $script.'KindEditor.ready(function(K){var editor=K.create("textarea[id='.$this->options['id'].']", {'.$this->renderItems($this->items).'})});';
		$this->getView()->registerJs($script);
		KindEditorAsset::register($this->getView());
	}
1047380
public function run()
    {
        $brand = $this->brandLabel !== false
            ? TbHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions)
            : '';
        ob_start();
        foreach ($this->items as $item) {
            if (is_string($item)) {
                echo $item;
            } else {
                $widgetClassName = TbArray::popValue('class', $item);
                if ($widgetClassName !== null) {
                    $this->controller->widget($widgetClassName, $item);
                }
            }
        }
        $items = ob_get_clean();
        ob_start();
        if ($this->collapse !== false) {
            TbHtml::addCssClass('navbar-collapse', $this->collapseOptions);
            ob_start();
            /* @var TbCollapse $collapseWidget */
            $collapseWidget = $this->controller->widget(
                '\TbCollapse',
                array(
                    'toggle' => false, // navbars are collapsed by default
                    'content' => $items,
                    'htmlOptions' => $this->collapseOptions,
                )
            );
            $collapseContent = ob_get_clean();
            echo TbHtml::tag(
                'div', array('class' => 'navbar-header'),
                TbHtml::navbarCollapseLink('#' . $collapseWidget->getId()) . $brand
            );
            echo $collapseContent;

        } else {
            echo TbHtml::tag('div', array('class' => 'navbar-header'), $brand);
            echo $items;
        }
        $containerContent = ob_get_clean();
        $containerOptions = TbArray::popValue('containerOptions', $this->htmlOptions, array());
        TbHtml::addCssClass($this->fluid ? 'container-fluid' : 'container', $containerOptions);
        ob_start();
        echo TbHtml::openTag('div', $containerOptions);
        echo $containerContent;
        echo '</div>';
        $content = ob_get_clean();
        echo TbHtml::navbar($content, $this->htmlOptions);
    }
624661
public function run()
	{
		$formatter=$this->getFormatter();
		echo Html::beginTag($this->tagName, $this->options);

		$i=0; // c@cba : $i counts the rows. "itemCssClass"es are assigned accordingly. Below we need to make adjustments, so the counting remains correct.
		$open_row = false;
		$n = is_array($this->itemCssClass) ? count($this->itemCssClass) : 0;
		
		$tr_empty = array('{label}'=>'', '{class}'=>'', '{value}'=>'');
						
		foreach($this->attributes as $attribute)
		{
			// c@cba : Adjustment to $i : If currently (openRow == true) AND the current attribute is header or oneRow, we will
			// need to close the row and start a new row. Thus $i must be increased by one for that...
			if( $open_row == true && is_array($attribute) && (isset($attribute['header']) || isset($attribute['oneRow'])) )
				$i++;
			
			if(is_array($attribute) && isset($attribute['header'])) {
				$tr = $tr_empty;
				$tr['{label}'] = $attribute['header'];
				$tr['{class}'] = ($n ? $this->itemCssClass[$i%$n] : '') . ' header';
				if(isset($attribute['cssClass']))
					$tr['{class}'] = $attribute['cssClass'] . ' ' . $tr['{class}'];
				if($open_row == true) { // close previous row
					echo strtr($this->itemTemplateRight,$tr_empty); 
					$open_row = false;
				}
				echo strtr($this->itemTemplateHeader,$tr);
				$i++;
			}
			else {
				if(is_string($attribute))
				{
					if(!preg_match('/^([\w\.]+)(:(\w*))?(:(.*))?$/',$attribute,$matches))
						throw new InvalidConfigException(Yii::t('app','The attribute must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional.'));
					$attribute=array(
						'attribute'=>$matches[1],
						'format'=>isset($matches[3]) ? $matches[3] : 'text',
					);
				
					if(isset($matches[5]))
						$attribute['label']=$matches[5];
				}
				
				if(isset($attribute['visible']) && !$attribute['visible'])
					continue;

				$tr=array('{label}'=>'', '{class}'=>$n ? $this->itemCssClass[$i%$n] : '');
				if(isset($attribute['cssClass']))
					$tr['{class}']=$attribute['cssClass'].' '.($n ? $tr['{class}'] : '');
					
				if(isset($attribute['label']))
					$tr['{label}']= ($attribute['label']) ? $attribute['label'] : $this->model->getAttributeLabel($attribute['attribute']);
				else if(isset($attribute['attribute']))
				{
					if($this->model instanceof Model)
						$tr['{label}']=$this->model->getAttributeLabel($attribute['attribute']);
					else 
						$tr['{label}']=ucwords(trim(strtolower(str_replace(array('-','_','.'),' ',preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $attribute['attribute'])))));
				}
				else if(isset($attribute['attribute']))
					$tr['{label}']= $this->model->getAttributeLabel($attribute['attribute']);

				if(!isset($attribute['format']))
					$attribute['format']='text';
				if(isset($attribute['value']))
					$value=$attribute['value'];
				else if(isset($attribute['attribute']))
					$value = ArrayHelper::getValue($this->model,$attribute['attribute']);
				else
					$value=null;

				$tr['{value}']=$value===null ? $this->nullDisplay : $formatter->format($value,$attribute['format']);

				if(isset($attribute['oneRow']) && $attribute['oneRow'] === true) {
					if($open_row == true) { // close previous row
						echo strtr($this->itemTemplateRight,$tr_empty); 
						$open_row = false;
					}
					echo strtr($this->itemTemplateOneRow,$tr);
					$i++;
				}
				else {
					if($open_row == true) {
						echo strtr($this->itemTemplateRight,$tr);
						$open_row = false;
						$i++;
					}
					else {
						echo strtr($this->itemTemplateLeft,$tr);
						$open_row = true;
					}
				}
			}
		}
		echo Html::endTag($this->tagName);
	}
753938
public function run()
	{
		$id=$this->getId();
		if(isset($this->htmlOptions['id']))
			$id=$this->htmlOptions['id'];
		else
			$this->htmlOptions['id']=$id;

		$options=CJavaScript::encode($this->options);
		Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}').sortable({$options});");

		echo CHtml::openTag($this->tagName,$this->htmlOptions)."\n";
		foreach($this->items as $id=>$content)
			echo strtr($this->itemTemplate,array('{id}'=>$id,'{content}'=>$content))."\n";
		echo CHtml::closeTag($this->tagName);
	}
919617
public function run()
    {
        echo Html::a($this->buttonLabel, false, [
            'value' => $this->url,
            'data-toggle' => 'tooltip', 'title' => $this->tooltipTitle,
            'class' => "showModalButton {$this->buttonCssClass}",
            'accesskey' => $this->accessKey,
            'name' => $this->name,
        ]);
    }
773686
public function run() {
		
		echo CHtml::openTag('nav', $this->htmlOptions);
		echo '<div class="' . $this->getContainerCssClass() . '">';
		
		echo '<div class="navbar-header">';
		if($this->collapse) {
			$this->controller->widget('booster.widgets.TbButton', $this->toggleButtonWidgetOptions);
		}
		
		if ($this->brand !== false) {
			if ($this->brandUrl !== false) {
				echo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';
			} else {
				unset($this->brandOptions['href']); // spans cannot have a href attribute
				echo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';
			}
		}
		echo '</div>';
		
		echo '<div class="collapse navbar-collapse" id="'.self::CONTAINER_PREFIX.$this->id.'">';
		foreach ($this->items as $item) {
			if (is_string($item)) {
				echo $item;
			} else {
				if (!isset($item['type'])) {
					$item['type'] = 'navbar';
				}
				
				if (isset($item['class'])) {
					$className = $item['class'];
					unset($item['class']);

					$this->controller->widget($className, $item);
				}
			}
		}
		echo '</div></div></nav>';
	}
318549
public function run()
    {
        //echo Html::endTag('div');
        $tag = ArrayHelper::remove($this->options, 'tag', 'nav');
        echo Html::endTag($tag, $this->options);
        if ($this->fixed) {
            echo Html::endTag('div');
        }
        MaterializePluginAsset::register($this->getView());
    }
162330
public function run()
    {
        echo Html::beginTag('div', ['class' => 'portlet-input input-inline']);
        echo Html::beginTag('div', ['class' => 'input-icon right']);
        echo Html::tag('i', '', ['class' => 'icon-magnifier']);

        ActiveForm::begin([
            'action' => $this->url,
            'method' => 'get',
        ]);
        echo Html::activeInput('text', $this->searchModel, 'searchField', ['class' => 'form-control input-circle', 'placeholder' => 'search...', 'autofocus' => true]);
        ActiveForm::end();

        echo Html::endTag('div');   // portlet-input input-inline
        echo Html::endTag('div');   // input-icon right
        echo ' ';
        echo Html::a(Html::tag('i', '', ['class' => 'fa fa-refresh']), $this->resetUrl, ['class' => 'btn btn-circle purple btn-sm', 'accesskey' => '',
            'data-toggle' => 'tooltip', 'title' => 'Reset Search',
        ]);
    }
124537
public function run()
    {
        if (!empty($this->_widgets)) {
            throw new InvalidCallException('Each beginWidget() should have a matching endWidget() call.');
        }
        $id = $this->options['id'];
        $view = $this->getView();
        $options = !empty($this->clientOptions) ? Json::encode($this->clientOptions) : Json::encode([]);
        GridstackAsset::register($view);
        $view->registerJs("jQuery('#$id').gridstack($options);");
        echo self::endContainer($this->tag);
    }