当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminConfigBuilder::keyCheckBox方法代码示例

本文整理汇总了PHP中Admin\Builder\AdminConfigBuilder::keyCheckBox方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminConfigBuilder::keyCheckBox方法的具体用法?PHP AdminConfigBuilder::keyCheckBox怎么用?PHP AdminConfigBuilder::keyCheckBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Admin\Builder\AdminConfigBuilder的用法示例。


在下文中一共展示了AdminConfigBuilder::keyCheckBox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: expandinfo_details

 public function expandinfo_details($uid = 0)
 {
     if (IS_POST) {
         /* 修改积分 xjw129xjt(肖骏涛)*/
         $data = I('post.');
         foreach ($data as $key => $val) {
             if (substr($key, 0, 5) == 'score') {
                 $data_score[$key] = $val;
             }
         }
         unset($key, $val);
         $res = D('Member')->where(array('uid' => $data['id']))->save($data_score);
         foreach ($data_score as $key => $val) {
             $value = query_user(array($key), $data['id']);
             if ($val == $value[$key]) {
                 continue;
             }
             D('Ucenter/Score')->addScoreLog($data['id'], cut_str('score', $key, 'l'), 'to', $val, '', 0, get_nickname(is_login()) . L('_BACKGROUND_ADJUSTMENT_'));
             D('Ucenter/Score')->cleanUserCache($data['id'], cut_str('score', $key, 'l'));
         }
         unset($key, $val);
         /* 修改积分 end*/
         /*身份设置 zzl(郑钟良)*/
         $data_role = array();
         foreach ($data as $key => $val) {
             if ($key == 'role') {
                 $data_role = explode(',', $val);
             } else {
                 if (substr($key, 0, 4) == 'role') {
                     $data_role[] = $val;
                 }
             }
         }
         unset($key, $val);
         $this->_resetUserRole($uid, $data_role);
         $this->success(L('_SUCCESS_OPERATE_') . L('_EXCLAMATION_'));
         /*身份设置 end*/
     } else {
         $map['uid'] = $uid;
         $map['status'] = array('egt', 0);
         $member = M('Member')->where($map)->find();
         $member['id'] = $member['uid'];
         $member['username'] = query_user('username', $uid);
         //扩展信息查询
         $map_profile['status'] = 1;
         $field_group = D('field_group')->where($map_profile)->select();
         $field_group_ids = array_column($field_group, 'id');
         $map_profile['profile_group_id'] = array('in', $field_group_ids);
         $fields_list = D('field_setting')->where($map_profile)->getField('id,field_name,form_type');
         $fields_list = array_combine(array_column($fields_list, 'field_name'), $fields_list);
         $map_field['uid'] = $member['uid'];
         foreach ($fields_list as $key => $val) {
             $map_field['field_id'] = $val['id'];
             $field_data = D('field')->where($map_field)->getField('field_data');
             if ($field_data == null || $field_data == '') {
                 $member[$key] = '';
             } else {
                 $member[$key] = $field_data;
             }
             $member[$key] = $field_data;
         }
         $builder = new AdminConfigBuilder();
         $builder->title(L('_USER_EXPAND_INFO_DETAIL_'));
         $builder->meta_title = L('_USER_EXPAND_INFO_DETAIL_');
         $builder->keyId()->keyReadOnly('username', L('_USER_NAME_'))->keyReadOnly('nickname', L('_NICKNAME_'));
         $field_key = array('id', 'username', 'nickname');
         foreach ($fields_list as $vt) {
             $field_key[] = $vt['field_name'];
             $builder->keyReadOnly($vt['field_name'], $vt['field_name']);
         }
         /* 积分设置 xjw129xjt(肖骏涛)*/
         $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
         $score_key = array();
         foreach ($field as $vf) {
             $score_key[] = 'score' . $vf['id'];
             $builder->keyText('score' . $vf['id'], $vf['title']);
         }
         $score_data = D('Member')->where(array('uid' => $uid))->field(implode(',', $score_key))->find();
         $member = array_merge($member, $score_data);
         /*积分设置end*/
         $builder->data($member);
         /*身份设置 zzl(郑钟良)*/
         $already_role = D('UserRole')->where(array('uid' => $uid, 'status' => 1))->field('role_id')->select();
         if (count($already_role)) {
             $already_role = array_column($already_role, 'role_id');
         }
         $roleModel = D('Role');
         $role_key = array();
         $no_group_role = $roleModel->where(array('group_id' => 0, 'status' => 1))->select();
         if (count($no_group_role)) {
             $role_key[] = 'role';
             $no_group_role_options = $already_no_group_role = array();
             foreach ($no_group_role as $val) {
                 if (in_array($val['id'], $already_role)) {
                     $already_no_group_role[] = $val['id'];
                 }
                 $no_group_role_options[$val['id']] = $val['title'];
             }
             $builder->keyCheckBox('role', L('_ROLE_GROUP_NONE_'), L('_MULTI_OPTIONS_'), $no_group_role_options)->keyDefault('role', implode(',', $already_no_group_role));
         }
//.........这里部分代码省略.........
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:101,代码来源:UserController.class.php

示例2: expandinfo_details

 public function expandinfo_details($uid = 0)
 {
     if (IS_POST) {
         /* 修改积分 xjw129xjt(肖骏涛)*/
         $data = I('post.');
         foreach ($data as $key => $val) {
             if (substr($key, 0, 5) == 'score') {
                 $data_score[$key] = $val;
             }
         }
         unset($key, $val);
         $res = D('Member')->where(array('uid' => $data['id']))->save($data_score);
         foreach ($data_score as $key => $val) {
             $value = query_user(array($key), $data['id']);
             if ($val == $value[$key]) {
                 continue;
             }
             D('Ucenter/Score')->addScoreLog($data['id'], cut_str('score', $key, 'l'), 'to', $val, '', 0, get_nickname(is_login()) . '后台调整');
             D('Ucenter/Score')->cleanUserCache($data['id'], cut_str('score', $key, 'l'));
         }
         unset($key, $val);
         /* 修改积分 end*/
         /*身份设置 zzl(郑钟良)*/
         $data_role = array();
         foreach ($data as $key => $val) {
             if ($key == 'role') {
                 $data_role = explode(',', $val);
             } else {
                 if (substr($key, 0, 4) == 'role') {
                     $data_role[] = $val;
                 }
             }
         }
         unset($key, $val);
         $this->_resetUserRole($uid, $data_role);
         $this->success('操作成功!');
         /*身份设置 end*/
     } else {
         $map['uid'] = $uid;
         $map['status'] = array('egt', 0);
         $member = M('Member')->where($map)->find();
         $member['id'] = $member['uid'];
         $member['username'] = query_user('username', $uid);
         //扩展信息查询
         $map_profile['status'] = 1;
         $field_group = D('field_group')->where($map_profile)->select();
         $field_group_ids = array_column($field_group, 'id');
         $map_profile['profile_group_id'] = array('in', $field_group_ids);
         $fields_list = D('field_setting')->where($map_profile)->getField('id,field_name,form_type');
         $fields_list = array_combine(array_column($fields_list, 'field_name'), $fields_list);
         $map_field['uid'] = $member['uid'];
         foreach ($fields_list as $key => $val) {
             $map_field['field_id'] = $val['id'];
             $field_data = D('field')->where($map_field)->getField('field_data');
             if ($field_data == null || $field_data == '') {
                 $member[$key] = '';
             } else {
                 $member[$key] = $field_data;
             }
             $member[$key] = $field_data;
         }
         $builder = new AdminConfigBuilder();
         $builder->title("用户扩展资料详情");
         $builder->meta_title = '用户扩展资料详情';
         $builder->keyId()->keyReadOnly('username', "用户名称")->keyReadOnly('nickname', '昵称');
         $field_key = array('id', 'username', 'nickname');
         foreach ($fields_list as $vt) {
             $field_key[] = $vt['field_name'];
             $builder->keyReadOnly($vt['field_name'], $vt['field_name']);
         }
         /* 积分设置 xjw129xjt(肖骏涛)*/
         $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
         $score_key = array();
         foreach ($field as $vf) {
             $score_key[] = 'score' . $vf['id'];
             $builder->keyText('score' . $vf['id'], $vf['title']);
         }
         $score_data = D('Member')->where(array('uid' => $uid))->field(implode(',', $score_key))->find();
         $member = array_merge($member, $score_data);
         /*积分设置end*/
         $builder->data($member);
         /*身份设置 zzl(郑钟良)*/
         $already_role = D('UserRole')->where(array('uid' => $uid, 'status' => 1))->field('role_id')->select();
         if (count($already_role)) {
             $already_role = array_column($already_role, 'role_id');
         }
         $roleModel = D('Role');
         $role_key = array();
         $no_group_role = $roleModel->where(array('group_id' => 0, 'status' => 1))->select();
         if (count($no_group_role)) {
             $role_key[] = 'role';
             $no_group_role_options = $already_no_group_role = array();
             foreach ($no_group_role as $val) {
                 if (in_array($val['id'], $already_role)) {
                     $already_no_group_role[] = $val['id'];
                 }
                 $no_group_role_options[$val['id']] = $val['title'];
             }
             $builder->keyCheckBox('role', '无分组身份', '可以多选', $no_group_role_options)->keyDefault('role', implode(',', $already_no_group_role));
         }
//.........这里部分代码省略.........
开发者ID:ccccy,项目名称:wuanlife,代码行数:101,代码来源:UserController.class.php


注:本文中的Admin\Builder\AdminConfigBuilder::keyCheckBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。