public function run() { if ($this->footerWrapper) { echo Html::beginTag('div', ['class' => 'form-group panel-footer']); } $submit_options = []; if ($this->form) { $submit_options['form'] = $this->form; } $extra = ''; if ($this->extraBtns) { $extra = ' ' . implode(' ', (array) $this->extraBtns); } if (isset($this->model->isNewRecord) && $this->model->isNewRecord) { if ($this->saveLink) { $submit_options['class'] = 'btn btn-success'; echo Html::submitButton(__('Create'), $submit_options); } echo $extra; } else { if ($this->saveLink) { $submit_options['class'] = 'btn btn-primary'; echo Html::submitButton(__('Update'), $submit_options); } echo $extra; if ($this->removeLink) { echo ' '; echo Html::a(__('Delete'), ['delete', 'id' => $this->model->id], ['class' => 'btn btn-danger', 'data-confirm' => __('Are you sure you want to delete this item?'), 'data-method' => 'post']); } } if ($this->footerWrapper) { echo Html::endTag('div'); } }
private function printTree($array, $level = 0, $parent = 0) { if ($this->groupOptions instanceof \Closure) { $func = $this->groupOptions; $groupOptions = $func($array, $level, $parent, $this->id); } else { $groupOptions = $this->groupOptions; } $groupOptions = array_merge(['id' => $this->id . '-navi-' . $parent], $groupOptions); $result = \yii\helpers\Html::beginTag($this->groupTag, $groupOptions); foreach ($array as $key => $val) { if ($this->elementOptions instanceof \Closure) { $func = $this->elementOptions; $elementOptions = $func($val, $level, $parent, $this->id); } else { $elementOptions = $this->elementOptions; } $result .= \yii\helpers\Html::beginTag($this->elementTag, $elementOptions); if ($this->value instanceof \Closure) { $value = $this->value; $result .= $value($val, $level); } else { $result .= $val['title']; } $result .= \yii\helpers\Html::endTag($this->elementTag); $result .= $val[$this->childAttribute] ? self::printTree($val[$this->childAttribute], $level + 1, $val['id']) : ''; } $result .= \yii\helpers\Html::endTag($this->groupTag); return $result; }
/** * @inheritdoc */ public function run() { if ($this->box) { self::boxBegin($this->box); } echo Html::beginTag('ul', ['class' => 'timeline', 'id' => $this->options['id']]); foreach ($this->data as $datum) { echo Html::beginTag('li', ['class' => 'time-label']); echo Html::tag('span', $datum['date']); echo Html::endTag('li'); foreach ($datum['items'] as $item) { echo Html::beginTag('li'); echo Html::tag('i', null, ['class' => 'fa fa-envelope']); echo Html::beginTag('div', ['class' => 'timeline-item']); echo Html::beginTag('span', ['class' => 'time']); echo Html::tag('i', null, ['class' => 'fa fa-clock-o']); echo ' ' . $item['time']; echo Html::endTag('span'); echo Html::tag('h3', $item['header'], ['class' => 'timeline-header']); echo Html::tag('div', $item['body'], ['class' => 'timeline-body']); echo Html::tag('div', $item['footer'], ['class' => 'timeline-footer']); echo Html::endTag('div'); echo Html::endTag('li'); } } echo Html::endTag('ul'); if ($this->box) { self::boxEnd(); } }
public function run() { $this->view->registerAssetBundle(MultiSelectAsset::className()); $options = $this->options; if (isset($options['id'])) { $id = $options['id']; } else { $id = BaseHtml::getInputId($this->model, $this->attribute); } if (isset($options['name'])) { $name = $options['name']; } elseif ($this->hasModel()) { $name = BaseHtml::getInputName($this->model, $this->attribute); } else { $name = $this->name; } // if (isset($options['value'])) { // $value = $options['value']; // } elseif ($this->hasModel()) { // $value = BaseHtml::getAttributeValue($this->model, $this->attribute); // } else { // $value = $this->value; // } $len = strlen($this->attribute); $widget = Html::beginTag('div', ['id' => $id, 'name' => $name]); foreach ($this->model as $k => $v) { if (substr($k, 0, $len + 1) == $this->attribute . '_') { $widget .= Html::activeCheckbox($this->model, $k, ['labelOptions' => ['class' => 'checkbox-inline']]); } } $widget .= Html::endTag('div'); echo $widget; }
/** * Renders the widget. */ public function run() { echo Html::beginTag('div', $this->options) . "\n"; echo $this->renderBar($this->label) . "\n"; echo Html::endTag('div') . "\n"; $this->registerPlugin('progress'); }
/** * Renders the widget. */ public function run() { echo Html::endTag('div'); //closes the container, opened on init $this->infiniteScrollScript(); $this->registerPlugin(); }
public function run() { SelectAsset::register($this->view); FilterAsset::register($this->view); $values = []; foreach ($this->data as $value) { $value = strval($value); $values[$value] = $value; } if (!$this->default) { $this->default = $this->multiple ? array_keys($values) : key($values); } $selected = $this->selected($this->default); // Setup options $options = ['id' => $this->name, 'name' => $this->name . '[]', 'style' => 'width: 300px;', 'class' => 'selectpicker']; $extra = ['title' => 'Not selected']; if ($this->multiple) { $extra['multiple'] = 'multiple'; } if ($this->placeholder) { $extra['title'] = strval($this->placeholder); } $options = array_merge($options, $extra); if (!$this->method) { $this->method = 'get'; } // Render echo Html::beginForm(Url::canonical(), $this->method, ['data-pjax' => '1', 'id' => $this->name]); echo Html::beginTag('select', $options, ['data-pjax' => '1']); echo Html::renderSelectOptions($selected, $values); echo Html::endTag("select"); echo Html::endForm(); parent::run(); }
/** * @inheritdoc */ public function run() { echo Html::beginTag('div', $this->options); echo Html::tag('div', $this->content, ['class' => 'ui sticky']); echo Html::endTag('div'); $this->registerPlugin('sticky'); }
/** * Renders the widget. */ public function run() { echo Html::beginTag('div', $this->options) . "\n"; echo $this->renderItems() . "\n"; echo Html::endTag('div') . "\n"; $this->registerPlugin('collapse'); }
/** * Renders the widget. */ public function run() { echo Html::beginTag('a', $this->options); echo Html::tag('i', '', ['class' => 'fa fa-' . $this->button]); echo $this->iconOnly ? '' : $this->label; echo Html::endTag('a'); }
public function run() { Assets::register($this->getView()); echo Html::beginTag('div', $this->containerOptions); if ($this->hasModel()) { echo Html::activeTextarea($this->model, $this->attribute, $this->options); } else { echo Html::textarea($this->name, $this->value, $this->options); } echo Html::endTag('div'); $js = ['mihaildev.ckEditor.registerOnChange(' . Json::encode($this->options['id']) . ');']; if (isset($this->editorOptions['filebrowserUploadUrl'])) { $js[] = "mihaildev.ckEditor.registerCsrf();"; } if (!isset($this->editorOptions['on']['instanceReady'])) { $this->editorOptions['on']['instanceReady'] = new JsExpression("function( ev ){" . implode(' ', $js) . "}"); } if ($this->_inline) { $JavaScript = "CKEDITOR.inline("; $JavaScript .= Json::encode($this->options['id']); $JavaScript .= empty($this->editorOptions) ? '' : ', ' . Json::encode($this->editorOptions); $JavaScript .= ");"; $this->getView()->registerJs($JavaScript, View::POS_END); $this->getView()->registerCss('#' . $this->containerOptions['id'] . ', #' . $this->containerOptions['id'] . ' .cke_textarea_inline{height: ' . $this->editorOptions['height'] . 'px;}'); } else { $JavaScript = "CKEDITOR.replace("; $JavaScript .= Json::encode($this->options['id']); $JavaScript .= empty($this->editorOptions) ? '' : ', ' . Json::encode($this->editorOptions); $JavaScript .= ");"; $this->getView()->registerJs($JavaScript, View::POS_END); } }
/** * Executes the widget. */ public function run() { echo Html::beginTag('div', ['class' => 'btn-group']); echo $this->renderButton() . "\n" . $this->renderDropdown(); echo Html::endTag('div'); $this->registerPlugin('button'); }
/** * @return string */ public function run() { $classes = ['posts-widget']; if ($this->renderCategories) { $classes[] = 'with-categories'; } if ($this->renderPreviews) { $classes[] = 'with-previews'; } $output = Html::beginTag('div', ['class' => implode(' ', $classes)]); if (!count($this->items)) { return $this->renderEmpty(); } foreach ($this->items as $item) { if ($item['category'] && $this->renderCategories) { $output .= Html::beginTag('div', ['class' => 'subcategory col-xs-12 col-sm-4']); $output .= Html::tag('h2', $item['category']->title); } $output .= $this->renderPosts($item['posts']); if ($item['category'] && $this->renderCategories) { $output .= Html::endTag('div'); } } $output .= Html::endTag('div'); return $output; }
/** * */ public function run() { echo Html::beginTag('section', ['class' => 'top-bar-section']); echo $this->renderItems(); echo Html::endTag('section'); FoundationAsset::register($this->getView()); }
public function run() { $component = \Yii::$app->get('moderatorPanel'); /** @var Component $component */ $items = []; foreach ($component->getWidgets() as $widget) { $content = call_user_func([$widget['class'], 'widget'], $widget['options']); if (!empty($content)) { $items[] = $content; } } if (!empty($items)) { echo Html::tag('div', 'MP', ['id' => 'moderator-panel-open-button', 'onclick' => 'mihaildev.moderatorPanel.buttonClick()']); echo Html::beginTag('div', ['id' => 'moderator-panel-frame']); echo Html::beginTag('div', ['id' => 'moderator-panel-frame-header']); echo Html::tag('div', '×', ['id' => 'moderator-panel-frame-close', 'onclick' => 'mihaildev.moderatorPanel.closeFrame()']); echo Html::tag('div', 'Title', ['id' => 'moderator-panel-frame-title']); echo Html::endTag('div'); echo Html::beginTag('div', ['id' => 'moderator-panel-frame-body']); echo Html::endTag('div'); echo Html::endTag('div'); echo Html::beginTag('div', ['id' => 'moderator-panel']); echo Html::beginTag('div', ['id' => 'moderator-panel-header']); echo Html::tag('div', '×', ['id' => 'moderator-panel-close', 'onclick' => 'mihaildev.moderatorPanel.buttonClick()']); echo Html::tag('div', 'MP', ['id' => 'moderator-panel-title']); echo Html::endTag('div'); echo Html::beginTag('ul', ['id' => 'moderator-panel-menu']); echo '<li>' . implode('</li><li>', $items) . "</li>"; echo Html::endTag('ul'); echo Html::endTag('div'); echo '<style>' . $this->getView()->renderPhpFile(__DIR__ . '/assets/css.css') . '</style>'; echo '<script>' . $this->getView()->renderPhpFile(__DIR__ . '/assets/js.js') . '</script>'; } }
/** * Registers the needed assets */ public function registerAssets() { $view = $this->getView(); $obj = VideoJsAsset::register($view); echo "\n" . Html::beginTag('video', $this->options); if (!empty($this->tags) && is_array($this->tags)) { foreach ($this->tags as $tagName => $tags) { if (is_array($this->tags[$tagName])) { foreach ($tags as $tagOptions) { $tagContent = ''; if (isset($tagOptions['content'])) { $tagContent = $tagOptions['content']; unset($tagOptions['content']); } echo "\n" . Html::tag($tagName, $tagContent, $tagOptions); } } else { throw new InvalidConfigException("Invalid config for 'tags' property."); } } } echo "\n" . Html::endTag('video'); if (!empty($this->jsOptions)) { $js = 'videojs("#' . $this->options['id'] . '").ready(' . Json::encode($this->jsOptions) . ');'; $view->registerJs($js); } }
/** * @return string */ protected function renderItems() { return Html::ul($this->items, ['encode' => false, 'item' => function ($item, $index) { if (!isset($item['fontSize'])) { $item['fontSize'] = self::DEFAULT_FONT_SIZE; } $html = ''; $html .= Html::beginTag('li', ['data-transition' => 'fade', 'data-slotamount' => '1', 'data-masterspeed' => '1000', 'data-style' => 'dark']); $html .= Html::img($item['imageUrl'], ['data-bgposition' => 'center center', 'data-bgfit' => 'cover', 'data-bgrepeat' => 'no-repeat']); // MAIN TITLE $html .= Html::beginTag('div', ['class' => 'caption customin customout', 'data-x' => 'center', 'data-y' => 'center', 'data-hoffset' => '', 'data-voffset' => '-30', 'data-speed' => '500', 'data-start' => '1000', 'data-customin' => 'x:0;y:0;z:0;rotationX:0.5;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-customout' => 'x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-easing' => 'Back.easeOut', 'data-splitin' => 'none', 'data-splitout' => 'none', 'data-elementdelay' => '0.1', 'data-endelementdelay' => '0.1', 'data-endspeed' => '600']); $html .= Html::tag('h3', $item['title'], ['class' => "c-main-title c-font-{$item['fontSize']} c-font-bold c-font-center c-font-uppercase c-font-white c-block"]); $html .= Html::endTag('div'); // SUB TITLE if (isset($item['subTitle'])) { $html .= Html::beginTag('div', ['class' => 'caption customin customout', 'data-x' => 'left', 'data-y' => 'bottom', 'data-hoffset' => '', 'data-voffset' => '', 'data-speed' => '500', 'data-start' => '1800', 'data-customin' => 'x:0;y:0;z:0;rotationX:0.5;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-customout' => 'x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-easing' => 'Back.easeOut', 'data-splitin' => 'none', 'data-splitout' => 'none', 'data-elementdelay' => '0.1', 'data-endelementdelay' => '0.1', 'data-endspeed' => '600', 'style' => 'width: 100%;']); $html .= Html::beginTag('div', ['class' => 'c-action-bar']); $html .= Html::beginTag('div', ['class' => 'container']); $html .= Html::beginTag('div', ['class' => 'c-content']); $html .= Html::tag('h3', $item['subTitle'], ['class' => 'c-font-30 c-font-sbold c-font-white']); $html .= Html::endTag('div'); $html .= Html::endTag('div'); $html .= Html::endTag('div'); $html .= Html::endTag('div'); } $html .= Html::endTag('li'); return $html; }]); }
public function run() { $options = $this->options; if (isset($options['id'])) { $id = $options['id']; } else { $id = 'editor'; } if (isset($options['name'])) { $name = $options['name']; } elseif ($this->hasModel()) { $name = BaseHtml::getInputName($this->model, $this->attribute); } else { $name = $this->name; } if (isset($options['value'])) { $value = $options['value']; } elseif ($this->hasModel()) { $value = BaseHtml::getAttributeValue($this->model, $this->attribute); } else { $value = $this->value; } echo Html::beginTag('script', ['id' => $id, 'type' => 'text/plain', 'name' => $name, 'style' => "height:{$this->height}"]); echo $value; echo Html::endTag('script'); if (!isset($options['config'])) { $options['config'] = []; } $ueditorConfig = ArrayHelper::merge(['serverUrl' => Url::to(['ueditor/controller'])], $options['config']); $config = Json::encode($ueditorConfig); $view = $this->getView(); UEditorAsset::register($view); $view->registerJs("var ue = UE.getEditor('{$id}', {$config});"); }
/** * Renders the widget. */ public function run() { echo Html::beginTag('div', $this->options) . "\n"; echo $this->renderProgress() . "\n"; echo Html::endTag('div') . "\n"; UIkitAsset::register($this->getView()); }
/** * Print */ public function generate() { $content = []; $iteration = 0; $partners = Partner::find()->viaMailingLists($this->mailingLists)->all(); if ($this->items_per_page) { $page_separator = Html::tag('div', '', ['style' => ['clear' => 'both']]); $page_begin_tag = Html::beginTag('div', ['style' => ['page-break-before' => 'always']]); $page_end_tag = $page_separator . Html::endTag('div'); $content[] = $page_begin_tag; } foreach ($partners as $partner) { $iteration++; $content[] = $this->processContent($this->content, $partner); if ($this->items_per_page && $iteration % $this->items_per_page == 0) { $content[] = $page_end_tag; $content[] = $page_begin_tag; } } if ($this->items_per_page) { $content[] = $page_end_tag; } $content = implode(PHP_EOL, $content); if ($this->wrapper_enabled) { $content = preg_replace('/\\{content\\}/Sui', $content, $this->wrapper); } return $content; }
/** * @return string */ public function endTag() { if ($this->_tag == false) { return ''; } return Html::endTag($this->_tag); }
/** * Initializes the widget. */ public function init() { parent::init(); echo Html::beginTag('div', ['class' => 'modal fade', 'id' => $this->modalId, 'role' => "dialog"]); echo Html::beginTag('div', ['class' => 'modal-dialog ' . $this->modalSize]); echo Html::beginTag('div', ['class' => 'modal-content']); echo Html::beginTag('div', ['class' => 'modal-header']); echo Html::beginTag('button', ['type' => "button", 'class' => "close", 'data-dismiss' => "modal"]); echo Html::beginTag('span', ['aria-hidden' => "true"]); echo "×"; echo Html::endTag('span'); echo Html::beginTag('span', ['class' => "sr-only"]); echo "Close"; echo Html::endTag('span'); echo Html::endTag('button'); echo Html::beginTag('h4', ['class' => "modal-title"]); echo Html::endTag('h4'); echo Html::endTag('div'); echo Html::beginTag('div', ['class' => 'modal-body']); echo Html::beginTag('div', ['class' => 'content', 'style' => 'overflow:auto;']); echo Html::endTag('div'); echo Html::endTag('div'); /* modal-footer tak hapus. Kayaknya ga pernah kepake. Biar tampilan modalnya bagus, ga ada garis bawah pengganggu echo Html::beginTag('div', ['class'=>'modal-footer']); echo Html::endTag('div');*/ echo Html::endTag('div'); echo Html::endTag('div'); echo Html::endTag('div'); if ($this->registerAsset) { ModalAsset::register($this->getView()); } }
public function endBulkActions() { echo "\n" . Html::endTag('fieldset'); echo "\n" . Html::endTag('div'); echo "\n" . Html::endTag('div'); // print Html::tag('div', '', ['class' => 'clearfix']); }
public function init() { parent::init(); $session = \Yii::$app->getSession(); $flashes = $session->getAllFlashes(); $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : ' alert'; foreach ($flashes as $type => $data) { if (isset($this->alertTypes[$type])) { $data = (array) $data; foreach ($data as $i => $message) { /* initialize css class for each alert box */ $this->options['class'] = $this->alertTypes[$type] . $appendCss; /* assign unique id to each alert box */ $this->options['id'] = $this->getId() . '-' . $type . '-' . $i; echo Html::beginTag('div', $this->options); if (is_array($message)) { foreach ($message as $msg) { echo Html::beginTag('p'); echo $msg; echo Html::endTag('p'); } } else { echo Html::beginTag('p'); echo $message; echo Html::endTag('p'); } echo Html::endTag('div'); } $session->removeFlash($type); } } }
/** * Renders the widget. * @return string */ public function run() { echo Html::a('', false, ['name' => 'footer']); echo Html::beginTag('footer', ['class' => 'c-layout-footer c-layout-footer-4 c-bg-footer-8']); echo Html::beginTag('div', ['class' => 'c-footer']); echo Html::beginTag('div', ['class' => 'container']); echo Html::beginTag('div', ['class' => 'row']); echo Html::beginTag('div', ['class' => 'col-md-6 c-footer-4-p-right']); echo Html::beginTag('div', ['class' => 'c-content-title-1']); echo Html::tag('h3', $this->title, ['class' => 'c-font-uppercase c-font-bold c-font-white c-border']); echo Html::endTag('div'); echo Html::tag('p', $this->about, ['class' => 'c-about']); echo Html::tag('ul', $this->social, ['class' => 'c-socials']); echo Html::endTag('div'); echo Html::beginTag('div', ['class' => 'col-md-6 c-footer-4-p-right']); echo Html::beginTag('div', ['class' => 'c-feedback']); echo Html::tag('h3', 'CONTACT', ['class' => 'c-font-thin']); echo Html::tag('p', $this->contact, ['class' => 'c-contact c-font-white']); echo Html::endTag('div'); echo Html::endTag('div'); echo Html::endTag('div'); echo Html::endTag('div'); echo Html::endTag('div'); echo Html::endTag('footer'); }
protected function renderAsManager() { echo Html::beginTag('span', ['style' => "font-size: {$this->fontSize}"]); echo Yii::t('hipanel:dashboard', '{count} {total}', ['count' => $this->totalCount, 'total' => '<small>' . Yii::t('hipanel:dashboard', '{0, plural, other{total}}', $this->totalCount) . '</small>']); echo Html::tag('small', ' / ' . Yii::t('hipanel:dashboard', '{0, plural, other{# own}}', $this->ownCount)); echo Html::endTag('span'); }
/** * run function. * * @access public * @return void */ public function run() { $classes = $this->generateClass(); echo Html::beginTag('div', ['class' => $classes]) . "\n"; echo $this->renderItems() . "\n"; echo Html::endTag('div') . "\n"; }
/** * Renders the widget. */ public function run() { echo Html::beginTag('div', $this->options) . "\n"; echo $this->renderItems() . "\n"; echo Html::endTag('div') . "\n"; $this->registerWidget(); }
protected static function renderRow($model, $row, $templateName = null) { if (!empty($row['items'])) { $html = null; $items = static::renderItems($model, $row['items'], $templateName); if (count($items)) { $type = !empty($row['type']) && in_array($row['type'], self::types()) ? self::$types[$row['type']] : ['tag' => null, 'class' => null, 'delimiter' => "\n"]; if (!empty($type['tag']) && !empty($type['options']) && count($items) > 1) { $html .= Html::beginTag($type['tag'], $type['options']); } foreach ($items as $elements) { if (!empty($type['itemTag'])) { $html .= Html::beginTag($type['itemTag']); } foreach ($elements as $element) { $html .= $element; } if (!empty($type['itemTag'])) { $html .= Html::endTag($type['itemTag']); } } if (!empty($type['tag']) && !empty($type['options']) && count($items) > 1) { $html .= Html::endTag($type['tag']); } } } return $html; }
/** * @inheritdoc */ public function run() { if (!empty($this->_fields)) { throw new InvalidCallException('Each beginField() should have a matching endField() call.'); } echo Html::endTag('div'); }