Exemplo n.º 1
0
 /**
  * Lists all Role models.
  * @return mixed
  */
 public function actionIndex()
 {
     $result = [];
     $rows = Role::findAll();
     foreach ($rows as $row) {
         $result[$row->category][] = $row;
     }
     return $this->render('index', ['membersDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Role::Category_Member, []), 'key' => 'id']), 'adminsDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Role::Category_Admin, []), 'key' => 'id']), 'systemsDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Role::Category_System, []), 'key' => 'id'])]);
 }
Exemplo n.º 2
0
 /**
  * Lists all Permission models.
  * @return mixed
  */
 public function actionIndex()
 {
     $result = [];
     $rows = Permission::findAll(null, 'sort_num desc');
     foreach ($rows as $row) {
         $result[$row->category][] = $row;
     }
     return $this->render('index', ['basicsDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Permission::Category_Basic, []), 'key' => 'id']), 'controllersDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Permission::Category_Controller, []), 'key' => 'id']), 'systemsDataProvider' => new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, Permission::Category_System, []), 'key' => 'id'])]);
 }
Exemplo n.º 3
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['sys_theme_home' => '前台主题', 'sys_theme_admin' => '后台主题'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 4
0
 public static function getThirdLoginStatus($key = null)
 {
     $items = [self::Third_Login_Status_Open => '开启', self::Third_Login_Status_Close => '关闭'];
     return ArrayHelper::getItems($items, $key);
 }
Exemplo n.º 5
0
<?php

use yii\helpers\Html;
use source\LuLu;
use source\libs\Common;
use source\helpers\ArrayHelper;
use source\core\widgets\ActiveForm;
use source\modules\tools\models\Setting;
/* @var $this source\core\front\FrontView */
/* @var $generator yii\gii\generators\module\Generator */
?>

<?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'post_taxonomy')->dropDownList(ArrayHelper::map($categories, 'id', 'name'));
?>
   
    <?php 
echo $form->defaultButtons();
ActiveForm::end();
Exemplo n.º 6
0
 private function getDataRrovider($result, $category)
 {
     $provider = new ArrayDataProvider(['allModels' => ArrayHelper::getValue($result, $category, []), 'key' => 'id', 'pagination' => ['pageSize' => -1]]);
     return $provider;
 }
Exemplo n.º 7
0
 public static function getCategoryItems($key = null)
 {
     $items = [self::Category_Member => '会员角色', self::Category_Admin => '管理员角色', self::Category_System => '系统角色'];
     return ArrayHelper::getItems($items, $key);
 }
Exemplo n.º 8
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => 'ID', 'category_id' => '碎片分类', 'name' => '名称', 'description' => '描述', 'type' => '类型'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 9
0
 public static function getFormItems($key = null)
 {
     $items = [self::Form_Boolean => '布尔型', self::Form_Input => '单选输入框', self::Form_Textarea => '多行输入框', self::Form_RadioList => '单选', self::Form_CheckboxList => '多选'];
     return ArrayHelper::getItems($items, $key);
 }
Exemplo n.º 10
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => 'ID', 'parent_id' => '父结点', 'category_id' => '分类', 'name' => '名称', 'url' => '链接地址', 'target' => '打开方式', 'targetText' => '打开方式', 'description' => '描述', 'thumb' => '图片', 'status' => '状态', 'statusText' => '状态', 'sort_num' => '排序'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 11
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => '编号', 'parent_id' => '父级', 'category_id' => '分类', 'name' => '名称', 'value' => '值', 'description' => '描述', 'thumb' => '缩略图', 'status' => '状态', 'statusText' => '状态', 'sort_num' => '排序'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 12
0
 public static function getCategories($type)
 {
     $items = self::findAll(['type' => $type]);
     return ArrayHelper::map($items, 'id', 'name');
 }
Exemplo n.º 13
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => '编号', 'parent_id' => '父结点', 'category_id' => '分类', 'name' => '名称', 'url_alias' => '别名', 'redirect_url' => '跳转链接', 'thumb' => '缩略图', 'description' => '描述', 'page_size' => '每页大小', 'list_view' => '列表面view', 'list_layout' => '列表面layout', 'detail_view' => '内容页view', 'detail_layout' => '内容页layout', 'seo_title' => '标题', 'seo_keywords' => '关键字', 'seo_description' => '描述', 'contents' => '内容数量', 'sort_num' => '排序'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 14
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => '名称', 'value' => '值'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 15
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => 'ID', 'fragment_id' => '碎片', 'title' => '标题', 'content' => '内容', 'created_at' => '添加时间', 'created_by' => '作者', 'sort_num' => '排序', 'status' => '状态'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 16
0
 public static function getCategorysArray($pid)
 {
     $model = self::find()->andWhere(['pid' => $pid])->all();
     return ArrayHelper::map($model, 'id', 'name');
 }
Exemplo n.º 17
0
    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'username')->textInput(['maxlength' => 255, 'readonly' => $model->isNewRecord ? null : 'readonly']);
?>

    <?php 
echo $form->field($model, 'password')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'role')->dropDownList(ArrayHelper::map($this->rbacService->getAllRoles(), 'id', 'name', 'category'));
?>
    
    <?php 
echo $form->field($model, 'status')->radioList(Constants::getStatusItems());
?>
  

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

    <?php 
ActiveForm::end();
Exemplo n.º 18
0
    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'username')->textInput(['maxlength' => 255, 'readonly' => $model->isNewRecord ? null : 'readonly']);
?>

    <?php 
echo $form->field($model, 'password')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => 255]);
?>

    <?php 
echo $form->field($model, 'status')->radioList(Constants::getStatusItems());
?>

    <?php 
echo $form->field($model, 'role')->dropDownList(ArrayHelper::map(Role::buildOptions(), 'id', 'name', 'category'));
?>
  

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

    <?php 
ActiveForm::end();
Exemplo n.º 19
0
 public function getModel($model)
 {
     $items = ['Taxonomy' => Taxonomy::className(), 'TaxonomyCategory' => TaxonomyCategory::className()];
     return ArrayHelper::getItems($items, $model, true);
 }
Exemplo n.º 20
0
 public static function getStickyItems($key = null)
 {
     $items = [1 => '一级置顶', 2 => '二级置顶', 3 => '三级置顶', 4 => '四级置顶', 5 => '五级置顶', 6 => '六级置顶', 7 => '七级置顶', 8 => '八级置顶', 9 => '九级置顶'];
     return ArrayHelper::getItems($items, $key);
 }
Exemplo n.º 21
0
$this->title='页面模块设置';
$this->addBreadcrumbs([
		'基本设置'
		]);
		
		$categories = Common::getTakonomyCategories();
?>
    

                
                <?php $form = ActiveForm::begin(); ?>
                <div class="mod">
                    <div class="mod-head">
                        <h3>
                            <span class="pull-left"><?= $this->title ?></span>
                        </h3>
                    </div>
                    <div class="tab-content mod-content">
                    <?= $form->field($model, 'page_takonomy')->dropDownList(ArrayHelper::map($categories, 'id', 'name')) ?>
                   
                    </div>
                    
                    <div class="tab-content mod-content mod-one-btn">
                        <div class="center-block">
                            <button type="submit"  class="btn btn-primary" >保存设置</button>
                        </div>
                    </div>
                </div>
                <?php ActiveForm::end(); ?>
           
Exemplo n.º 22
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['test1' => 'test1 label', 'test2' => 'test2 label'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 23
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => 'ID', 'fragment_id' => '碎片', 'title' => '标题', 'title_format' => '标题格式', 'thumb' => '缩略图', 'url' => '链接地址', 'sub_title' => '副标题', 'summary' => '简介', 'created_at' => '添加时间', 'created_by' => '作者', 'sort_num' => '排序', 'status' => '状态'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 24
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['id' => '标识', 'name' => '名称', 'description' => '描述'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 25
0
 public static function getAttributeLabels($attribute = null)
 {
     $items = ['cache' => '清空缓存', 'asset' => '清空Asset'];
     return ArrayHelper::getItems($items, $attribute);
 }
Exemplo n.º 26
0
 public function getFormView()
 {
     $items = [self::Form_Boolean => '_boolean', self::Form_Input => '_input', self::Form_Textarea => '_textarea', self::Form_RadioList => '_radiolist', self::Form_CheckboxList => '_checkboxlist'];
     return ArrayHelper::getItems($items, $this->form);
 }
Exemplo n.º 27
0
 public static function getRoleItems($role)
 {
     $model = self::find()->andWhere(['category' => $role])->all();
     return empty($model) ? [] : ArrayHelper::map($model, 'id', 'name');
 }