Пример #1
0
 public function getStatusText()
 {
     return Constants::getStatusItemsForContent($this->status);
 }
Пример #2
0
<?php

use yii\helpers\Html;
use source\core\grid\GridView;
use source\LuLu;
use source\models\Content;
use source\libs\Constants;
/* @var $this yii\web\View */
/* @var $searchModel app\models\search\ContentSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$type = 'post';
$this->title = '单面管理';
$this->params['breadcrumbs'][] = $this->title;
$this->toolbars([Html::a('新建', ['create'], ['class' => 'btn btn-xs btn-primary mod-site-save']), Html::a('设置', ['setting/index'], ['class' => 'btn btn-xs btn-primary mod-site-save'])]);
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'columns' => [['class' => 'source\\core\\grid\\IdColumn'], ['attribute' => 'title', 'headerOptions' => ['width' => 'auto']], ['class' => 'source\\core\\grid\\DateTimeColumn', 'attribute' => 'updated_at'], 'userText', 'comment_count', 'view_count', ['attribute' => 'status', 'width' => '25px', 'content' => function ($model, $key, $index, $gridView) {
    return Constants::getStatusItemsForContent($model->status);
}], ['class' => 'source\\core\\grid\\ActionColumn']]]);
?>

Пример #3
0
                      </div>           	      
            	      <div class="da-form-row">
            		    <?php 
echo $form->field($model, 'recommend', ['template' => $template2, 'options' => ['class' => 'da-form-col-4 alpha']])->dropDownList(Constants::getRecommendItems());
?>
            		    <?php 
echo $form->field($model, 'headline', ['template' => $template2, 'options' => ['class' => 'da-form-col-4']])->dropDownList(Constants::getHeadlineItems());
?>
            		    <?php 
echo $form->field($model, 'sticky', ['template' => $template2, 'options' => ['class' => 'da-form-col-4 omega']])->dropDownList(Constants::getStickyItems());
?>
                      </div>
                                               
            	       <div class="da-form-row">       
            			<?php 
echo $form->field($model, 'status', ['template' => $template2, 'options' => ['class' => 'da-form-col-4 alpha']])->dropDownList(Constants::getStatusItemsForContent(), [], false);
?>
            			<?php 
echo $form->field($model, 'visibility', ['template' => $template2, 'options' => ['class' => 'da-form-col-4']])->dropDownList(Constants::getVisibilityItems(), [], false);
?>
            			<?php 
echo $form->field($model, 'allow_comment', ['template' => $template2, 'options' => ['class' => 'da-form-col-4 omega']])->dropDownList(Constants::getYesNoItems(), [], false);
?>
                       </div>


                       
                       <!--                   		   
            	       <div class="da-form-row">            		    
            		    <?php 
echo $form->field($model, 'view_count', ['template' => $template2, 'options' => ['class' => 'da-form-col-3 alpha']])->textInput();
Пример #4
0
                <div class="da-form-row da-form-block">
                    <?php 
echo $form->field($model, 'recommend', ['options' => ['class' => 'da-form-col-4-12 alpha'], 'size' => 'large'])->dropDownList(Constants::getRecommendItems());
?>
                    <?php 
echo $form->field($model, 'headline', ['options' => ['class' => 'da-form-col-4-12'], 'size' => 'large'])->dropDownList(Constants::getHeadlineItems());
?>
                    <?php 
echo $form->field($model, 'sticky', ['options' => ['class' => 'da-form-col-4-12 omega'], 'size' => 'large'])->dropDownList(Constants::getStickyItems());
?>
                </div>

                <div class="da-form-row da-form-block">
                    <?php 
echo $form->field($model, 'status', ['options' => ['class' => 'da-form-col-4-12 alpha'], 'size' => 'large'])->dropDownList(Constants::getStatusItemsForContent(), [], false);
?>
                    <?php 
echo $form->field($model, 'visibility', ['options' => ['class' => 'da-form-col-4-12'], 'size' => 'large'])->dropDownList(Constants::getVisibilityItems(), [], false);
?>
                    <?php 
echo $form->field($model, 'allow_comment', ['options' => ['class' => 'da-form-col-4-12 omega'], 'size' => 'large'])->dropDownList(Constants::getYesNoItems(), [], false);
?>
                </div>

                <?php 
echo $form->defaultButtons();
?>
            </div>
        </div>