Beispiel #1
0
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'id', 'filter' => false], ['attribute' => 'name', 'filter' => false], ['attribute' => 'image', 'format' => 'raw', 'value' => function ($data) {
    return Html::a(Html::img(Yii::getAlias('@web') . '/uploads/' . $data['preview'], ['width' => '70px']), Yii::getAlias('@web') . '/uploads/' . $data['preview'], ['rel' => 'fancybox']);
}], ['attribute' => 'author_id', 'format' => 'html', 'value' => function ($data) {
    return $data->getAuthorName();
}, 'filter' => false], ['attribute' => 'date_release', 'format' => 'html', 'value' => function ($data) {
    return \Yii::$app->formatter->asDate($data->date_create);
}, 'filter' => false], ['attribute' => 'date_create', 'format' => 'html', 'value' => function ($data) {
    return \Yii::$app->formatter->asDate($data->date_create);
}, 'filter' => false], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update} {delete}', 'headerOptions' => ['width' => '20%', 'class' => 'activity-view-link'], 'contentOptions' => ['class' => 'padding-left-5px'], 'buttons' => ['view' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', '#', ['class' => 'activity-view-link', 'title' => Yii::t('yii', 'View'), 'data-toggle' => 'modal', 'data-target' => '#activity-modal', 'data-id' => $key, 'data-pjax' => '0']);
}]]]]);
?>
 <?php 
echo newerton\fancybox\FancyBox::widget(['target' => 'a[rel=fancybox]', 'helpers' => true, '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, 'helpers' => ['title' => ['type' => 'float'], 'buttons' => [], 'thumbs' => ['width' => 68, 'height' => 50], 'overlay' => ['css' => ['background' => 'rgba(0, 0, 0, 0.8)']]]]]);
?>

<?php 
Modal::begin(['id' => 'activity-modal', 'header' => '<h4 class="modal-title">View Image</h4>', 'footer' => '<a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>']);
?>

<div class="well">
</div>

<?php 
Modal::end();
?>
</div>
Beispiel #2
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
$this->title = 'Books';
echo newerton\fancybox\FancyBox::widget(['target' => 'a[rel=fancybox]', 'config' => ['maxWidth' => '90%', 'maxHeight' => '90%', 'playSpeed' => 7000, 'width' => '70%', 'height' => '70%', 'autoSize' => false, 'closeClick' => true, 'openEffect' => 'elastic', 'closeEffect' => 'elastic', 'closeBtn' => true]]);
?>

<div class="books-index">

    <?php 
echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-striped table-bordered table-vcenter'], 'summary' => false, 'columns' => ['id', 'name', ['attribute' => 'preview', 'label' => 'Превью', 'format' => 'raw', 'value' => function ($data) {
    return Html::a(Html::img($data->preview, ['alt' => $data->name, 'style' => 'width:100px;']), $data->preview, ['rel' => 'fancybox']);
}], ['attribute' => 'author_id', 'label' => 'Автор', 'format' => 'text', 'content' => function ($data) {
    return $data->getAuthorFullName();
}], ['attribute' => 'date', 'value' => function ($data) {
    return Yii::$app->formatter->asDate($data->date);
}], ['attribute' => 'date_create', 'value' => function ($data) {
    return Yii::$app->formatter->asRelativeTime($data->date_create);
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '[{update}] [{view}] [{delete}]', 'header' => 'Кнопки действий', 'buttons' => ['update' => function ($url, $model) {
    return Html::a('редактирование', $url);
}, 'view' => function ($url, $model) {
    return yii\bootstrap\Modal::widget(['id' => 'view-modal' . $model->id, 'header' => $model->name, 'closeButton' => [], 'size' => yii\bootstrap\Modal::SIZE_LARGE, 'toggleButton' => ['label' => 'просмотр', 'tag' => 'a', 'href' => $url . '?ajax=1', 'data-target' => '#view-modal' . $model->id], 'clientOptions' => false]);
}, 'delete' => function ($url, $model) {
    return Html::a('удаление', $url);
}]]]]);
Beispiel #3
0
    $img[$i++] = Html::a(Html::img($image->getUrl('original')), $image->getUrl('original'), ['rel' => 'fancybox']);
}
if ($i == 0) {
    $img[$i++] = Html::a(Html::img('@web/uploads/images/noimage.png', ['style' => 'max-width: 100%; border: 0 none; vertical-align: top;']), '@web/uploads/images/noimage.png', ['rel' => 'fancybox']);
}
?>
<div class="about-view">
    <h3><?php 
echo Html::encode($this->title);
?>
</h3>
    <div class="about-img-div col-lg-3">
        <div class="img-box">
            
                <?php 
echo newerton\fancybox\FancyBox::widget(['target' => 'a[rel=fancybox]', 'helpers' => false, 'mouse' => true]);
?>
                <?php 
echo FlexSlider::widget(['items' => $img, 'pluginOptions' => ['animation' => 'slide', 'controlNav' => false, 'animationLoop' => true, 'slideshow' => true], 'options' => ['class' => 'flexslider']]);
?>
                
           
        </div>
    </div>
    <div class="about-info col-lg-7">        
        
        
        <?php 
echo $model->getAttribute('intro_' . Yii::$app->language);
?>
        <?php 
Beispiel #4
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $product app\Models\Product */
$this->title = $product->title;
$this->params['breadcrumbs'][] = ['label' => 'Products', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
echo newerton\fancybox\FancyBox::widget(['target' => 'a[rel=fancybox]', 'helpers' => true, '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, 'helpers' => ['title' => ['type' => 'float'], 'buttons' => [], 'thumbs' => ['width' => 68, 'height' => 50], 'overlay' => ['css' => ['background' => 'rgba(255, 255, 255, 0.8)']]], 'tpl' => ['error' => '<p class="fancybox-error">Данное фото не имеет увеличенного изображения.</p>']]]);
?>

<div class="product-view">

	<div class="left" style="width:35%; float:left;">
		<!-- Фото товара -->
		<div id="product_image">
			<?php 
echo Html::a(Html::img('/image/product/' . $product->provider_id . '/300x300/' . $product->image . '_0.jpg'), '/image/product/' . $product->provider_id . '/1000x1000/' . $product->image . '_0.jpg', ['rel' => 'fancybox']);
?>
		</div>
		
		<!-- Дополнительные фото товара -->
		<? if ($product->image_count>1): ?>

			<div class="images"><ul>

			<? $first = true;
			for($i=0; $i<=$product->image_count; $i++){
				if ($first){
					echo '<li class="select">';
Beispiel #5
0
            <h3 class="text-uppercase header-exs">Описание</h3>
            <br/>

            <div class="description">
                <?php 
echo $model->description;
?>
            </div>
        </div>
        <div class="col-md-5">
            <p class="phone"><b>Телефон:</b> <?php 
echo $model->phone;
?>
</p>
                <?php 
echo newerton\fancybox\FancyBox::widget(['target' => 'a[rel=fancybox' . $model->id . ']', 'helpers' => true, 'mouse' => true, 'config' => ['maxWidth' => '100%', 'maxHeight' => '100%', 'playSpeed' => 3000, 'padding' => 0, 'fitToView' => true, 'width' => '100%', 'height' => '100%', 'closeEffect' => 'elastic', 'prevEffect' => 'elastic', 'nextEffect' => 'elastic', 'closeBtn' => false, 'openOpacity' => true, 'helpers' => ['buttons' => [], 'overlay' => ['css' => ['background' => 'rgba(0, 0, 0, 0.8)']]]]]);
$images = $model->getImages();
echo Html::beginTag('div', ['class' => 'carousel']);
foreach ($images as $image) {
    echo Html::a(Html::img($image, ['class' => 'img-responsive']), $image, ['rel' => 'fancybox' . $model->id]);
}
echo Html::endTag('div');
?>

            <p class="text-right price"><?php 
echo number_format($model->price, 0, ' ', ' ');
?>
 руб.</p>
        </div>
    </div>
</div>
Beispiel #6
0
    $this->title = $model->name;
    $this->params['breadcrumbs'][] = ['label' => 'Books', 'url' => ['index']];
    $this->params['breadcrumbs'][] = $this->title;
}
?>

<div class="books-view">

    <?php 
if (!Yii::$app->request->isAjax) {
    ?>
        <p>
            <?php 
    echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
    ?>
            <?php 
    echo Html::a('Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
    ?>
        </p>

        <?php 
    echo newerton\fancybox\FancyBox::widget(['target' => 'a[rel=book-preview]', 'helpers' => false, 'mouse' => false, 'config' => ['closeBtn' => true, 'autoSize' => true, 'closeClick' => true]]);
    ?>
    <?php 
}
?>
   
    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'name', ['attribute' => 'date_create', 'format' => ['datetime', 'php:d.m.Y H:i']], ['attribute' => 'date_update', 'format' => ['datetime', 'php:d.m.Y H:i']], ['attribute' => 'preview', 'format' => 'raw', 'value' => is_null($model->preview) && $model->preview == '' ? 'Нет изображения' : '<a href="/images/books/' . $model->preview . '" rel="book-preview"><img src="/images/books/' . $model->preview . '" width="100" height="150" /></a>'], ['attribute' => 'date', 'format' => ['date', 'php:d.m.Y']], 'author.name']]);
?>
</div>
Beispiel #7
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\Modal;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\BooksSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Книги';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="books-index">
<?php 
echo newerton\fancybox\FancyBox::widget(['target' => 'a[class=fancybox]', 'helpers' => true, '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', 'closeBtn' => true, 'openOpacity' => true, 'scrollOutside' => false, 'helpers' => ['title' => ['type' => 'float'], 'overlay' => ['locked' => false, 'css' => ['background' => 'rgba(0, 0, 0, 0.8)']]]]]);
Modal::begin(['header' => $this->title, 'id' => 'modal', 'size' => 'modal-lg']);
Modal::end();
?>

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
echo $this->render('_search', ['model' => $searchModel]);
?>

    <div class="col-lg-12">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['attribute' => 'preview', 'format' => 'html', 'value' => function ($model) {
    return Html::a(Html::img('@web/img/books/small/' . $model->preview, ['height' => '100px', 'title' => $model->name, 'alt' => $model->name, 'class' => 'center']), '/img/books/big/' . $model->preview, ['class' => 'fancybox']);
}], 'fullname', ['attribute' => 'date', 'format' => 'cutedate', 'value' => function ($model) {
Beispiel #8
0
?>
"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php 
echo Html::encode($this->title);
?>
</title>
    <?php 
echo Html::csrfMetaTags();
?>
    <?php 
$this->head();
?>

    <?php 
echo newerton\fancybox\FancyBox::widget(['target' => '.yii-gallery a, .photogallery', 'helpers' => true, 'mouse' => true, 'config' => ['helpers' => ['title' => ['type' => 'float'], 'buttons' => [], 'thumbs' => ['width' => 68, 'height' => 50], 'overlay' => ['css' => ['background' => 'rgba(0, 0, 0, 0.8)']]]]]);
?>

</head>
<body>
<?php 
$this->beginBody();
?>

<div id="top">
    <div class="container">
        <h1><?php 
echo Yii::$app->name;
?>
</h1>
Beispiel #9
0
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('Create Books', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
/**
 * Каруселька для картинок книг
 */
echo newerton\fancybox\FancyBox::widget(['target' => 'a[rel=book_preview]', 'helpers' => true, 'mouse' => true, 'config' => ['maxWidth' => '90%', 'maxHeight' => '90%', 'playSpeed' => 7000, 'padding' => 0, 'fitToView' => false, 'width' => '70%', 'height' => '70%', 'autoSize' => false, 'closeClick' => false, 'closeBtn' => false, 'openOpacity' => true]]);
/**
 * Модалка для просмотра книг
 */
Modal::begin(['id' => 'view-book-modal', 'header' => '<h2>Просмотр</h2>']);
echo '<div class="content_holder"></div>';
Modal::end();
?>

    <?php 
echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['attribute' => 'preview_image', 'content' => function ($model, $key, $index, $column) {
    if ($model->preview_image) {
Beispiel #10
0
/* @var $this yii\web\View */
/* @var $model app\models\Gallery */
$this->title = $model->getAttribute('title_' . Yii::$app->language);
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Gallery'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="container">
    <div class="gallery-view">
        <div class="header">
            <h1><?php 
echo Html::encode($this->title);
?>
</h1>
            <?php 
echo $model->getAttribute('summary_' . Yii::$app->language);
?>
        </div>
        <?php 
echo newerton\fancybox\FancyBox::widget(['target' => 'a[class=fancybox]', 'helpers' => false, 'mouse' => true, 'config' => ['openEffect' => 'elastic', 'closeEffect' => 'elastic', 'prevEffect' => 'elastic', 'nextEffect' => 'elastic']]);
foreach ($model->getBehavior('galleryBehavior')->getImages() as $image) {
    ?>
            <div class="gallery-img">
                <?php 
    echo Html::a(Html::img($image->getUrl('original'), ['style' => 'width: 100%;']), $image->getUrl('original'), ['class' => 'fancybox', 'rel' => 'gallery']);
    ?>
            </div>
        <?php 
}
?>
    </div>
</div>