Ejemplo n.º 1
0
 public function run()
 {
     // render the container element
     echo Html::beginTag('div', $this->htmlOptions);
     if ($this->showCaption) {
         echo Html::beginTag('div', ArrayHelper::merge(['class' => $this->captionOptions['class']], $this->captionOptions));
         echo Html::endTag('div');
     }
     if ($this->renderChart) {
         $this->renderHighcharts();
     }
     $this->renderDataTablesGridView();
     if ($this->renderChart) {
         echo ButtonGroup::widget(ArrayHelper::merge(['class' => 'btn btn-white'], $this->buttonGroupOptions));
     }
     echo Html::endTag('div');
     StatReportAsset::register($this->view);
     if ($this->bootstrap) {
         DataTablesBootstrapAsset::register($this->view);
     }
     if ($this->responsive) {
         DataTablesResponsiveAsset::register($this->view);
         $this->dataTablesOptions = ArrayHelper::merge(['responsive' => true], $this->dataTablesOptions);
     }
     /*
     if($this->fixedHeader) {
         FixedHeaderAsset::register($this->view);
         $this->dataTablesOptions = ArrayHelper::merge(['fixedHeader' => true], $this->dataTablesOptions);
     }
     */
     $this->renderChartSeries();
     $this->renderJavaScript();
     parent::run();
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!empty($this->size)) {
         Html::addCssClass($this->options, 'btn-group-' . $this->size);
     }
 }
Ejemplo n.º 3
0
 public function run()
 {
     $header = Html::tag('span', 'План проспект');
     $btnGroup = ButtonGroup::widget(['buttons' => array_map(function ($year) {
         return ['label' => ArrayHelper::getValue($this->yearLabels, $year), 'tagName' => 'a', 'options' => ['href' => Url::current(['god' => $year]), 'class' => ['active' => $year === $this->getGod() ? 'active' : null]]];
     }, $this->years)]);
     return Html::tag('div', $header . $btnGroup);
 }
Ejemplo n.º 4
0
 protected function renderFilterCellContent()
 {
     $gridId = $this->grid->getId();
     $dropdownId = $gridId . '-dropdown2-filter-' . $this->attribute;
     $form = $this->grid->getForm();
     $filterModel = $this->grid->filterModel;
     $filterFields = $this->grid->filterFields;
     if ($form && $filterModel && array_key_exists($this->attribute, $filterFields)) {
         $cellContent = $form->field($filterModel, $this->attribute, $filterFields[$this->attribute]) . Html::tag('div', ButtonGroup::widget(['buttons' => [Html::button('<span class="glyphicon glyphicon-search"></span> ' . Yii::t('mozayka', 'Apply'), ['class' => 'btn btn-primary btn-sm', 'onclick' => 'jQuery(document).dropdown2(\'hide\'); jQuery(\'#' . $gridId . '\').yiiGridView(\'applyFilter\');']), Html::button('<span class="glyphicon glyphicon-ban-circle"></span> ' . Yii::t('mozayka', 'Reset'), ['class' => 'btn btn-default btn-sm', 'onclick' => 'jQuery(\'#' . $dropdownId . '\').find(\'input[type="text"], input[type="hidden"], textarea, select\').val(\'\');'])], 'options' => ['class' => 'pull-right']]), ['class' => 'clearfix']);
     } else {
         $cellContent = parent::renderFilterCellContent();
     }
     // dropdown2-panel
     if ($cellContent && $cellContent != $this->grid->emptyCell) {
         $cellContent = Html::button('<span class="glyphicon glyphicon-filter"></span>', ['title' => Yii::t('mozayka', 'Filter'), 'class' => 'btn btn-default btn-xs', 'data-dropdown2' => '#' . $dropdownId]) . Html::tag('div', Html::tag('div', $cellContent, ['class' => 'dropdown2-panel']), ['id' => $dropdownId, 'class' => 'dropdown2 dropdown2-tip' . (array_search($this, $this->grid->columns) + 1 > count($this->grid->columns) / 2 ? ' dropdown2-anchor-right' : '')]);
     }
     return $cellContent;
 }
Ejemplo n.º 5
0
 /**
  * @throws \yii\base\InvalidConfigException
  */
 public function run()
 {
     ActionButtonsAsset::register($this->getView());
     $customButtons = $this->buttons;
     $standardButtons = ['index', 'index-view', 'create', 'create-ajax', 'update', 'delete', 'return', 'search', 'export', 'import'];
     // List of the buttons that will be done in the future
     $reservedButtons = [];
     echo Html::beginTag('div', ['class' => 'action-buttons']);
     foreach ($this->order as $group) {
         $buttons = [];
         foreach ($group as $name) {
             if ($name == '@') {
                 // All other buttons
                 $buttons = array_merge($buttons, array_values($customButtons));
             } elseif (isset($customButtons[$name])) {
                 $buttons[] = $this->createCustomButton($customButtons[$name]);
             } elseif (in_array($name, $standardButtons)) {
                 if (($button = $this->{Inflector::id2camel($name) . 'Button'}) !== false) {
                     $buttons[] = $button;
                 }
             } elseif (in_array($name, $reservedButtons)) {
                 continue;
             } else {
                 throw new InvalidConfigException('Button "' . $name . '" defined in the $order parameter does not not exist');
             }
         }
         echo ButtonGroup::widget(['buttons' => $buttons]);
     }
     echo Html::endTag('div');
 }
Ejemplo n.º 6
0
    $formClass::end();
    echo Html::endTag('div');
    // panel-body
}
$pjax = Pjax::begin(['options' => ['class' => 'panel-grid-view'], 'linkSelector' => '.panel-grid-pager a, .grid-view .gv-headers a']);
$grid = $gridClass::begin($gridConfig);
$gridPager = $grid->renderPager();
$gridSummary = $grid->renderSummary();
$grid->layout = '{items}';
$gridClass::end();
$gridId = $grid->getId();
$js = 'jQuery(\'#' . $gridId . '\').closest(\'.panel\').find(\'.panel-grid-pager\').html(' . Json::encode($gridPager) . ');';
$js .= 'jQuery(\'#' . $gridId . '\').closest(\'.panel\').find(\'.panel-grid-summary\').html(' . Json::encode($gridSummary) . ');';
if ($gridSummary) {
    $this->title .= ' ' . strip_tags($gridSummary);
}
if (Yii::$app->getRequest()->getIsAjax()) {
    $js .= 'document.title = ' . Json::encode($this->title) . ';';
    echo Html::script($js);
} else {
    $js .= 'jQuery(\'#' . $pjax->getId() . '\').kinetic({\'cursor\': false, \'filterTarget\': function (target, event) { if (event.which != 2) { return false; } }});';
    $this->registerJs($js);
}
Pjax::end();
/*$footerButtons[] = Html::button('<span class="glyphicon glyphicon-arrow-up"></span> ' . Yii::t('mozayka', 'Up'), [
    'class' => 'btn btn-default',
    'onclick' => 'jQuery(document).scrollTop(0);'
]);*/
echo Html::tag('div', Html::tag('div', '&nbsp;', ['class' => 'panel-grid-pager pull-left']) . ButtonGroup::widget(['buttons' => $footerButtons, 'options' => ['class' => 'pull-right']]), ['class' => 'panel-footer clearfix hidden-print']);
echo Html::endTag('div');
// panel
Ejemplo n.º 7
0
 private function getModalFooter($inputField)
 {
     return Html::beginTag('div', ['class' => 'btn-toolbar pull-left']) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-move"></i>', 'options' => ['type' => 'button', 'data-method' => 'setDragMode', 'data-option' => 'move', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Drag mode "move"')]], ['label' => '<i class="glyphicon glyphicon-scissors"></i>', 'options' => ['type' => 'button', 'data-method' => 'setDragMode', 'data-option' => 'crop', 'class' => 'btn btn-primary', 'data-title' => Yii::t('sadovojav/cutter/cutter', 'Drag mode "crop"')]]], 'options' => ['class' => 'pull-left']]) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-ok"></i>', 'options' => ['type' => 'button', 'data-method' => 'crop', 'class' => 'btn btn-primary', 'data-title' => Yii::t('sadovojav/cutter/cutter', 'Crop')]], ['label' => '<i class="glyphicon glyphicon-refresh"></i>', 'options' => ['type' => 'button', 'data-method' => 'reset', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Refresh')]], ['label' => '<i class="glyphicon glyphicon-remove"></i>', 'options' => ['type' => 'button', 'data-method' => 'clear', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Remove')]]], 'options' => ['class' => 'pull-left']]) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-zoom-in"></i>', 'options' => ['type' => 'button', 'data-method' => 'zoom', 'data-option' => '0.1', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Zoom In')], 'visible' => $this->cropperOptions['zoomable']], ['label' => '<i class="glyphicon glyphicon-zoom-out"></i>', 'options' => ['type' => 'button', 'data-method' => 'zoom', 'data-option' => '-0.1', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Zoom Out')], 'visible' => $this->cropperOptions['zoomable']], ['label' => '<i class="glyphicon glyphicon-share-alt  icon-flipped"></i>', 'options' => ['type' => 'button', 'data-method' => 'rotate', 'data-option' => '45', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Rotate left')], 'visible' => $this->cropperOptions['rotatable']], ['label' => '<i class="glyphicon glyphicon-share-alt"></i>', 'options' => ['type' => 'button', 'data-method' => 'rotate', 'data-option' => '-45', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Rotate right')], 'visible' => $this->cropperOptions['rotatable']]], 'options' => ['class' => 'pull-left']]) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-glyphicon glyphicon-resize-full"></i>', 'options' => ['type' => 'button', 'data-method' => 'setAspectRatio', 'data-target' => '#' . $inputField . '-aspectRatio', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Set aspect ratio')]], ['label' => '<i class="glyphicon glyphicon-upload"></i>', 'options' => ['type' => 'button', 'data-method' => 'setData', 'class' => 'btn btn-primary', 'title' => Yii::t('sadovojav/cutter/cutter', 'Set data')]]], 'options' => ['class' => 'pull-left']]) . Html::endTag('div') . Html::button(Yii::t('sadovojav/cutter/cutter', 'Cancel'), ['id' => $this->imageOptions['id'] . '_button_cancel', 'class' => 'btn btn-danger']) . Html::button(Yii::t('sadovojav/cutter/cutter', 'Accept'), ['id' => $this->imageOptions['id'] . '_button_accept', 'class' => 'btn btn-success']);
 }
Ejemplo n.º 8
0
    echo Html::a($label, ['view', 'tag' => $tag, 'panel' => $id], ['class' => $panel === $activePanel ? 'list-group-item active' : 'list-group-item']);
}
?>
                </div>
            </div>
            <div class="col-lg-10 col-md-10">
                <div class="callout callout-danger">
                    <?php 
$count = 0;
$items = [];
foreach ($manifest as $meta) {
    $label = $meta['tag'] . ': ' . $meta['method'] . ' ' . $meta['url'] . ($meta['ajax'] ? ' (AJAX)' : '') . ', ' . date('Y-m-d h:i:s a', $meta['time']) . ', ' . $meta['ip'];
    $url = ['view', 'tag' => $meta['tag'], 'panel' => $activePanel->id];
    $items[] = ['label' => $label, 'url' => $url];
    if (++$count >= 10) {
        break;
    }
}
echo ButtonGroup::widget(['buttons' => [Html::a('All', ['index'], ['class' => 'btn btn-default']), ButtonDropdown::widget(['label' => 'Last 10', 'options' => ['class' => 'btn-default'], 'dropdown' => ['items' => $items]])]]);
echo "\n" . $summary['tag'] . ': ' . $summary['method'] . ' ' . Html::a(Html::encode($summary['url']), $summary['url']);
echo ' at ' . date('Y-m-d h:i:s a', $summary['time']) . ' by ' . $summary['ip'];
?>
                </div>
                <?php 
echo $activePanel->getDetail();
?>
            </div>
        </div>
    </div>
</div>
Ejemplo n.º 9
0
 public function run()
 {
     return ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [Html::a('<i class="fa fa-pause" aria-hidden="true"></i>', ['set-orientation', 'orientation' => OrientationStorage::ORIENTATION_HORIZONTAL, 'route' => Yii::$app->controller->getRoute()], ['class' => 'btn btn-default btn-sm ' . ($this->isOrientation(OrientationStorage::ORIENTATION_HORIZONTAL) ? 'active' : '')]), Html::a('<i class="fa fa-pause fa-rotate-90" aria-hidden="true"></i>', ['set-orientation', 'orientation' => OrientationStorage::ORIENTATION_VERTICAL, 'route' => Yii::$app->controller->getRoute()], ['class' => 'btn btn-default btn-sm ' . ($this->isOrientation(OrientationStorage::ORIENTATION_VERTICAL) ? 'active' : '')])]]);
 }
Ejemplo n.º 10
0
<?php

/**
 * @link http://www.bigbrush-agency.com/
 * @copyright Copyright (c) 2015 Big Brush Agency ApS
 * @license http://www.bigbrush-agency.com/license/
 */
use yii\helpers\Html;
use yii\grid\GridView;
use yii\bootstrap\Button;
use yii\bootstrap\ButtonGroup;
use bigbrush\cms\widgets\DeleteButton;
?>
<div class="table-responsive">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['header' => Yii::t('cms', 'Title'), 'format' => 'raw', 'value' => function ($data) {
    return str_repeat('<i class="fa fa-caret-right tree-indent"></i>', $data->depth - 1) . Html::a($data->title, ['edit', 'id' => $data->id]);
}], ['header' => Yii::t('cms', 'Default'), 'format' => 'raw', 'options' => ['width' => '1%'], 'contentOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'value' => function ($data) {
    return $data->is_default ? '<i class="fa fa-star"></i>' : '';
}], ['header' => Yii::t('cms', 'Ordering'), 'headerOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'format' => 'raw', 'options' => ['width' => '10%'], 'contentOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'value' => function ($data) {
    $options = ['class' => 'btn btn-default changeDirectionBtn', 'data-pid' => $data->id];
    return ButtonGroup::widget(['options' => ['class' => 'btn-group btn-group-xs'], 'buttons' => [Button::widget(['label' => '<i class="fa fa-arrow-up"></i>', 'encodeLabel' => false, 'options' => ['data-direction' => 'up'] + $options]), Button::widget(['label' => '<i class="fa fa-arrow-down"></i>', 'encodeLabel' => false, 'options' => ['data-direction' => 'down'] + $options])]]);
}], ['header' => Yii::t('cms', 'Delete'), 'format' => 'raw', 'options' => ['width' => '1%'], 'contentOptions' => ['style' => 'text-align:center; vertical-align:middle;'], 'value' => function ($data) {
    return DeleteButton::widget(['model' => $data, 'options' => ['class' => 'btn-xs']]);
}]]]);
?>
</div>
Ejemplo n.º 11
0
/* @var $this yii\web\View */
/* @var $searchModel backend\models\products\ProductsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Товары';
?>

<div class="box">
    <div class="box-header with-border">

        <h3 class="box-title"><?php 
echo Html::encode($this->title);
?>
</h3>
        <div class="box-tools">
            <?php 
echo ButtonGroup::widget(['buttons' => [Html::a('создать товар', Url::to(['/products/create']), ['class' => 'btn btn-sm btn-warning'])]]);
?>


        </div>

    </div>

    <div class="box-body">
        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'summary' => '', 'tableOptions' => ['class' => 'table table-bordered table-hover'], 'columns' => [['class' => 'yii\\grid\\DataColumn', 'label' => 'Код', 'value' => function ($data) {
    return $data['product_id'];
}], ['label' => '<i class="fa fa-picture-o"></i>', 'encodeLabel' => false, 'format' => 'raw', 'value' => function ($model) {
    $mainPhoto = $model->MainPhoto;
    return Html::a(Html::img($mainPhoto->getUrl('original'), ['class' => 'img-responsive', 'style' => 'max-width:50px;']), ['products/view', 'product_id' => $model->product_id], ['style' => 'display:block;']);
}], ['class' => 'yii\\grid\\DataColumn', 'label' => 'Каталог', 'attribute' => 'name_catalog', 'value' => function ($data) {
Ejemplo n.º 12
0
/* @var $searchModel backend\models\catalogs\CatalogsAdminSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Каталог';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="box">
    <div class="box-header with-border">

        <h3 class="box-title"><?php 
echo Html::encode($this->title);
?>
</h3>
        <div class="box-tools">
            <?php 
echo ButtonGroup::widget(['buttons' => [Html::a('создать каталог', Url::to(['/catalogs/create']), ['class' => 'btn btn-sm btn-warning'])]]);
?>


        </div>

    </div>


    <div class="box-body">
        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'summary' => '', 'tableOptions' => ['class' => 'table table-bordered table-hover'], 'columns' => [['label' => 'Код', 'contentOptions' => ['style' => 'max-width: 30px;'], 'value' => function ($model) {
    return $model->catalog_id;
}], ['label' => '<i class="fa fa-picture-o"></i>', 'encodeLabel' => false, 'format' => 'raw', 'contentOptions' => ['style' => 'max-width: 30px;'], 'value' => function ($model) {
    if ($model->getBehavior('coverBehavior')->hasImage()) {
        //                                return Html::img($model->getBehavior('coverBehavior')->getUrl('original'),['class'=>'img-responsive','style'=>'max-width:50px;']);
Ejemplo n.º 13
0
                <div class="callout <?php 
echo $calloutClass;
?>
 debug-call-out">
                    <?php 
$count = 0;
$items = [];
foreach ($manifest as $meta) {
    $label = ($meta['tag'] == $tag ? Html::tag('strong', '&#9654;&nbsp;' . $meta['tag']) : $meta['tag']) . ': ' . $meta['method'] . ' ' . $meta['url'] . ($meta['ajax'] ? ' (AJAX)' : '') . ', ' . date('Y-m-d h:i:s a', $meta['time']) . ', ' . $meta['ip'];
    $url = ['view', 'tag' => $meta['tag'], 'panel' => $activePanel->id];
    $items[] = ['label' => $label, 'url' => $url];
    if (++$count >= 10) {
        break;
    }
}
echo ButtonGroup::widget(['options' => ['class' => 'btn-group-sm'], 'buttons' => [Html::a('All', ['index'], ['class' => 'btn btn-default']), Html::a('Latest', ['view', 'panel' => $activePanel->id], ['class' => 'btn btn-default']), ButtonDropdown::widget(['label' => 'Last 10', 'options' => ['class' => 'btn-default btn-sm'], 'dropdown' => ['items' => $items, 'encodeLabels' => false]])]]);
echo '<BR><BR>';
$url = Html::a(Html::encode($summary['url']));
$url = str_replace("http://", "", $url);
$url = str_replace("https://", "", $url);
$url = substr($url, strpos($url, "/"));
if (strlen($url) > 60) {
    $url = substr($url, 0, 60) . '...';
}
echo $summary['method'] . ' ' . $url . '<BR>';
echo 'Tag: ' . $summary['tag'] . ' - ';
echo 'at ' . date('Y-m-d h:i:s a', $summary['time']) . ' - ';
echo 'with ip ' . $summary['ip'] . ' ';
?>
                </div>
                <?php 
Ejemplo n.º 14
0
 private function getModalFooter($inputField)
 {
     return Html::beginTag('div', ['class' => 'btn-toolbar pull-left']) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-move"></i>', 'options' => ['type' => 'button', 'data-method' => 'setDragMode', 'data-option' => 'move', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'DRAG_MODE_MOVE')]], ['label' => '<i class="glyphicon glyphicon-scissors"></i>', 'options' => ['type' => 'button', 'data-method' => 'setDragMode', 'data-option' => 'crop', 'class' => 'btn btn-primary', 'data-title' => Yii::t('davfervaz/cutter', 'DRAG_MODE_CROP')]]], 'options' => ['class' => 'pull-left']]) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-ok"></i>', 'options' => ['type' => 'button', 'data-method' => 'crop', 'class' => 'btn btn-primary', 'data-title' => Yii::t('davfervaz/cutter', 'CROP')]], ['label' => '<i class="glyphicon glyphicon-refresh"></i>', 'options' => ['type' => 'button', 'data-method' => 'reset', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'REFRESH')]], ['label' => '<i class="glyphicon glyphicon-remove"></i>', 'options' => ['type' => 'button', 'data-method' => 'clear', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'REMOVE')]]], 'options' => ['class' => 'pull-left']]) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-zoom-in"></i>', 'options' => ['type' => 'button', 'data-method' => 'zoom', 'data-option' => '0.1', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'ZOOM_IN')], 'visible' => $this->cropperOptions['zoomable']], ['label' => '<i class="glyphicon glyphicon-zoom-out"></i>', 'options' => ['type' => 'button', 'data-method' => 'zoom', 'data-option' => '-0.1', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'ZOOM_OUT')], 'visible' => $this->cropperOptions['zoomable']], ['label' => '<i class="glyphicon glyphicon-share-alt  icon-flipped"></i>', 'options' => ['type' => 'button', 'data-method' => 'rotate', 'data-option' => '45', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'ROTATE_LEFT')], 'visible' => $this->cropperOptions['rotatable']], ['label' => '<i class="glyphicon glyphicon-share-alt"></i>', 'options' => ['type' => 'button', 'data-method' => 'rotate', 'data-option' => '-45', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'ROTATE_RIGHT')], 'visible' => $this->cropperOptions['rotatable']]], 'options' => ['class' => 'pull-left']]) . ButtonGroup::widget(['encodeLabels' => false, 'buttons' => [['label' => '<i class="glyphicon glyphicon-glyphicon glyphicon-resize-full"></i>', 'options' => ['type' => 'button', 'data-method' => 'setAspectRatio', 'data-target' => '#' . $inputField . '-aspectRatio', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'SET_ASPECT_RATIO')]], ['label' => '<i class="glyphicon glyphicon-upload"></i>', 'options' => ['type' => 'button', 'data-method' => 'setData', 'class' => 'btn btn-primary', 'title' => Yii::t('davfervaz/cutter', 'SET_DATA')]]], 'options' => ['class' => 'pull-left']]) . Html::endTag('div') . Html::button(Yii::t('davfervaz/cutter', 'CANCEL'), ['id' => $this->imageOptions['id'] . '_button_cancel', 'class' => 'btn btn-danger']) . Html::button(Yii::t('davfervaz/cutter', 'ACCEPT'), ['id' => $this->imageOptions['id'] . '_button_accept', 'class' => 'btn btn-success']);
 }
Ejemplo n.º 15
0
 private function prepareRow($data)
 {
     $row = '';
     $name = ArrayHelper::getValue($this->columns, 'name', 'name');
     $content = is_callable($name) ? call_user_func($name, $data) : $data->{$name};
     if (count($this->columns) < 2) {
         $row = $content;
     } else {
         $name = ArrayHelper::getValue($this->columns, 'url');
         if (is_callable($name)) {
             $row = Html::a($content, call_user_func($name, $data), ['data-pjax' => 0]);
         } else {
             $row = Html::a($content, $data->hasAttribute($name) ? $data->{$name} : $name);
         }
     }
     if (!is_null($this->buttons) && !$this->hideButtons) {
         $template = '<div class="pull-right" style="margin-top: -2px;">{buttons}</div>';
         $myButtons = $this->buttons;
         foreach ($myButtons as $key => &$button) {
             if (is_string($button)) {
                 continue;
             }
             if (array_key_exists('visible', $button)) {
                 $name = ArrayHelper::getValue($button, 'visible');
                 if (is_callable($name)) {
                     $button['visible'] = call_user_func($name, $data);
                 }
                 if (!$button['visible'] && !is_null($key)) {
                     unset($myButtons[$key]);
                     continue;
                 }
             }
             $label = $button['label'];
             $url = ArrayHelper::getValue($button, 'url', '#');
             unset($button['label']);
             if (isset($button['url'])) {
                 if (is_callable($url)) {
                     $url = call_user_func($url, $data);
                 }
             }
             $options = $button['options'];
             $options['class'] = 'btn btn-default' . (isset($options['class']) ? ' ' . $options['class'] : '');
             $button = Html::a($label, $url, $options);
         }
         $row .= strtr($template, ['{buttons}' => ButtonGroup::widget(['encodeLabels' => false, 'options' => ['class' => 'btn-group-xs'], 'buttons' => $myButtons])]);
     }
     return $row;
 }
Ejemplo n.º 16
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     $attribute = $this->attribute;
     $buttons = [];
     foreach ($this->buttons as $button) {
         if (is_array($button)) {
             $name = $this->name ?: $this->model->{$this->attribute};
             $value = isset($button['value']) ? $button['value'] : $this->value;
             $checked = $value == $this->value;
             $options = isset($button['options']) ? $button['options'] : [];
             if (!isset($options['class'])) {
                 Html::addCssClass($options, 'btn btn-primary');
             }
             if ($checked) {
                 Html::addCssClass($options, 'active');
             }
             $buttons[] = Html::radio($name, $checked, ['label' => $button['label'], 'value' => $value, 'uncheck' => null, 'labelOptions' => $options]);
         } else {
             $buttons[] = $button;
         }
     }
     $view = $this->getView();
     BootstrapPluginAsset::register($view);
     $view->registerJs('
         $(".button-group-wrapper .btn").button();
     ');
     return Html::tag('div', ButtonGroup::widget(['options' => ['class' => 'btn-group btn-toggle', ' data-toggle' => 'buttons'], 'buttons' => $buttons]), ['class' => 'button-group-wrapper']);
 }
Ejemplo n.º 17
0
?>

<div class="catalogs-admin-search">

    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>

    <?php 
echo $form->field($model, 'id');
?>

    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <?php 
echo ButtonGroup::widget(['buttons' => [Button::widget(['label' => 'A']), ['label' => 'B']]]);
?>
        </div>
    </div>
   

    <div class="form-group">
        <?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::resetButton('Reset', ['class' => 'btn btn-default']);
?>
    </div>

    <?php 
Ejemplo n.º 18
0
<?php

use yii\bootstrap\ButtonGroup;
use yii\helpers\Html;
$this->title = Yii::t('core', 'Welcome to comfyCMS homepage');
$this->params['breadcrumbs'][] = $this->title;
echo Html::beginTag('div', ['class' => 'jumbotron']);
echo Html::tag('h1', Yii::t('core', 'Congratulations!'));
echo Html::tag('p', Yii::t('core', 'You have successfully created ComfyCMS.'));
echo ButtonGroup::widget(['buttons' => [Html::a(Yii::t('core', 'Get started with Yii2'), 'http://www.yiiframework.com', ['class' => 'btn btn-info']), Html::a(Yii::t('core', 'ComfyCMS on GitHub'), 'https://github.com/fourteenmeister/comfyCMS', ['class' => 'btn btn-success']), Html::a(Yii::t('core', 'Find a bug?'), 'https://github.com/fourteenmeister/comfyCMS/issues', ['class' => 'btn btn-danger'])]]);
echo Html::endTag('div');
Ejemplo n.º 19
0
use yii\helpers\Html, yii\bootstrap\ButtonGroup;
/**
 * @var yii\web\View $this
 * @var bool $canList
 * @var string $pluralHumanName
 * @var yii\db\ActiveRecord $model
 * @var string $id
 * @var string $displayField
 * @var array $fields
 * @var string $formClass
 * @var array $formConfig
 */
$this->title = Yii::t('mozayka', 'Record "{record}".', ['record' => $displayField]);
if ($canList) {
    $this->params['breadcrumbs'][] = ['label' => $pluralHumanName, 'url' => ['list']];
}
$this->params['breadcrumbs'][] = $displayField;
$buttons = [];
$buttons[] = Html::button('<span class="glyphicon glyphicon-print"></span> ' . Yii::t('mozayka', 'Print'), ['class' => 'btn btn-default', 'onclick' => 'print();']);
if ($canList) {
    $buttons[] = Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('mozayka', 'Back'), ['list'], ['class' => 'btn btn-default']);
}
$form = $formClass::begin($formConfig);
$form->inputIdPrefix = $form->getId() . '-';
echo Html::beginTag('div', ['class' => 'panel panel-default']);
echo Html::tag('div', Html::tag('h3', $this->title, ['class' => 'panel-title pull-left']) . ButtonGroup::widget(['buttons' => $buttons, 'options' => ['class' => 'pull-right']]), ['class' => 'panel-heading clearfix hidden-print']);
echo Html::tag('div', $form->fields($model, $fields), ['class' => 'panel-body']);
echo Html::tag('div', ButtonGroup::widget(['buttons' => $buttons, 'options' => ['class' => 'pull-right']]), ['class' => 'panel-footer clearfix hidden-print']);
echo Html::endTag('div');
// panel
$formClass::end();
Ejemplo n.º 20
0
    <div class="col-md-3">
        <?php 
echo app\widgets\Refnum::widget(['model' => $model, 'attribute' => 'refnum']);
?>
    </div>
    
</div>
<div class="row">
<div class="btn-group">
<?php 
echo \yii\helpers\Html::dropDownList('language', Yii::$app->language, \yii\helpers\ArrayHelper::map(Language::find()->All(), 'id', 'name'), ['id' => 'langSel']);
?>
    <?php 
echo \yii\helpers\Html::hiddenInput("subType", "email");
echo \yii\helpers\Html::hiddenInput("docs[id]", $model->id);
echo \yii\helpers\Html::hiddenInput("docs[doctype]", $model->doctype);
if ($model->doctype != 13 && $model->doctype != 14) {
    echo \yii\bootstrap\ButtonGroup::widget(['options' => ['class' => 'btn-group dropup'], 'buttons' => [['options' => ['class' => 'btn-success'], 'label' => Yii::t('app', 'Print'), 'clientEvents' => ['click' => 'function(event){sendForm("print");}']], \yii\bootstrap\ButtonDropdown::widget(['label' => Yii::t('app', 'Make'), 'options' => ['class' => 'btn-success'], 'dropdown' => ['items' => array("<li>" . \yii\helpers\Html::a(Yii::t('app', 'Print'), 'javascript:sendForm("print");') . "</li>", "<li>" . \yii\helpers\Html::a(Yii::t('app', 'Email'), 'javascript:sendForm("email");') . "</li>", "<li>" . \yii\helpers\Html::a(Yii::t('app', 'PDF'), 'javascript:sendForm("pdf");') . "</li>", "<li>" . \yii\helpers\Html::a(Yii::t('app', 'Save Draft'), 'javascript:sendForm("saveDraft");') . "</li>")]]), \yii\bootstrap\Button::widget(['label' => Yii::t('app', 'Change language'), 'options' => ['class' => 'btn-success'], 'clientEvents' => ['click' => "function(event){event.preventDefault();\$(this).hide(150); \$('#langSel').show(150);}"]]), \yii\bootstrap\Button::widget(['label' => Yii::t('app', 'Submit'), 'options' => ['class' => 'btn-success', 'type' => 'submit']])]]);
}
?>
</div>
</div>
    <?php 
kartik\form\ActiveForm::end();
app\widgets\MiniForm::end();
echo app\widgets\Mail::widget(array('urlFile' => yii\helpers\BaseUrl::base() . ("/docs/view/" . $model->id . "?mail=1"), 'urlAddress' => yii\helpers\BaseUrl::base() . ("/accounts/json/" . $model->account_id), 'urlMailForm' => yii\helpers\BaseUrl::base() . '/mail/create', 'urlTemplate' => yii\helpers\BaseUrl::base() . '/mailtemplate/json', 'obj' => "app\\\\models\\\\Docs", 'type' => $model->doctype, 'id' => $model->id));
?>


<?php 
echo \app\widgets\RefnumModal::widget(['model' => $model, 'attribute' => 'refnum']);
Ejemplo n.º 21
0
    <div>
        <div style="width: 30%; float: left">
            <?php 
echo $form->field($searchModel, 'dateFrom')->widget(DatePicker::classname(), ['language' => 'ru'])->label(false)->textInput(['placeholder' => 'Дата выхода c']);
?>
        </div>
        <div style="width: 30%; float: left">
            <?php 
echo $form->field($searchModel, 'dateTo')->widget(DatePicker::classname(), ['language' => 'ru'])->label(false)->textInput(['placeholder' => 'Дата выхода по']);
?>
        </div>
        <div style="clear: both"></div>
    </div>
</div>
<?php 
echo Button::widget(['label' => 'search', 'options' => ['class' => 'btn-lg btn-primary']]);
ActiveForm::end();
?>


<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['attribute' => 'preview', 'format' => 'html', 'value' => function ($data) {
    return Html::img(Yii::getAlias('@web') . '/images/' . $data['preview'], ['width' => '30px', 'class' => 'scalable']);
}], 'fullName', 'date:date', 'date_create:date', 'actions' => ['format' => 'raw', 'value' => function ($data) {
    return ButtonGroup::widget(['encodeLabels' => false, 'options' => ['data-id' => $data['id']], 'buttons' => [['options' => ['class' => 'a-edit btn-primary'], 'label' => '<span class="glyphicon glyphicon-pencil"></span>'], ['options' => ['class' => 'a-view btn-primary', 'data-toggle' => 'modal', 'data-target' => '#modal-window'], 'label' => '<span class="glyphicon glyphicon-eye-open"></span>'], ['options' => ['class' => 'a-remove btn-primary'], 'label' => '<span class="glyphicon glyphicon-remove"></span>']]]);
}]]]);
yii\bootstrap\Modal::begin(['header' => '<h2>DetailView</h2>', 'options' => ['id' => 'modal-window']]);
?>
<div id="modal-content"></div>
<?php 
yii\bootstrap\Modal::end();
Ejemplo n.º 22
0
/* @var $searchModel app\models\ProductsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Товары';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="products-index">

    <h1 class="page-header"><?php 
echo Html::encode($this->title);
?>
</h1>
       
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="pull-right">
             <?php 
echo ButtonGroup::widget(['buttons' => [Html::a('создать товар', Url::to(['/admin/products/create']), ['class' => 'btn btn-success'])]]);
?>
        </div>
    </div>
        
       


    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\DataColumn', 'label' => 'Код', 'value' => function ($data) {
    return $data['id'];
}], ['class' => 'yii\\grid\\DataColumn', 'label' => 'Аватар', 'format' => 'html', 'value' => function ($model, $key, $index, $column) {
    // $product = Products::findOne($model->id);
    // $mainPhoto = $product->mainPhoto;
    // return Html::a(
    //     Html::img($mainPhoto->url,['class'=>'img-responsive','style'=>'width:50px;']),
Ejemplo n.º 23
0
 public function init()
 {
     if (!isset($this->options['id'])) {
         $this->_cid = $this->options['id'] = 'bc_' . $this->getId();
     }
     $this->registerJs();
     Html::addCssClass($this->options, 'box');
     Html::addCssClass($this->options, 'box-' . $this->type);
     if ($this->solid) {
         Html::addCssClass($this->options, 'box-solid');
     }
     if ($this->collapse and $this->collapseDefault and !$this->collapse_remember) {
         Html::addCssClass($this->options, 'collapsed-box');
     }
     if (is_array($this->custom_tools)) {
         if ($this->collapse) {
             $this->custom_tools[] = '<button class="btn btn-' . $this->type . ' btn-xs" data-widget="collapse" id="' . $this->_cid . '_btn"><i class="fa fa-minus"></i></button>';
         }
         $this->custom_tools = ButtonGroup::widget(['buttons' => $this->custom_tools, 'encodeLabels' => false]);
     } else {
         $this->custom_tools = $this->custom_tools . ($this->collapse ? '<button class="btn btn-' . $this->type . ' btn-xs" data-widget="collapse" id="' . $this->_cid . '_btn"><i class="fa fa-minus"></i></button>' : '');
     }
     if (is_array($this->left_tools) && !empty($this->left_tools)) {
         $this->left_tools = ButtonGroup::widget(['buttons' => $this->left_tools, 'encodeLabels' => false]);
     }
     $custTools = Html::tag('div', $this->custom_tools, ['class' => 'box-tools pull-right']);
     $headerContent = !$this->left_tools ? '' : '<div class="box-tools pull-left">' . $this->left_tools . '</div>';
     $headerContent .= !$this->title ? '' : Html::tag($this->header_tag, $this->title, ['class' => 'box-title']);
     $headerContent .= $this->custom_tools || $this->collapse ? $custTools : '';
     $headerOptions = ['class' => 'box-header'];
     if ($this->withBorder) {
         Html::addCssClass($headerOptions, 'with-border');
     }
     if ($this->tooltip) {
         $headerOptions = array_merge($headerOptions, ['data-toggle' => 'tooltip', 'data-original-title' => $this->tooltip, 'data-placement' => $this->tooltip_placement]);
     }
     $header = Html::tag('div', $headerContent, $headerOptions);
     echo '<div ' . Html::renderTagAttributes($this->options) . '>' . (!$this->title && !$this->collapse && !$this->custom_tools && !$this->left_tools ? '' : $header) . '<div class="box-body">';
 }
Ejemplo n.º 24
0
 protected function renderDropdowns()
 {
     return ButtonGroup::widget(['buttons' => [$this->renderIcon(), $this->renderColor(), $this->renderEffect()]]);
 }