Example #1
0
<?php

$this->breadcrumbs = [Yii::t('StoreModule.store', 'Producers') => ['/store/producerBackend/index'], Yii::t('StoreModule.store', 'Manage')];
$this->pageTitle = Yii::t('StoreModule.store', 'Producers - manage');
$this->menu = [['icon' => 'fa fa-fw fa-list-alt', 'label' => Yii::t('StoreModule.store', 'Manage producers'), 'url' => ['/store/producerBackend/index']], ['icon' => 'fa fa-fw fa-plus-square', 'label' => Yii::t('StoreModule.store', 'Create producer'), 'url' => ['/store/producerBackend/create']]];
?>
<div class="page-header">
    <h1>
        <?php 
echo Yii::t('StoreModule.store', 'Producers');
?>
        <small><?php 
echo Yii::t('StoreModule.store', 'administration');
?>
</small>
    </h1>
</div>

<?php 
$this->widget('yupe\\widgets\\CustomGridView', ['id' => 'producer-grid', 'type' => 'condensed', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => [['name' => 'image', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::image(StoreImage::producer($data, 40, 40), $data->name, ["width" => 40, "height" => 40, "class" => "img-thumbnail"]);
}, 'filter' => false], ['name' => 'name', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->name, array("/store/producerBackend/update", "id" => $data->id));
}], ['name' => 'name_short', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->name_short, array("/store/producerBackend/update", "id" => $data->id));
}], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'slug', 'editable' => ['url' => $this->createUrl('/store/producerBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($model, 'slug', ['class' => 'form-control'])], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status', 'url' => $this->createUrl('/store/producerBackend/inline'), 'source' => $model->getStatusList(), 'options' => [Producer::STATUS_ACTIVE => ['class' => 'label-success'], Producer::STATUS_NOT_ACTIVE => ['class' => 'label-info'], Producer::STATUS_ZERO => ['class' => 'label-default']]], ['header' => Yii::t('StoreModule.store', 'Products'), 'value' => function ($data) {
    return CHtml::link($data->productCount, ['/store/productBackend/index', "Product[producer_id]" => $data->id], ['class' => 'badge']);
}, 'type' => 'raw'], ['class' => 'yupe\\widgets\\CustomButtonColumn']]]);
Example #2
0
            </div>
            <div class="best-brands__body">
                <div class="grid">
                    <?php 
    foreach ($brands as $brand) {
        ?>
                        <div class="best-brands__item grid-module-2">
                            <a href="<?php 
        echo Yii::app()->createUrl('/store/producer/view', ['slug' => $brand->slug]);
        ?>
" title="<?php 
        echo $brand->name;
        ?>
">
                                <img src="<?php 
        echo StoreImage::producer($brand, 100, 100);
        ?>
" class="best-brands__img" alt="<?php 
        echo $brand->name;
        ?>
">
                            </a>
                        </div>
                    <?php 
    }
    ?>
                </div>
            </div>
        </div>
    </div>
<?php 
Example #3
0
File: index.php Project: yupe/yupe
$this->breadcrumbs = [Yii::t('StoreModule.store', 'Producers') => ['/store/producerBackend/index'], Yii::t('StoreModule.store', 'Manage')];
$this->pageTitle = Yii::t('StoreModule.store', 'Producers - manage');
$this->menu = [['icon' => 'fa fa-fw fa-list-alt', 'label' => Yii::t('StoreModule.store', 'Manage producers'), 'url' => ['/store/producerBackend/index']], ['icon' => 'fa fa-fw fa-plus-square', 'label' => Yii::t('StoreModule.store', 'Create producer'), 'url' => ['/store/producerBackend/create']]];
?>
<div class="page-header">
    <h1>
        <?php 
echo Yii::t('StoreModule.store', 'Producers');
?>
        <small><?php 
echo Yii::t('StoreModule.store', 'administration');
?>
</small>
    </h1>
</div>

<?php 
$this->widget('yupe\\widgets\\CustomGridView', ['id' => 'producer-grid', 'sortableRows' => true, 'sortableAjaxSave' => true, 'sortableAttribute' => 'sort', 'sortableAction' => '/store/producerBackend/sortable', 'type' => 'condensed', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => [['name' => 'image', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::image(StoreImage::producer($data, 40, 40), $data->name, ['width' => 40, 'height' => 40, 'class' => 'img-thumbnail']);
}, 'filter' => false], ['name' => 'name', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->name, ['/store/producerBackend/update', 'id' => $data->id]);
}], ['name' => 'name_short', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->name_short, ['/store/producerBackend/update', 'id' => $data->id]);
}], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'slug', 'editable' => ['url' => $this->createUrl('/store/producerBackend/inline'), 'mode' => 'inline', 'params' => [Yii::app()->getRequest()->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($model, 'slug', ['class' => 'form-control'])], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status', 'url' => $this->createUrl('/store/producerBackend/inline'), 'source' => $model->getStatusList(), 'options' => [Producer::STATUS_ACTIVE => ['class' => 'label-success'], Producer::STATUS_NOT_ACTIVE => ['class' => 'label-info'], Producer::STATUS_ZERO => ['class' => 'label-default']]], ['header' => Yii::t('StoreModule.store', 'Products'), 'value' => function ($data) {
    return CHtml::link($data->productCount, ['/store/productBackend/index', 'Product[producer_id]' => $data->id], ['class' => 'badge']);
}, 'type' => 'raw'], ['class' => 'yupe\\widgets\\CustomButtonColumn', 'frontViewButtonUrl' => function ($data) {
    return Yii::app()->createUrl('/store/producer/view', ['slug' => $data->slug]);
}, 'buttons' => ['front_view' => ['visible' => function ($row, $data) {
    return $data->status == Producer::STATUS_ACTIVE;
}]]]]]);