Exemplo n.º 1
0
 public function run()
 {
     if ($this->boxed) {
         Box::begin($this->boxOptions);
         parent::run();
         Box::end();
     } else {
         parent::run();
     }
 }
Exemplo n.º 2
0
<?php

/*
 * Client module for HiPanel
 *
 * @link      https://github.com/hiqdev/hipanel-module-client
 * @package   hipanel-module-client
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
 */
use hipanel\grid\GridView;
use yii\helpers\Html;
use yii\widgets\Pjax;
$this->title = 'Set language';
$this->params['breadcrumbs'][] = $this->title;
echo Html::beginForm(['set-credit'], 'POST');
if (!Yii::$app->request->isAjax) {
    echo Html::submitButton(Yii::t('hipanel', 'Submit'), ['class' => 'btn btn-primary']);
}
if (!Yii::$app->request->isAjax) {
    echo Html::submitButton(Yii::t('hipanel', 'Cancel'), ['type' => 'cancel', 'class' => 'btn btn-success', 'onClick' => 'history.back()']);
}
Pjax::begin();
$widgetIndexConfig = ['dataProvider' => $dataProvider, 'columns' => [['label' => Yii::t('hipanel', 'Client'), 'format' => 'raw', 'value' => function ($data) {
    return HTML::input('hidden', "ids[{$data->id}][Client][id]", $data->id, ['readonly' => 'readonly']) . HTML::tag('span', $data->login);
}], ['label' => Yii::t('hipanel', 'Language'), 'format' => 'raw', 'value' => function ($data) {
    return Html::dropDownList("ids[{$data->id}}][Client][language]", $data->language, \hipanel\models\Ref::getList('type,lang', 'hipanel'));
}]]];
echo GridView::widget($widgetIndexConfig);
Pjax::end();
echo Html::endForm();
Exemplo n.º 3
0
/*
 * Stock Module for Hipanel
 *
 * @link      https://github.com/hiqdev/hipanel-module-stock
 * @package   hipanel-module-stock
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
 */
/**
 * @var array
 */
use yii\helpers\Html;
echo \hipanel\grid\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['pagination' => false, 'allModels' => $data, 'sort' => false]), 'summary' => false, 'columns' => [['attribute' => 'type', 'format' => 'html', 'label' => Yii::t('hipanel:stock', 'Type'), 'options' => ['style' => 'width: 20%'], 'value' => function ($models, $key) {
    return Html::tag('strong', Yii::t('hipanel:stock', $key));
}], ['label' => Yii::t('hipanel:stock', 'Model'), 'attribute' => 'model', 'options' => ['style' => 'width: 40%'], 'format' => 'raw', 'value' => function ($models) {
    $models_partno = [];
    foreach ($models as $model_id => $parts) {
        $modelLink = Html::a(reset($parts)->partno, ['@model/view', 'id' => $model_id]);
        $models_partno[] = (count($parts) > 1 ? count($parts) . 'x' : '') . $modelLink;
    }
    return implode(', ', $models_partno);
}], ['attribute' => 'serials', 'format' => 'html', 'label' => Yii::t('hipanel:stock', 'Serials'), 'value' => function ($models) {
    $serials = [];
    foreach ($models as $model_id => $parts) {
        foreach ($parts as $part) {
            $serials[] = Html::a($part->serial, ['@part/view', 'id' => $part->id]);
        }
    }
    return implode(', ', $serials);
}]]]);