/** * @inheritdoc */ public function run() { if ($this->fancySelector) { echo \newerton\fancybox\FancyBox::widget(['target' => $this->fancySelector, 'config' => array_merge(['href' => '#' . $this->getId(), 'autoDimensions' => false, 'autoSize' => false, 'width' => 560, 'type' => 'inline'], $this->fancyConfig)]); } $formOptions = array_merge(["action" => Url::toRoute($this->route), "enableClientValidation" => true, "enableAjaxValidation" => false, "validateOnSubmit" => true], $this->formOptions); return $this->render($this->tpl, ["id" => $this->getId(), "model" => $this->model, "formOptions" => $formOptions, "hidden" => !empty($this->fancySelector)]); }
public function run() { $images = GlImgs::find()->where(['groups_id' => $this->gl_groups_id])->orderBy('seq')->all(); if (!$images) { return false; } foreach ($images as $i => $image) { $items_small[] = Html::a(Html::img($image->img_small, ['class' => '']), $image->img_large, ['rel' => 'gl-linead-' . $this->gl_groups_id]); } echo Slick::widget(['items' => $items_small, 'containerOptions' => count($items_small) > 4 ? ['class' => 'gallery-line-ad'] : ['class' => 'lonely-item gallery-line-ad'], 'clientOptions' => ['slidesToShow' => 4, 'slidesToScroll' => 1], 'itemOptions' => ['class' => 'lineAdItem well well-sm']]); echo FancyBox::widget(['target' => 'a[rel=gl-linead-' . $this->gl_groups_id . ']', 'helpers' => true, 'mouse' => true, 'config' => ['maxWidth' => '90%', 'maxHeight' => '90%', 'playSpeed' => 4000, 'padding' => 0, 'fitToView' => false, 'width' => '70%', 'height' => '70%', 'autoSize' => false, 'closeClick' => false, 'openEffect' => 'elastic', 'closeEffect' => 'elastic', 'prevEffect' => 'elastic', 'nextEffect' => 'elastic', 'closeBtn' => false, 'openOpacity' => true, 'helpers' => ['title' => ['type' => 'float'], 'buttons' => [], 'thumbs' => ['width' => 68, 'height' => 50], 'overlay' => ['css' => ['background' => 'rgba(0, 0, 0, 0.8)']]]]]); $view = $this->view; GalleryAdAsset::register($view); }
public function run() { $images = GalleryImages::find()->where(['gallery_groups_id' => $this->gallery_groups_id])->orderBy('seq')->all(); if (!$images) { return false; } foreach ($images as $i => $image) { $items_large[] = Html::a(Html::img($image->large, ['class' => 'img-rounded']), $image->large, ['rel' => 'gl-fancybox']); $items_small[] = Html::img($image->small, ['class' => 'gl-slider-prev']); } echo Slick::widget(['itemContainer' => 'div', 'containerOptions' => ['class' => 'gl-slider-for'], 'items' => $items_large, 'clientOptions' => ['asNavFor' => '.gl-slider-nav', 'slidesToShow' => 1, 'slidesToScroll' => 1, 'arrows' => false, 'fade' => true]]); echo Slick::widget(['itemContainer' => 'div', 'containerOptions' => ['class' => 'gl-slider-nav' . (count($images) > 1 ? '' : ' hide')], 'items' => $items_small, 'clientOptions' => ['asNavFor' => '.gl-slider-for', 'slidesToShow' => count($images), 'slidesToScroll' => count($images), 'dots' => false, 'arrows' => false, 'autoplay' => false, 'focusOnSelect' => true]]); echo FancyBox::widget(['target' => 'a[rel=gl-fancybox]', 'helpers' => true, 'mouse' => true, 'config' => ['maxWidth' => '90%', 'maxHeight' => '90%', 'playSpeed' => 4000, 'padding' => 0, 'fitToView' => false, 'width' => '70%', 'height' => '70%', 'autoSize' => false, 'closeClick' => false, 'openEffect' => 'elastic', 'closeEffect' => 'elastic', 'prevEffect' => 'elastic', 'nextEffect' => 'elastic', 'closeBtn' => false, 'openOpacity' => true, 'helpers' => ['title' => ['type' => 'float'], 'buttons' => [], 'thumbs' => ['width' => 68, 'height' => 50], 'overlay' => ['css' => ['background' => 'rgba(0, 0, 0, 0.8)']]]]]); $view = $this->view; GalleryAdAsset::register($view); }
<?php use yii\helpers\Html; use newerton\fancybox\FancyBox; ?> <?php echo FancyBox::widget(['target' => 'a[rel=fancybox]', 'helpers' => true, 'mouse' => false, 'config' => ['maxWidth' => '90%', 'maxHeight' => '90%', 'playSpeed' => 7000, 'padding' => 0, 'fitToView' => false, 'width' => '70%', 'height' => '70%', 'autoSize' => false, 'closeClick' => false, 'openEffect' => 'elastic', 'closeEffect' => 'elastic', 'prevEffect' => 'elastic', 'nextEffect' => 'elastic', 'closeBtn' => false, 'openOpacity' => true, 'helpers' => ['title' => ['type' => 'float'], 'buttons' => [], 'thumbs' => ['width' => 68, 'height' => 50], 'overlay' => ['css' => ['background' => 'rgba(0, 0, 0, 0.8)']]]]]); ?> <div class="gallery-photos-list"> <?php if (count($photos) > 0) { ?> <ul class="list-inline"> <?php foreach ($photos as $photo) { ?> <li> <p> <?php echo Html::a(Html::img($photo->getThumbUrl('small')), $photo->url, ['rel' => 'fancybox']); ?> </p> <p class="text-center"> <?php echo Html::button('<i class="glyphicon glyphicon-trash"></i> Удалить', ['class' => 'btn btn-danger btn-xs gallery-photo-delete', 'data-url' => yii\helpers\Url::toRoute(['gallery-photo/delete', 'id' => $photo->id])]); ?>
</div> <p> <?php echo Html::a('Create Books Model', ['create'], ['class' => 'btn btn-success']); ?> <?php echo Html::a('search', null, ['class' => 'btn btn-info search']); ?> </p> <h2>List</h2> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', ['attribute' => 'name', 'label' => 'book name', 'format' => 'raw', 'value' => function ($model) { return $model->name; }], ['attribute' => 'preview', 'label' => 'preview', 'format' => 'raw', 'value' => function ($model) { echo FancyBox::widget(['target' => 'a[id="fancy_' . $model->id . '"]', 'helpers' => true]); return Html::a(Html::img('/image/' . $model->preview, ['width' => '100px', 'height' => 'auto']), '/image/' . $model->preview, ['id' => 'fancy_' . $model->id]); }], ['attribute' => 'author', 'label' => 'author', 'format' => 'raw', 'value' => function ($model) { /** @var AuthorModel $author */ $author = $model->author; return $author->lastname . ' ' . $author->firstname; }], ['attribute' => 'date', 'label' => 'date release', 'format' => 'raw', 'value' => function ($model) { return \Yii::$app->formatter->asDate($model->date, 'long'); }], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update}{prev}{delete}', 'buttons' => ['update' => function ($url, $model) { return Html::a('edit', null, ['class' => 'edit-btn', 'data-target' => '/books/ajax-update?id=' . $model->id]); // return Html::a('edit', $url); }, 'prev' => function ($url, $model) { return Html::a(' | prev', $url); }, 'delete' => function ($url, $model) { return Html::a(' | delete', $url); }]]]]);
<?php use newerton\fancybox\FancyBox; use yii\helpers\Url; use yii\helpers\Html; ?> <div class="relations-constructor"> <input type="hidden" name="send_relations" value="yes" /> <div class="pistol88-relations"> </div> <div class="row pistol88-new-relation"> <div class="col-md-12 col-lg-12"> <div class="form-group"> <a href="<?php echo Url::toRoute(["/relations/default/list", 'model' => $model->getRelatedModel()]); ?> " class="pistol88-related-choise btn btn-success">Выбрать... <span class="glyphicon glyphicon-plus add-option"></span></a> </div> </div> </div> </div> <?php echo FancyBox::widget(['target' => '.pistol88-related-choise', 'helpers' => false, 'mouse' => true, 'config' => ['maxWidth' => '500px', 'type' => 'iframe', 'maxHeight' => '500px', 'playSpeed' => 7000, 'padding' => 0, 'fitToView' => false, 'width' => '500px', 'autoSize' => true, 'openEffect' => 'elastic', 'closeEffect' => 'elastic', 'openOpacity' => true]]);
Modal::begin(['id' => 'modal', 'size' => 'modal-lg']); echo '<div id="modalForm"></div>'; Modal::end(); ?> <div class="book-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_search', ['model' => $searchModel]); ?> <br> <?php echo FancyBox::widget(['target' => 'a[rel=fancybox]', 'mouse' => true, 'config' => ['maxWidth' => '90%', 'maxHeight' => '90%', 'playSpeed' => 7000, 'padding' => 0, 'fitToView' => false, 'width' => '70%', 'height' => '70%', 'autoSize' => false, 'closeClick' => false, 'openEffect' => 'elastic', 'closeEffect' => 'elastic', 'prevEffect' => 'elastic', 'nextEffect' => 'elastic', 'closeBtn' => false, 'openOpacity' => true]]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', ['format' => 'raw', 'value' => function ($model) { if (!empty($model->preview)) { return Html::a(Html::img($model->preview, ['width' => '100']), $model->preview, ['rel' => 'fancybox']); } }], ['format' => 'raw', 'label' => 'Автор', 'value' => function ($model) { return $model->getAuthorfullname(); }], 'date', ['class' => \yii\grid\ActionColumn::className(), 'buttons' => ['view' => function ($url, $model) { $customurl = Yii::$app->getUrlManager()->createUrl(['book/view', 'id' => $model['id']]); //$model->id для AR return Html::button('Просмотр', ['value' => Url::to($customurl), 'class' => 'btn btn-success']); }, 'update' => function ($url, $model) { $customurl = Yii::$app->getUrlManager()->createUrl(['book/update', 'id' => $model['id']]); //$model->id для AR
use yii\helpers\Url; use yii\widgets\ActiveForm; use app\models\AuthorModel; ?> <h1>Book List</h1> <?php echo Html::beginForm(); echo Html::beginTag('fieldset', array('style' => 'margin-bottom: 10px;')); echo Html::dropDownList('search[author]', $search['author'], AuthorModel::find()->select(['concat(firstName, " ", lastName)', 'id'])->indexBy('id')->column(), ['prompt' => 'Search by Author', 'style' => 'margin-right: 20px;']); echo Html::textInput('search[name]', $search['name'], array('placeholder' => 'Book Title')); echo Html::endTag('fieldset'); echo Html::beginTag('fieldset', array('style' => 'margin-bottom: 20px;')); echo 'Publishing date: '; echo \yii\jui\DatePicker::widget(['name' => 'search[dateFrom]', 'dateFormat' => "php:Y-m-d", 'value' => $search['dateFrom'], 'clientOptions' => ['dateFormat' => 'yy-mm-dd', 'changeMonth' => true, 'changeYear' => true]]); echo ' to '; echo \yii\jui\DatePicker::widget(['name' => 'search[dateTo]', 'dateFormat' => "php:Y-m-d", 'value' => $search['dateTo'], 'clientOptions' => ['dateFormat' => 'yy-mm-dd', 'changeMonth' => true, 'changeYear' => true]]); echo Html::submitButton('Search'); echo Html::endTag('fieldset'); echo Html::endForm(); Pjax::begin(); echo \yii\grid\GridView::widget(['dataProvider' => $provider, 'columns' => ['id', 'name', ['format' => 'html', 'value' => function ($model, $key, $index, $column) { return Html::a(Html::img($model->preview, ['width' => '100px']), $model->preview, ['class' => 'js-preview-image']); }], 'author.fullName:text:Author', 'date:date', 'date_create:date', ['template' => '{update} {view} {delete}', 'class' => \yii\grid\ActionColumn::className(), 'buttonOptions' => ['data-pjax' => 1], 'buttons' => ['view' => function ($url, $model, $key) { $options = ['title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0']; return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, $options); }]]]]); Pjax::end(); \newerton\fancybox\FancyBox::widget(['id' => 'fb-view-details', 'target' => 'a[title="View"]', 'config' => ['type' => 'ajax']]); \newerton\fancybox\FancyBox::widget(['id' => 'fb-view-image', 'target' => 'a.js-preview-image', 'config' => ['type' => 'image']]);
<?php use newerton\fancybox\FancyBox; use yii\helpers\Url; ?> <div class="cart-pane"> <div class="cart-image"> <img src="<?php echo $asset->baseUrl; ?> /images/cart.png" border="0"/> </div> <div class="cart-summary" id="cart-summary-container"> <?php echo $this->render('pane_content'); ?> </div> <div class="cart-checkout-button"> <a href="<?php echo Url::toRoute(['/checkout/default/index']); ?> " class="fancy-cart"><span>оформить заказ</span></a> </div> </div> <?php echo FancyBox::widget(['target' => 'a.fancy-cart', 'config' => ['autoSize' => true, 'helpers' => ['overlay' => ['locked' => false]], 'arrows' => false, 'scrollOutside' => true, 'type' => 'ajax', 'ajax' => ['type' => 'POST']]]);
/** * @inheritdoc */ public function run() { $model = Yii::createObject(['class' => Message::className(), 'author_id' => $this->userId, 'recipient_id' => $this->contactId]); $options = ArrayHelper::merge($this->options, ['id' => $this->id, 'data' => ['pjax' => $this->pjaxId, 'fancy' => $this->fancySelector]]); $formOptions = ArrayHelper::merge(['id' => "{$this->id}-form", 'action' => Yii::$app->urlManager->createUrl($this->route), 'enableClientValidation' => true, 'enableAjaxValidation' => false, 'validateOnSubmit' => true], $this->formOptions); if ($this->fancySelector) { echo \newerton\fancybox\FancyBox::widget(['target' => $this->fancySelector, 'config' => array_merge(['href' => '#' . $this->id, 'autoDimensions' => false, 'autoSize' => false, 'width' => 500, 'height' => 200, 'type' => 'inline'], $this->fancyOptions)]); Html::addCssStyle($options, 'display:none'); } return $this->render($this->tpl, ['id' => $this->id, 'model' => $model, 'options' => $options, 'formOptions' => $formOptions]); }
<?php echo $this->render('_search', ['model' => $searchModel, 'authors' => $authors]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['attribute' => 'id', 'label' => 'ID'], ['attribute' => 'name', 'label' => 'Название'], ['label' => 'Превью', 'format' => 'raw', 'value' => function ($book) { $url = $book['preview']; $imgTag = Html::img($url, ['alt' => $book['name'], 'class' => 'img-preview']); return Html::a($imgTag, $url, ['target' => '_blank']); }], ['attribute' => 'author_fullname', 'label' => 'Автор'], ['attribute' => 'date', 'format' => 'date', 'label' => 'Дата выхода книги'], ['attribute' => 'date_create', 'format' => 'date', 'label' => 'Дата добавления'], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Кнопки действий', 'template' => '{update}<br>{view}<br>{delete}', 'buttons' => ['update' => function ($url) { return Html::a('<span class="glyphicon glyphicon-pencil"></span> Ред', $url, ['target' => '_blank']); }, 'view' => function ($url) { $url = $url . "&isAjax=1"; return Html::a('<span class="glyphicon glyphicon-eye-open"></span> Просм', $url, ['class' => 'modal-ajax fancybox.ajax', 'target' => '_blank']); }, 'delete' => function ($url) { return Html::a('<span class="glyphicon glyphicon-trash"></span> Удл', $url); }]]]]); ?> <p> <?php echo Html::a('Create Book', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo FancyBox::widget(['target' => 'a[href$=jpg], .modal-ajax']); ?> </div>
use yii\helpers\Html; use yii\grid\GridView; use yii\helpers\Url; use yii\widgets\Pjax; use yiidreamteam\upload\ImageUploadBehavior; /* @var $this yii\web\View */ /* @var $searchModel app\models\search\BookSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ /* @var $authors [] */ $this->title = 'Books'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="book-index"> <?php echo FancyBox::widget(['target' => 'a[rel=fancybox]', 'helpers' => true, 'mouse' => true, 'config' => ['transitionIn' => 'none', 'transitionOut' => 'none', 'titlePosition' => 'over']]); ?> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_search', ['model' => $searchModel, 'authors' => $authors]); ?> <p> <?php echo Html::a('Create Book', '#', ['class' => 'btn btn-success showModalButton', 'title' => 'Создание книги', 'value' => Url::to(['create'])]); ?> </p>