예제 #1
0
<?php

use app\widgets\Tabs;
/** @var $this yii\web\View */
/** @var $editor modules\wiki\forms\Editor */
/** @var $historyProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Update page');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Wiki'), 'url' => ['page/index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo Tabs::widget(['items' => [['label' => Yii::t('app', 'Editor'), 'content' => $this->render('_editor', ['editor' => $editor])], ['label' => Yii::t('app', 'History'), 'content' => $this->render('_history', ['historyProvider' => $historyProvider]), 'visible' => Yii::$app->user->can('viewWikiHistory')]]]);
예제 #2
0
 /**
  * @inheritdoc
  */
 public function run($tab = '')
 {
     if (!$this->checkSectionAccess($tab)) {
         throw new ForbiddenHttpException();
     }
     $this->controller->getView()->title = $this->title;
     $this->_tab = $tab;
     if (Yii::$app->request->isPost) {
         $post = Yii::$app->request->post();
         $section = ArrayHelper::getValue($post, 'section', Param::DEFAULT_SECTION);
         /** @var $configs Config[] */
         $configs = Param::getConfigsBySection($section);
         if (Config::loadMultiple($configs, $post)) {
             Config::validateMultiple($configs);
             /** @var $config Config */
             foreach ($configs as $config) {
                 $isDirty = $config->getDirtyAttributes(['value']);
                 if (!$config->getErrors() && $isDirty && Param::isAccess($config) && $config->save(false, ['value'])) {
                     $this->controller->addFlash(Controller::FLASH_SUCCESS, Yii::t('app', '<b>{title}</b> updated.', ['title' => $config->title]));
                 }
             }
             $this->_configs[$section] = $configs;
         }
     }
     $this->tabsOptions['items'] = $this->renderTabs();
     return $this->controller->renderContent(Tabs::widget($this->tabsOptions));
 }
예제 #3
0
    }
    if ($model['label'] > 50) {
        $color = 'bg-yellow';
    }
    if ($model['label'] > 80) {
        $color = 'bg-green';
    }
    return Html::tag('span', $model['label'] . '%', ['class' => 'badge ' . $color]);
}, 'format' => 'html']]]);
?>
        <?php 
Box::end();
?>
        
        <?php 
echo Tabs::widget(['items' => [['label' => 'Tab 1', 'content' => '<div>' . Check::widget(['name' => 'chk1', 'label' => 'Enable report']) . '</div><div>' . Check::widget(['name' => 'chk2', 'label' => 'Send email', 'value' => true]) . '</div>'], ['label' => 'Tab 2', 'content' => ProgressBar::widget(['style' => ProgressBar::STYLE_SUCCESS, 'value' => 30, 'vertical' => true]) . ProgressBar::widget(['style' => ProgressBar::STYLE_WARNING, 'value' => 60, 'vertical' => true]) . ProgressBarGroup::widget(['value' => 82, 'label' => 'Processing'])], ['label' => 'Tab 3', 'content' => 'Content 3...'], ['label' => 'Dropdown', 'items' => [['label' => 'Label', 'content' => '....'], ['label' => 'Label', 'content' => '....']]]]]);
?>
        
    </div>
    
    <div class="col-md-6">
        <?php 
Box::begin(['box' => Box::BOX_PRIMARY, 'label' => 'Box 1', 'collapsable' => true, 'solid' => true]);
?>
            The body of the box. The body of the box. The body of the box.
            <?php 
app\widgets\Modal::begin(['toggleButton' => ['label' => 'Modal with remote content.', 'class' => 'btn btn-flat btn-success'], 'header' => '<b>Remote content</b>', 'remote' => ['modal-remote']]);
?>
                <p class="text-center text-capitalize">Loading...</p>
            <?php 
app\widgets\Modal::end();