Пример #1
0
 public function run()
 {
     echo Html::beginTag('div', ['class' => 'input-group']);
     if (!isset($this->options['class'])) {
         $this->options['class'] = 'form-control';
     }
     $iconId = 'icon-' . $this->options['id'];
     if (!isset($this->options['aria-describedby'])) {
         $this->options['aria-describedby'] = $iconId;
     }
     if ($this->hasModel()) {
         $replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
     } else {
         $replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
     }
     if ($this->icon != '') {
         $replace['{icon}'] = Html::tag('span', Icon::show($this->icon, [], Icon::FA), ['class' => 'input-group-addon', 'id' => $iconId]);
     }
     echo strtr($this->template, $replace);
     echo Html::endTag('div');
     $view = $this->getView();
     Assets::register($view);
     $idMaster = $this->hasModel() ? Html::getInputId($this->model, $this->fromField) : $this->fromField;
     $idSlave = $this->options['id'];
     $view->registerJs("\n        \$('#{$idMaster}').syncTranslit({\n            destination: '{$idSlave}',\n            type: 'url',\n            caseStyle: 'lower',\n            urlSeparator: '-'\n        });");
 }
Пример #2
0
 public function renderItem($message, $options)
 {
     echo Html::beginTag('div', $options) . "\n";
     echo Html::beginTag('p');
     echo $message;
     echo Html::endTag('p');
     echo "\n" . Html::endTag('div');
 }
Пример #3
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     Html::addCssClass($this->containerOptions, ['widget' => 'dropdown actions']);
     $options = $this->containerOptions;
     $tag = ArrayHelper::remove($options, 'tag', 'div');
     $this->registerPlugin('button');
     return implode("\n", [Html::beginTag($tag, $options), $this->renderButton(), $this->renderItems(), Html::endTag($tag)]);
 }
 /**
  * Renders the widget.
  */
 public function run()
 {
     // @todo use [[options]] instead of [[containerOptions]] and introduce [[buttonOptions]] before 2.1 release
     Html::addCssClass($this->containerOptions, ['widget' => 'btn-group']);
     $options = $this->containerOptions;
     $tag = ArrayHelper::remove($options, 'tag', 'div');
     $this->registerPlugin('button');
     return implode("\n", [Html::beginTag($tag, $options), $this->renderButton(), $this->renderDropdown(), Html::endTag($tag)]);
 }
Пример #5
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     if (!isset($this->options['id'])) {
         $this->options['id'] = $this->getId();
     }
     $this->initOptions();
     echo $this->renderToggleButton() . "\n";
     echo Html::beginTag('div', ['class' => 'modal-dialog ' . $this->size]) . "\n";
     echo Html::beginTag('div', ['class' => 'modal-content']) . "\n";
     echo $this->renderHeader() . "\n";
     echo $this->renderBodyBegin() . "\n";
 }
Пример #6
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     parent::run();
     // TODO: Change the autogenerated stub
     if (!empty($this->country)) {
         $class = 'flag-icon flag-icon-' . $this->country;
         Html::addCssClass($this->options, $class);
         if ($this->squared) {
             Html::addCssClass($this->options, 'flag-icon-squared');
         }
         $this->register();
         echo Html::beginTag('span', $this->options);
         echo Html::endTag('span');
     }
 }
Пример #7
0
 public function torMenu($parent = null, $level = 1)
 {
     $links = Links::find()->where(['categories_id' => $this->categories_id, 'parent' => $parent])->orderBy(['seq' => SORT_ASC])->all();
     $items = Html::beginTag('ul', ['class' => 'tor-nav-' . $level . ' ' . ($level > 2 ? 'list-unstyled' : 'list-inline')]);
     /** @var $link Links */
     foreach ($links as $link) {
         $items .= '<li>' . Html::a($link->anchor, $link->url);
         if ($link->child_exist == 1) {
             if ($link->level == 1) {
                 $items .= '<span class="caret"></span>' . Html::tag('div', $this->torMenu($link->id, $link->level + 1), ['class' => 'tor-sub-nav']);
             } else {
                 $items .= $this->torMenu($link->id, $link->level + 1);
             }
         }
         $items .= '</li>';
     }
     $items .= Html::endTag('ul');
     return $items;
 }
Пример #8
0
 /**
  * @return string render input
  */
 protected function renderInput()
 {
     $input = Html::dropDownList($this->name, $this->selected, $this->items, $this->options);
     // If use form model then $input use active input
     if ($this->hasModel()) {
         $input = Html::activeDropDownList($this->model, $this->attribute . '[status]', $this->items, $this->options);
     }
     $input .= Html::beginTag('div', ['id' => 'status_payment', 'style' => 'margin-top: 20px;']);
     foreach ($this->columns as $status => $item) {
         $input .= Html::beginTag('div', ['class' => 'status_payment', 'id' => 'status_payment_' . $status, 'style' => 'display: none']);
         foreach ($item as $name => $info) {
             $placeholder = isset($info['placeholder']) ? $info['placeholder'] : null;
             $value = isset($info['value']) ? $info['value'] : null;
             $input .= Html::activeInput('text', $this->model, $this->attribute . '[infomation][' . $name . ']', ['placeholder' => $placeholder, 'class' => $this->options['columnClass'], 'readonly' => '', 'value' => $value, 'style' => 'margin-top: 20px;']);
         }
         $input .= Html::endTag('div');
     }
     $input .= Html::endTag('div');
     return $input;
 }
Пример #9
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!isset($this->options['id'])) {
         $this->options['id'] = $this->getId();
     }
     if ($this->requiresDjax()) {
         ob_start();
         ob_implicit_flush(false);
         $view = $this->getView();
         $view->clear();
         $view->beginPage();
         $view->head();
         $view->beginBody();
         if ($view->title !== null) {
             echo Html::tag('title', Html::encode($view->title));
         }
     } else {
         echo Html::beginTag('div', $this->options);
     }
 }
Пример #10
0
 public function run()
 {
     $formId = $this->formOptions['id'];
     $this->getView()->registerCss("#{$formId} button {-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2);}");
     $form = ActiveForm::begin(array_merge($this->defaultFormOptions, $this->formOptions));
     print Html::beginTag('div', ['class' => 'row']);
     print Html::beginTag('div', ['class' => 'col-xs-12']);
     print Html::beginTag('div', ['class' => 'input-group']);
     if ($this->inputWidget) {
         print $form->field($this->model, $this->attribute, ['template' => '{input}'])->widget($this->inputWidget, $this->inputOptions);
     } else {
         print $form->field($this->model, $this->attribute, ['template' => '{input}'])->input($this->inputType, array_merge(['placeholder' => $this->model->getAttributeLabel($this->attribute), 'class' => 'form-control'], $this->inputOptions));
     }
     print Html::beginTag('span', ['class' => 'input-group-btn']);
     print Html::submitButton(Yii::t('hipanel', 'Search'), ['class' => 'btn btn-flat ' . $this->buttonColor]);
     print Html::endTag('span');
     print Html::endTag('div');
     print Html::endTag('div');
     print Html::endTag('div');
     ActiveForm::end();
 }
Пример #11
0
 /**
  * @param $item
  * @return string
  */
 public static function settingField($key, $item, $traslateCategory)
 {
     $return = '';
     switch ($item['type']) {
         case 'checkbox':
             $return = parent::beginTag('div', ['class' => 'form-group']) . parent::beginTag('label', ['class' => 'col-md-3 control-label']) . \Yii::t($traslateCategory, $key) . parent::endTag('label') . parent::beginTag('div', ['class' => 'col-md-9']) . parent::hiddenInput('Settings[' . $key . ']', 0) . \oakcms\bootstrapswitch\Switcher::widget(['id' => 'wid' . uniqid(), 'name' => 'Settings[' . $key . ']', 'checked' => $item['value']]) . parent::endTag('div') . parent::endTag('div');
             break;
         case 'textInput':
             $return = parent::beginTag('div', ['class' => 'form-group']) . parent::beginTag('label', ['class' => 'col-md-3 control-label']) . \Yii::t($traslateCategory, $key) . parent::endTag('label') . parent::beginTag('div', ['class' => 'col-md-9']) . parent::textInput('Settings[' . $key . ']', $item['value'], ['class' => 'form-control']) . parent::endTag('div') . parent::endTag('div');
             break;
         case 'textarea':
             $return = parent::beginTag('div', ['class' => 'form-group']) . parent::beginTag('label', ['class' => 'col-md-3 control-label']) . \Yii::t($traslateCategory, $key) . parent::endTag('label') . parent::beginTag('div', ['class' => 'col-md-9']) . parent::textarea('Settings[' . $key . ']', $item['value'], ['class' => 'form-control']) . parent::endTag('div') . parent::endTag('div');
             break;
         case 'mediaInput':
             $return = parent::beginTag('div', ['class' => 'form-group']) . parent::beginTag('label', ['class' => 'col-md-3 control-label']) . \Yii::t($traslateCategory, $key) . parent::endTag('label') . parent::beginTag('div', ['class' => 'col-md-9']) . InputFile::widget(['id' => 'wid' . uniqid(), 'language' => \Yii::$app->language, 'filter' => 'image', 'name' => 'Settings[' . $key . ']', 'value' => $item['value']]) . parent::endTag('div') . parent::endTag('div');
             break;
         default:
             $return = '';
             break;
     }
     return $return;
 }
Пример #12
0
 /**
  * Ham generate template widget khi move vao postion.
  * @param string $containerId id cua container
  * @param string $positionId id cua position
  * @param string $widgetId id cua widget trong mang data cua diy
  * @param string $id id cua widget
  * @param array $settings Mang gia tri cua cac option
  * @return string
  */
 public static function generateTemplateSetting($containerId, $positionId, $widgetId, $id, $settings)
 {
     // Get widget info by id
     $model = self::find()->where(['_id' => $id])->one();
     $templateSetting = null;
     if ($model) {
         // Template widget
         $templateSetting .= Html::beginTag('div', ['class' => 'let_widget row', 'data-id' => $id, 'id' => $widgetId]);
         $templateSetting .= Html::beginTag('div', ['class' => 'btn btn-info']);
         $templateSetting .= $model->title;
         $templateSetting .= Html::endTag('div');
         // Begin button widget
         $templateSetting .= Html::beginTag('div', ['class' => 'pull-right']);
         $templateSetting .= Html::beginTag('div', ['class' => 'btn-group buttonDeleteWidget']);
         $templateSetting .= Html::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'button', 'class' => 'btn btn-danger btn-xs', 'onclick' => 'deleteItems(this, "w", ".let_widget");']);
         $templateSetting .= Html::button('<i class="glyphicon glyphicon-plus"></i>', ['type' => 'button', 'class' => 'btn btn-success btn-xs', 'onclick' => 'accordionWidget("' . $widgetId . '");']);
         $templateSetting .= Html::endTag('div');
         $templateSetting .= Html::endTag('div');
         // End button widget
         $templateSetting .= Html::beginTag('div', ['class' => 'row setting_widget', 'id' => 'setting_widget_' . $widgetId, 'style' => 'margin-top: 20px; display: none;', 'data-show' => 0, 'data-container' => $containerId, 'data-position' => $positionId, 'data-id' => $widgetId]);
         // Begin template setting.
         $templateSetting .= Html::beginForm(NULL, 'POST', ['role' => 'form', 'id' => 'settingForm']);
         if (!empty($model->setting)) {
             foreach ($model->setting as $keySetting => $config) {
                 // Kieu hien thi cua setting
                 $type = ArrayHelper::getValue($config, 'type');
                 // Gia tri cua setting
                 $value = ArrayHelper::getValue($settings, $keySetting);
                 // Danh sach cac gia tri cua setting neu la dropdown, checkbox, radio
                 $items = ArrayHelper::getValue($config, 'items');
                 $templateSetting .= Html::beginTag('div', ['class' => 'form-group field-setting-key']);
                 $templateSetting .= Html::beginTag('label', ['class' => 'control-label col-sm-2', 'for' => 'DiyWidget-' . $keySetting . '']);
                 $templateSetting .= $keySetting;
                 $templateSetting .= Html::endTag('label');
                 $templateSetting .= Html::beginTag('div', ['class' => 'col-sm-10']);
                 $templateSetting .= self::getInputByType($type, $templateSetting, $keySetting, $value, $items);
                 $templateSetting .= Html::beginTag('div', ['class' => 'help-block help-block-error help-block m-b-none']) . Html::endTag('div');
                 $templateSetting .= Html::endTag('div');
                 // End .col-sm-10
                 $templateSetting .= Html::endTag('div');
                 // End .field-setting-key
             }
         }
         // Begin button save
         $templateSetting .= Html::beginTag('div', ['class' => 'col-sm-12']);
         $templateSetting .= Html::beginTag('div', ['class' => 'pull-right']);
         $templateSetting .= Html::button(Yii::t('diy', 'Save'), ['type' => 'button', 'class' => 'btn btn-success', 'onclick' => 'saveSettingsWidget(this);']);
         $templateSetting .= Html::endTag('div');
         $templateSetting .= Html::endTag('div');
         // End button save
         $templateSetting .= Html::endForm();
         // End template setting
         $templateSetting .= Html::endTag('div');
         // End .row
         $templateSetting .= Html::endTag('div');
         // End .let_widget
     }
     return $templateSetting;
 }
Пример #13
0
 /**
  * Ham get ra template cua position
  * @param int $numberColumn so cot cua position
  * @param string $diyId id cua diy
  * @param string $containerId id cua container
  * @param string $itemId id cua position
  * @param array $widgetItems mang cac widget cua position
  * @return string
  */
 public static function generateTemplatePosition($numberColumn = 12, $diyId = null, $containerId, $itemId = null, $widgetItems = [])
 {
     $tempalatePosition = Html::beginTag('div', ['class' => 'let_position col-md-' . $numberColumn . ' col-sm-' . $numberColumn . ' col-xs-12', 'id' => $itemId, 'data-diyId' => $diyId, 'data-id' => $itemId]);
     // Begin button delete position
     $tempalatePosition .= Html::beginTag('div', ['class' => 'row positionButton', 'style' => 'margin: 10px 0 10px 0;']);
     $tempalatePosition .= Html::beginTag('div', ['class' => 'pull-right']);
     $tempalatePosition .= Html::beginTag('div', ['class' => 'btn-group buttonDelete']);
     $tempalatePosition .= Html::button('<i class="glyphicon glyphicon-trash"></i>', ['class' => 'btn btn-danger btn-xs', 'onclick' => 'deleteItems(this, "p", ".let_position");']);
     $tempalatePosition .= Html::endTag('div');
     $tempalatePosition .= Html::endTag('div');
     $tempalatePosition .= Html::endTag('div');
     // End button delete position
     $tempalatePosition .= Html::beginTag('div', ['class' => 'let_widget_position']);
     if (!empty($widgetItems)) {
         foreach ($widgetItems as $widgetId => $widget) {
             $id = ArrayHelper::getValue($widget, 'id');
             $settings = ArrayHelper::getValue($widget, 'settings', []);
             $tempalatePosition .= DiyWidget::generateTemplateSetting($containerId, $itemId, $widgetId, $id, $settings);
         }
     }
     $tempalatePosition .= Html::endTag('div');
     $tempalatePosition .= Html::endTag('div');
     return $tempalatePosition;
 }
Пример #14
0
<?php

use yii\bootstrap\Html;
if ($link == true) {
    echo Html::beginTag('a', $linkOptions);
}
echo Html::beginTag('div', $acronymHtmlOptions);
echo $acronym;
echo Html::endTag('div');
echo Html::img($space->getProfileImage()->getUrl(), $imageHtmlOptions);
if ($link == true) {
    echo Html::endTag('a');
}
Пример #15
0
        echo Html::beginTag('div', ['class' => 'col-sm-10']);
        if ($model->type === 'text') {
            echo Html::textInput('setting[' . (string) $model->_id . ']', $model->value, ['class' => 'form-control']);
        } else {
            if ($model->type === 'dropdown') {
                echo Html::dropDownList('setting[' . (string) $model->_id . ']', $model->value, $model->items, ['class' => 'form-control']);
            } else {
                if ($model->type === 'checkbox') {
                    echo Html::checkboxList('setting[' . (string) $model->_id . ']', $model->value, $model->items, ['class' => 'i-checks', 'separator' => '<br />']);
                } else {
                    if ($model->type === 'radio') {
                        echo Html::radioList('setting[' . (string) $model->_id . ']', $model->value, $model->items, ['class' => 'i-checks', 'separator' => '<br />']);
                    }
                }
            }
        }
        echo Html::endTag('div');
        echo Html::endTag('div');
        echo Html::beginTag('div', ['class' => 'hr-line-dashed']);
        echo Html::endTag('div');
    }
    ActiveForm::end();
    ?>
                </div>
            </div>
        </div>
    </div>
    <?php 
}
?>
</div>
Пример #16
0
 /**
  * Renders the main content, which includes all external services links.
  */
 protected function renderMainContent()
 {
     $clients = $this->getClients();
     $clientCount = count($clients);
     if ($clientCount == 0) {
         return;
     }
     $this->view->registerCssFile('@web/resources/user/authChoice.css');
     $this->view->registerJsFile('@web/resources/user/authChoice.js');
     echo Html::beginTag('div', ['class' => 'authChoice']);
     $i = 0;
     $extraCssClass = 'btn-sxm';
     foreach ($clients as $client) {
         $i++;
         if ($i == $this->maxShowClients + 1) {
             // Add more button
             echo Html::a('<i class="fa fa-angle-double-down" aria-hidden="true"></i>', '#', ['class' => 'btn btn-default pull-right btn-sxm', 'id' => 'btnAuthChoiceMore']);
             // Div contains more auth clients
             echo Html::beginTag('div', ['class' => 'authChoiceMore']);
             $extraCssClass = 'btn-sm';
             // further buttons small
         }
         $this->clientLink($client, null, ['class' => $extraCssClass]);
         echo "&nbsp;";
     }
     if ($i > $this->maxShowClients) {
         echo Html::endTag('div');
     }
     echo Html::endTag('div');
     echo Html::tag('div', Html::tag('hr') . Html::tag('div', Yii::t('UserModule.base', 'or')), ['class' => 'or-container']);
 }
Пример #17
0
<?php

use yii\bootstrap\Modal;
use yii\helpers\ArrayHelper;
use yii\bootstrap\Html;
// Display button add image and modal add image
Modal::begin(['header' => Yii::t('yii', 'Add Image'), 'footer' => '<button class="btn btn-success" id="insert_image" data-type="' . \sya\gallery\Gallery::TYPE_UPLOAD . '">' . Yii::t('yii', 'Insert Image') . '</button>', 'toggleButton' => ['label' => Yii::t('yii', 'Add Image'), 'class' => 'btn btn-success'], 'size' => 'modal-lg custom_modal_gallery', 'options' => ['id' => 'sya_gallery']]);
echo Html::beginTag('div', ['class' => 'tabs-container']);
echo Html::beginTag('div', ['class' => 'tabs-left']);
echo yii\bootstrap\Tabs::widget(['navType' => 'nav-tabs', 'encodeLabels' => false, 'items' => [['label' => Yii::t('yii', 'Insert Media'), 'content' => '<div class="panel-body"><div id="my-awesome-dropzone" class="dropzone sya_custom_dropzone">
                        <div class="dropzone-previews"></div>
                    </div></div>', 'linkOptions' => ['data-type' => \sya\gallery\Gallery::TYPE_UPLOAD]], ['label' => Yii::t('gallery', 'Insert from URL'), 'content' => '<div class="panel-body">
                        <input type="url" id="image" class="form-control"/>
                        <div id="embed_url_settings" class="row">

                        </div>
                    </div>', 'linkOptions' => ['data-type' => \sya\gallery\Gallery::TYPE_URL]]]]);
echo Html::endTag('div');
echo Html::endTag('div');
Modal::end();
// End Display button add image and modal add image
?>
<!-- Begin Display image gallery -->
<table class="table table-bordered table-stripped" style="margin-top: 30px;">
    <!-- Begin header table -->
    <thead>
        <tr>
            <th>
                Image preview
            </th>
            <th>
Пример #18
0
 /**
  * Ham lay ra hinh anh trong website theo duong dan
  * @param string $path duong dan chua anh
  * @param string $template hinh anh duoc lay ra tu thu muc upload
  * @return string
  */
 private function getGalleryByPath($path, $template = '')
 {
     // Duong dan chua anh
     $rootPath = Yii::getAlias(Yii::$app->getModule('gallery')->syaDirPath);
     // Thu muc upload
     $dirPath = Yii::$app->getModule('gallery')->syaDirUpload;
     if (!file_exists($path)) {
         return null;
     }
     $entrys = scandir($path);
     foreach ($entrys as $entry) {
         if (in_array($entry, ['.', '..', 'cache'])) {
             continue;
         }
         $entryPath = $path . DIRECTORY_SEPARATOR . $entry;
         if (is_dir($entryPath)) {
             $template .= self::getGalleryByPath($entryPath, $template);
         } else {
             if (in_array(end(explode('.', $entry)), self::$fileType)) {
                 $imgPath = str_replace($rootPath . $dirPath . DIRECTORY_SEPARATOR, '', $entryPath);
                 $template .= Html::beginTag('div', ['class' => 'col-md-3 text-center']);
                 // input chua cac image duoc chon
                 $template .= Html::hiddenInput('let_galleries', '', ['id' => 'let_galleries', 'class' => 'col-md-3 text-center input_image', 'data-type' => 'path']);
                 // View image
                 $template .= Html::beginTag('div', ['class' => 'letImgPreview', 'id' => $imgPath, 'onclick' => 'insertImagePath(this);']);
                 $template .= Html::img('@web/' . $dirPath . DIRECTORY_SEPARATOR . $imgPath, ['style' => 'max-width: 100%; height: 200px;']);
                 $template .= Html::endTag('div');
                 $template .= Html::endTag('div');
             }
         }
     }
     return $template;
 }
Пример #19
0
<?php

/** @var $zone string */
use app\models\Category;
use yii\bootstrap\Html;
$language = Yii::$app->language;
/** @var Category[] $list */
$list = Category::getChildren();
if (!empty($list)) {
    echo Html::beginTag('div', ['class' => 'departments']);
    echo Html::beginTag('ul');
    foreach ($list as $cat) {
        echo Html::beginTag('li');
        echo Html::a($cat->getName($language), $cat->getUrl());
        $children = Category::getChildren($cat->id);
        if (!empty($children)) {
            echo Html::beginTag('ul');
            foreach ($children as $subcat) {
                echo Html::beginTag('li');
                echo Html::a($subcat->getName($language), $subcat->getUrl());
                echo Html::endTag('li');
            }
            echo Html::endTag('ul');
        }
        echo Html::endTag('li');
    }
    echo Html::endTag('ul');
    echo Html::endTag('div');
}
Пример #20
0
                <?php 
echo Html::a('Добавить элемент', ['', 'action' => 'add'], ['class' => 'btn btn-sm btn-default btn-flat']);
?>

                <div class="box-tools pull-right">
                    <div class="has-feedback">
                        <input type="text" class="form-control input-sm" placeholder="Поиск...">
                        <span class="glyphicon glyphicon-search form-control-feedback"></span>
                    </div>
                </div>
            </div><!-- /.box-header -->

            <div class="box-body">
                <?php 
if ($properties) {
    echo Html::beginTag('table', ['class' => 'table']);
    /** @var $realty_property \common\models\realty\RealtyProperties */
    foreach ($properties as $realty_property) {
        echo '<tr>' . '<td><strong>' . $realty_property->name . '</strong><br><small clas="text-muted">' . $realty_property->realtyPropertyType->name . ' &mdash; ' . $realty_property->realtyPropertyType->comment . '</small></td>' . '<td>' . Html::a('<i class="fa fa-pencil-square-o"></i>', ['index', 'action' => 'ch', 'id' => $realty_property->id], ['class' => 'btn btn-default btn-xs btn-falt']) . '</td>' . '</tr>';
    }
    echo Html::endTag('table');
}
?>
            </div><!-- /.box-body -->
        </div><!-- /.box -->

    </div>

    <?php 
if (Yii::$app->request->get('action')) {
    ?>
Пример #21
0
 /**
  * Function generate log order
  * @return string
  */
 public function generateLogOrder()
 {
     $template = null;
     if (is_array($this->log) and !empty($this->log)) {
         foreach ($this->log as $log) {
             // Declare infomation log
             $created_at = ArrayHelper::getValue($log, 'created_at');
             $action = ArrayHelper::getValue($log, 'action');
             $note = ArrayHelper::getValue($log, 'note');
             $creator = ArrayHelper::getValue($log, 'creator');
             $logCreator = ArrayHelper::getValue($log, 'creator_name');
             // Get namespace of model
             $ecommerce = Ecommerce::module();
             // User field
             $linkUser = ArrayHelper::getValue($ecommerce->userTable, 'linkInfo');
             $idUser = ArrayHelper::getValue($ecommerce->userTable, 'idField');
             $template .= Html::beginTag('div', ['class' => 'timeline-item']);
             $template .= Html::beginTag('div', ['class' => 'row']);
             $template .= Html::beginTag('div', ['class' => 'col-xs-3 date']);
             $template .= Html::tag('i', '', ['class' => 'fa ' . ArrayHelper::getValue(\sya\ecommerce\Module::$logStatus, $action)]);
             $template .= date('H:i a', $created_at->sec);
             $template .= Html::tag('br');
             $template .= Html::tag('small', Yii::$app->formatter->asRelativeTime($created_at->sec), ['class' => 'text-navy']);
             $template .= Html::endTag('div');
             $template .= Html::beginTag('div', ['class' => 'col-xs-7 content no-top-border']);
             $template .= Html::tag('p', Html::tag('strong', ucfirst($action)), ['class' => 'm-b-xs']);
             $template .= Html::tag('p', Html::a($logCreator, Url::to([$linkUser, $idUser => $creator])) . ' ' . $note);
             $template .= Html::endTag('div');
             $template .= Html::endTag('div');
             $template .= Html::endTag('div');
         }
     }
     return $template;
 }
Пример #22
0
    echo Html::a($action, ['', 'action' => 'add', 'realty_groups_id' => $realty_groups[0]->id], ['class' => 'btn btn-sm btn-default btn-flat']);
}
?>

                <div class="box-tools pull-right">
                    <div class="has-feedback">
                        <input type="text" class="form-control input-sm" placeholder="Поиск...">
                        <span class="glyphicon glyphicon-search form-control-feedback"></span>
                    </div>
                </div>
            </div><!-- /.box-header -->

            <div class="box-body">
                <?php 
if ($realty_goods) {
    echo Html::beginTag('table', ['class' => 'table table-condensed']);
    /** @var $realty_property \common\models\realty\RealtyProperties */
    foreach ($realty_goods as $good) {
        $image = $good->gallery_groups_id ? Html::img($good->galleryGroup->galleryImage->small, ['width' => 64, 'class' => 'img-rounded']) : '';
        echo '<tr>' . '<td>' . $image . '</td>' . '<td>' . $good->realtyGroup->name . '<br><small class="text-muted">Цена: ' . $good->price . '</small></td>' . '<td>' . Html::a('<i class="fa fa-pencil-square-o"></i>', ['', 'action' => 'ch', 'realty_groups_id' => $good->realty_groups_id, 'id' => $good->id]) . '</td>' . '</tr>';
    }
    echo Html::endTag('table');
}
?>
            </div><!-- /.box-body -->
        </div><!-- /.box -->

    </div>

    <?php 
if (Yii::$app->request->get('action')) {
Пример #23
0
    ?>
">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <?php 
    echo Html::csrfMetaTags();
    ?>
        <title><?php 
    echo Html::encode($this->title);
    ?>
</title>
        <?php 
    $this->head();
    ?>
    </head>
    <?php 
    echo Html::beginTag('body', ['class' => implode(' ', array_filter(['hold-transition', Yii::$app->keyStorage->get('backend.theme-skin', 'skin-blue'), Yii::$app->keyStorage->get('backend.layout-fixed') ? 'fixed' : null, Yii::$app->keyStorage->get('backend.layout-boxed') ? 'layout-boxed' : null, Yii::$app->keyStorage->get('backend.layout-collapsed-sidebar') ? 'sidebar-collapse' : null, Yii::$app->keyStorage->get('backend.layout-mini-sidebar') ? 'sidebar-mini' : null]))]);
    ?>
    <?php 
    $this->beginBody();
    ?>
    <div class="wrapper">
        <?php 
    echo $this->render('_header.php');
    ?>

        <?php 
    echo $this->render('_left.php');
    ?>

        <?php 
    echo $this->render('_content.php', ['content' => $content]);
Пример #24
0
<?php

/** @var \backend\modules\rss\models\NewsFeedForm $model */
use yii\bootstrap\Html;
use yii\widgets\Pjax;
echo \Yii::$app->request->isAjax ? '' : Html::beginTag('div', ['class' => 'modal', 'id' => 'editFeedModal']);
?>
<div class="modal-dialog">
    <div class="modal-content">
        <?php 
Pjax::begin(['id' => 'add_modal', 'enablePushState' => false, 'enableReplaceState' => false, 'timeout' => 10000, 'clientOptions' => []]);
?>
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">×</span></button>
            <h4 class="modal-title"><?php 
echo $model->isNew ? 'Добавление' : 'Редактирование';
?>
 RSS ленты</h4>
        </div>
        <?php 
echo $this->render('editForm', ['model' => $model]);
Pjax::end();
?>
    </div>
</div>
<?php 
echo \Yii::$app->request->isAjax ? '' : Html::endTag('div');
Пример #25
0
 private static function labelInput($fieldName, $fld, $input)
 {
     $html = '';
     $html .= Html::beginTag('div', ['class' => 'form-group']);
     $html .= Html::label(Inflector::camel2words($fieldName), $fld, ['class' => 'col-lg-2 control-label']);
     $html .= Html::beginTag('div', ['class' => 'col-lg-10']);
     $html .= $input;
     $html .= Html::endTag('div');
     $html .= Html::endTag('div');
     return $html;
 }
Пример #26
0
    echo Html::a('Отмена', Url::current(['realty_property_values_id' => null]), ['class' => 'btn btn-default btn-flat btn-sm']);
}
?>

        <?php 
echo Html::submitButton(Yii::$app->request->get('realty_property_values_id') ? 'Изменить' : 'Добавить', ['class' => 'btn btn-primary btn-flat btn-sm']);
?>

        <?php 
if (Yii::$app->request->get('realty_property_values_id')) {
    Modal::begin(['header' => $property_value->name, 'toggleButton' => ['label' => 'Удалить', 'class' => 'btn btn-danger btn-flat btn-sm'], 'footer' => Html::a('Отмена', '#', ['data-dismiss' => 'modal', 'class' => 'btn btn-default btn-flat btn-sm']) . Html::a('Удалить', ['delete-property-value', 'id' => Yii::$app->request->get('id'), 'realty_property_values_id' => $property_value->id], ['class' => 'btn btn-danger btn-flat btn-sm'])]);
    echo '<p>Действительно удалить значение свойства?</p>';
    Modal::end();
}
?>
    </div>
</div>

<?php 
ActiveForm::end();
?>

<?php 
$property_values = RealtyPropertyValues::find()->all();
if ($property_values) {
    echo Html::beginTag('ul', ['class' => 'list-inline']);
    foreach (RealtyPropertyValues::find()->all() as $value) {
        echo '<li>' . Html::a($value->name, Url::current(['realty_property_values_id' => $value->id])) . '</li>';
    }
    echo Html::endTag('ul');
}
Пример #27
0
 /**
  * @param null $options
  * @param null $pluginOptions
  *
  * @return string
  * @throws \Exception
  */
 public function getItem($options = null, $pluginOptions = null)
 {
     switch ($this->type) {
         case self::TYPE_TEXT:
             return Html::input('text', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_EMAIL:
             return Html::input('email', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_NUMBER:
             return Html::input('number', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_TEXTAREA:
             return Html::textarea('Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_COLOR:
             return ColorInput::widget(['value' => $this->value, 'name' => 'Setting[' . $this->code . ']', 'options' => $options != null ? $options : ['class' => 'form-control']]);
         case self::TYPE_DATE:
             return DatePicker::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
         case self::TYPE_TIME:
             return TimePicker::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['minuteStep' => 1, 'showSeconds' => true, 'showMeridian' => false]]);
         case self::TYPE_DATETIME:
             return DateTimePicker::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => ['format' => 'yyyy-mm-dd H:i:s', 'todayHighlight' => true]]);
         case self::TYPE_PASSWORD:
             return PasswordInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['showMeter' => true, 'toggleMask' => false]]);
         case self::TYPE_ROXYMCE:
             return RoxyMceWidget::widget(['id' => 'Setting_' . $this->code, 'name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'action' => Url::to(['roxymce/default']), 'options' => $options != null ? $options : ['title' => $this->getName()], 'clientOptions' => $pluginOptions != null ? $pluginOptions : []]);
         case self::TYPE_SELECT:
             return Select2::widget(['value' => $this->value, 'name' => 'Setting[' . $this->code . ']', 'data' => $this->getStoreRange(), 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => ['allowClear' => true]]);
         case self::TYPE_MULTI_SELECT:
             $options['multiple'] = true;
             if (!isset($options['class'])) {
                 $options['class'] = 'form-control';
             }
             return Select2::widget(['name' => 'Setting[' . $this->code . ']', 'value' => explode(",", $this->value), 'data' => $this->getStoreRange(), 'options' => $options, 'pluginOptions' => ['allowClear' => true]]);
         case self::TYPE_FILE_PATH:
             $value = Yii::getAlias($this->store_dir) . DIRECTORY_SEPARATOR . $this->value;
             return FileInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $value, 'options' => $options != null ? $options : ['class' => 'form-control', 'multiple' => false], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['previewFileType' => 'any', 'showRemove' => false, 'showUpload' => false, 'initialPreview' => !$this->isNewRecord ? [$this->value] : []]]);
         case self::TYPE_FILE_URL:
             $value = $this->store_url . '/' . $this->value;
             return FileInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['previewFileType' => 'any', 'showRemove' => false, 'showUpload' => false, 'initialPreviewAsData' => true, 'initialPreviewFileType' => self::fileType(pathinfo($this->value, PATHINFO_EXTENSION)), 'initialPreview' => !$this->isNewRecord ? $value : [], 'initialCaption' => $this->value]]);
         case self::TYPE_PERCENT:
             return RangeInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'html5Options' => ['min' => 0, 'max' => 100, 'step' => 1], 'options' => $options != null ? $options : ['class' => 'form-control'], 'addon' => ['append' => ['content' => '%']]]);
         case self::TYPE_SWITCH:
             $selector = explode(',', $this->store_range);
             if (count($selector) != 2) {
                 throw new ErrorException(Yii::t('setting', 'Switch Field should have store with 2 value, and negative is first. Example: no,yes'), 500);
             }
             return Html::hiddenInput('Setting[' . $this->code . ']', $selector[0]) . SwitchInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $selector[1], 'containerOptions' => ['class' => 'nv-switch-container'], 'options' => $options != null ? $options : [], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['state' => $this->value == $selector[1], 'size' => 'small', 'offText' => ucfirst($selector[0]), 'onText' => ucfirst($selector[1])]]);
         case self::TYPE_CHECKBOX:
             $random = rand(1000, 9999);
             return Html::checkboxList('Setting[' . $this->code . ']', explode(",", $this->value), $this->getStoreRange(), $options != null ? $options : ['class' => 'nv-checkbox-list checkbox', 'item' => function ($index, $label, $name, $checked, $value) use($random) {
                 $html = Html::beginTag('div');
                 $html .= Html::checkbox($name, $checked, ['id' => 'Setting_checkbox_' . $label . '_' . $index . '_' . $random, 'value' => $value]);
                 $html .= Html::label($label, 'Setting_checkbox_' . $label . '_' . $index . '_' . $random);
                 $html .= Html::endTag('div');
                 return $html;
             }]);
         case self::TYPE_RADIO:
             $random = rand(1000, 9999);
             return Html::radioList('Setting[' . $this->code . ']', $this->value, $this->getStoreRange(), $options != null ? $options : ['class' => 'nv-checkbox-list radio', 'item' => function ($index, $label, $name, $checked, $value) use($random) {
                 $html = Html::beginTag('div');
                 $html .= Html::radio($name, $checked, ['id' => 'Setting_radio_' . $label . '_' . $index . '_' . $random, 'value' => $value]);
                 $html .= Html::label($label, 'Setting_radio_' . $label . '_' . $index . '_' . $random);
                 $html .= Html::endTag('div');
                 return $html;
             }]);
         case self::TYPE_SEPARATOR:
             return '<hr>';
         default:
             return Html::input('text', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
     }
 }
Пример #28
0
				</div>
				<div class="col-sm-1">
					<p><?php 
    echo $item['product_price'];
    ?>
</p>
				</div>
				<div class="col-sm-1">
					<p><?php 
    echo $item['price_sum'];
    ?>
</p>
				</div>
				<div class="col-sm-2">
					<?php 
    echo Html::beginTag('div', ['class' => 'form-group']);
    ?>
						<?php 
    echo Html::submitButton('Удалить', ['class' => 'btn btn-primary btn-sm', 'name' => 'delete']);
    ?>
						<?php 
    echo Html::tag('div', null, ['class' => 'help-block']);
    ?>
					<?php 
    echo Html::endTag('div');
    ?>
				</div>
			<?php 
    ActiveForm::end();
    ?>
		</div>
Пример #29
0
 /**
  * Function generate preview infomation image
  * @param $image Infomation image
  * @return string
  */
 public static function generatePreviewImage($image)
 {
     $image = Json::decode($image);
     $url = ArrayHelper::getValue($image, 'url');
     $title = ArrayHelper::getValue($image, 'title');
     $caption = ArrayHelper::getValue($image, 'caption');
     $alt_text = ArrayHelper::getValue($image, 'alt_text');
     $imageUrl = Yii::getAlias('@web') . DIRECTORY_SEPARATOR . Yii::$app->getModule('gallery')->syaDirUpload . DIRECTORY_SEPARATOR . $url;
     $imagePath = Yii::getAlias(Yii::$app->getModule('gallery')->syaDirPath) . Yii::$app->getModule('gallery')->syaDirUpload . DIRECTORY_SEPARATOR . $url;
     $info = FileHelper::getInfomation($imagePath);
     $basename = ArrayHelper::getValue($info, 'basename');
     $filesize = ArrayHelper::getValue($info, 'filesize');
     $fileatime = ArrayHelper::getValue($info, 'fileatime');
     $width = ArrayHelper::getValue($info, 'width');
     $height = ArrayHelper::getValue($info, 'height');
     $template = Html::tag('h3', Yii::t('gallery', 'ATTACHMENT DETAILS'), []);
     // Info img
     $template .= Html::beginTag('div', ['class' => 'sya_info_galllery row']);
     $template .= Html::beginTag('div', ['class' => 'col-md-6', 'style' => 'padding: 0;']);
     $template .= Html::img($imageUrl, []);
     $template .= Html::endTag('div');
     $template .= Html::beginTag('div', ['class' => 'col-md-6', 'style' => 'padding: 0; word-break: break-word;']);
     // File Name
     $template .= Html::beginTag('div', ['style' => 'font-weight: bold;']);
     $template .= $basename;
     $template .= Html::endTag('div');
     $template .= Html::beginTag('div', []);
     $template .= date('d/m/Y', $fileatime);
     $template .= Html::endTag('div');
     // File size
     $template .= Html::beginTag('div', []);
     $template .= $filesize;
     $template .= Html::endTag('div');
     $template .= Html::beginTag('div', []);
     $template .= $width . ' x ' . $height;
     $template .= Html::endTag('div');
     $template .= Html::endTag('div');
     $template .= Html::endTag('div');
     // Attribute img
     $template .= Html::beginTag('div', ['class' => 'col-md-12 form-horizontal', 'style' => 'margin-top: 20px;']);
     $template .= Html::beginForm(' ', ' ', ['id' => 'sya_gallery_form_preview']);
     // Url
     $template .= Html::beginTag('div', ['class' => 'form-group field-gallery-url']);
     $template .= Html::tag('label', 'Url', ['class' => 'control-label col-sm-3']);
     $template .= Html::beginTag('div', ['class' => 'col-sm-9']);
     $template .= Html::input('text', 'sya_url', $url, ['class' => 'col-sm-10 form-control', 'readonly' => true]);
     $template .= Html::endTag('div');
     $template .= Html::endTag('div');
     // Title
     $template .= Html::beginTag('div', ['class' => 'form-group field-gallery-title']);
     $template .= Html::tag('label', 'Title', ['class' => 'control-label col-sm-3']);
     $template .= Html::beginTag('div', ['class' => 'col-sm-9']);
     $template .= Html::input('text', 'sya_title', $title, ['class' => 'col-sm-10 form-control', 'id' => 'sya_preview_title']);
     $template .= Html::endTag('div');
     $template .= Html::endTag('div');
     // Caption
     $template .= Html::beginTag('div', ['class' => 'form-group field-gallery-caption']);
     $template .= Html::tag('label', 'Caption', ['class' => 'control-label col-sm-3']);
     $template .= Html::beginTag('div', ['class' => 'col-sm-9']);
     $template .= Html::textarea('sya_caption', $caption, ['class' => 'col-sm-10 form-control', 'id' => 'sya_preview_caption']);
     $template .= Html::endTag('div');
     $template .= Html::endTag('div');
     // Alt text
     $template .= Html::beginTag('div', ['class' => 'form-group field-gallery-alt-text']);
     $template .= Html::tag('label', 'Alt text', ['class' => 'control-label col-sm-3']);
     $template .= Html::beginTag('div', ['class' => 'col-sm-9']);
     $template .= Html::input('text', 'sya_alt_text', $alt_text, ['class' => 'col-sm-10 form-control', 'id' => 'sya_preview_alt_text']);
     $template .= Html::endTag('div');
     $template .= Html::endTag('div');
     $template .= Html::endForm();
     $template .= Html::endTag('div');
     return $template;
 }
Пример #30
0
    <?php 
    echo Html::endTag('h5');
}
?>

<?php 
if ($isFinished && !empty($winnersForecast->allModels)) {
    ?>
    <p><?php 
    echo $winnersForecastDetails;
    ?>
</p>
    <p><b>Общее количество дополнительных очков: <?php 
    echo $totalAdditionalPoints;
    ?>
</b></p>
<?php 
}
?>

<hr>
<?php 
echo Html::beginTag('h4', ['class' => 'text-center']);
?>
    Очки по турам
<?php 
echo Html::endTag('h4');
?>

<?php 
echo extendedGridView::widget(['dataProvider' => $forecast, 'showPageSummary' => true, 'summary' => false, 'condensed' => true, 'columns' => [['attribute' => 'tour', 'header' => 'Тур', 'headerOptions' => ['class' => 'text-center'], 'options' => ['class' => 'col-xs-6'], 'hAlign' => 'center', 'vAlign' => 'middle', 'pageSummary' => 'Всего'], ['attribute' => 'points', 'header' => 'Очки', 'headerOptions' => ['class' => 'text-center'], 'options' => ['class' => 'col-xs-6'], 'hAlign' => 'center', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryOptions' => ['align' => 'center']]]]);