本文整理匯總了PHP中Admin\Builder\AdminListBuilder::buttonModalPopup方法的典型用法代碼示例。如果您正苦於以下問題:PHP AdminListBuilder::buttonModalPopup方法的具體用法?PHP AdminListBuilder::buttonModalPopup怎麽用?PHP AdminListBuilder::buttonModalPopup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Admin\Builder\AdminListBuilder
的用法示例。
在下文中一共展示了AdminListBuilder::buttonModalPopup方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildList
public function buildList($page = 1, $r = 20)
{
$map['status'] = array('egt', 0);
$list = M('Report')->where($map)->page($page, $r)->order('id asc')->select();
$reportCount = M('Report')->where($map)->count();
int_to_string($list);
$builder = new AdminListBuilder();
$builder->title("舉報處理列表");
$builder->buttonModalPopup(addons_url('Report://Admin/handleEject'), '', '批量處理', array('target-form' => 'ids'))->buttonDisable(addons_url('Report://Admin/ignoreReport'), '忽略處理')->buttonDelete(addons_url('Report://Admin/deleteReport'), '刪除舉報')->keyId()->keyLink('url', "舉報鏈接", '{$url}')->keyUid('uid', "舉報用戶的ID")->keyText('reason', "舉報原因")->keyText('content', "舉報描述")->keyText('type', "舉報類型")->keyCreateTime('create_time', "創建時間")->keyUpdateTime('handle_time', "處理時間")->keyText('handle_result', "處理結果")->keyDoActionModalPopup('Report://Admin/handleEject?ids=###|addons_url', '處理', '操作')->keyDoActionEdit('Report://Admin/ignoreReport?ids=###|addons_url', '忽略處理')->key('status', '狀態', 'status', array('0' => '未處理', '1' => '處理中', '2' => '已處理'));
$builder->data($list);
$builder->pagination($reportCount, $r);
$builder->display();
}
示例2: userList
public function userList($page = 1, $r = 20)
{
$aSearch1 = I('get.user_search1', '');
$aSearch2 = I('get.user_search2', 0, 'intval');
$map = array();
if (empty($aSearch1) && empty($aSearch2)) {
$aUserGroup = I('get.user_group', 0, 'intval');
$aRole = I('get.role', 0, 'intval');
if (!empty($aRole) || !empty($aUserGroup)) {
$uids = $this->getUids($aUserGroup, $aRole);
$map['uid'] = array('in', $uids);
}
$user = D('member')->where($map)->page($page, $r)->field('uid,nickname')->select();
foreach ($user as &$v) {
$v['id'] = $v['uid'];
}
unset($v);
$totalCount = D('member')->where($map)->count();
} else {
$uids = $this->getUids_sc($aSearch1, $aSearch2);
$map['uid'] = array('in', $uids);
$user = D('member')->where($map)->page($page, $r)->field('uid,nickname')->select();
foreach ($user as &$v) {
$v['id'] = $v['uid'];
}
unset($v);
$totalCount = D('member')->where($map)->count();
}
$r = 20;
$role = D('Role')->selectByMap(array('status' => 1));
$user_role = array(array('id' => 0, 'value' => L('_ALL_')));
foreach ($role as $key => $v) {
array_push($user_role, array('id' => $v['id'], 'value' => $v['title']));
}
$group = D('AuthGroup')->getGroups();
$user_group = array(array('id' => 0, 'value' => L('_ALL_')));
foreach ($group as $key => $v) {
array_push($user_group, array('id' => $v['id'], 'value' => $v['title']));
}
$builder = new AdminListBuilder();
$builder->title(L('_"MASS_USER_LIST"_'));
$builder->meta_title = L('_"MASS_USER_LIST"_');
$builder->setSelectPostUrl(U('Message/userList'))->setSearchPostUrl(U('Message/userList'))->select(L('_USER_GROUP:_'), 'user_group', 'select', L('_FILTER_ACCORDING_TO_USER_GROUP_'), '', '', $user_group)->select(L('_IDENTITY_'), 'role', 'select', L('_FILTER_ACCORDING_TO_USER_IDENTITY_'), '', '', $user_role)->search('', 'user_search1', '', L('_SEARCH_ACCORDING_TO_USERS_NICKNAME_'), '', '', '')->search('', 'user_search2', '', L('_SEARCH_ACCORDING_TO_USER_ID_'), '', '', '');
$builder->buttonModalPopup(U('Message/sendMessage'), array('user_group' => $aUserGroup, 'role' => $aRole), L('_SEND_A_MESSAGE_'), array('data-title' => L('_MASS_MESSAGE_'), 'target-form' => 'ids', 'can_null' => 'true'));
$builder->keyText('uid', '用戶ID')->keyText('nickname', L('_"NICKNAME"_'));
$builder->data($user);
$builder->pagination($totalCount, $r);
$builder->display();
}
示例3: userList
public function userList($page = 1, $r = 20)
{
$aUserGroup = I('get.user_group', 0, 'intval');
$aRole = I('get.role', 0, 'intval');
$map = array();
if (!empty($aRole) || !empty($aUserGroup)) {
$uids = $this->getUids($aUserGroup, $aRole);
$map['uid'] = array('in', $uids);
}
$user = D('member')->where($map)->page($page, $r)->field('uid,nickname')->select();
foreach ($user as &$v) {
$v['id'] = $v['uid'];
}
unset($v);
$totalCount = D('member')->where($map)->count();
$r = 20;
$role = D('Role')->selectByMap(array('status' => 1));
$user_role = array(array('id' => 0, 'value' => '全部'));
foreach ($role as $key => $v) {
array_push($user_role, array('id' => $v['id'], 'value' => $v['title']));
}
$group = D('AuthGroup')->getGroups();
$user_group = array(array('id' => 0, 'value' => '全部'));
foreach ($group as $key => $v) {
array_push($user_group, array('id' => $v['id'], 'value' => $v['title']));
}
$builder = new AdminListBuilder();
$builder->title("群發用戶列表");
$builder->meta_title = '群發用戶列表';
$builder->setSelectPostUrl(U('Message/userList'))->select('用戶組:', 'user_group', 'select', '根據用戶組篩選', '', '', $user_group)->select('身份:', 'role', 'select', '根據用戶身份篩選', '', '', $user_role);
$builder->buttonModalPopup(U('Message/sendMessage'), array('user_group' => $aUserGroup, 'role' => $aRole), '發送消息', array('data-title' => '群發消息', 'target-form' => 'ids', 'can_null' => 'true'));
$builder->keyText('uid', '用戶ID')->keyText('nickname', "昵稱");
$builder->data($user);
$builder->pagination($totalCount, $r);
$builder->display();
}
示例4: userList
public function userList($page = 1, $r = 20)
{
$aRoleId = I('role_id', 0, 'intval');
$aUserStatus = I('user_status', 0, 'intval');
$aSingleRole = I('single_role', 0, 'intval');
$role_list = $this->roleModel->field('id,title as value')->order('sort asc')->select();
$role_id_list = array_column($role_list, 'id');
if ($aRoleId && in_array($aRoleId, $role_id_list)) {
//篩選身份
$map_user_list['role_id'] = $aRoleId;
} else {
$map_user_list['role_id'] = $role_list[0]['id'];
}
if ($aUserStatus) {
//篩選狀態
$map_user_list['status'] = $aUserStatus == 3 ? 0 : $aUserStatus;
}
$user_ids = D('Member')->where(array('status' => -1))->field('uid')->select();
$user_ids = array_column($user_ids, 'uid');
if ($aSingleRole) {
//單身份篩選
$uids = $this->userRoleModel->group('uid')->field('uid')->having('count(uid)=1')->select();
$uids = array_column($uids, 'uid');
//單身份用戶id列表
if ($aSingleRole == 1) {
if (count($user_ids)) {
$map_user_list['uid'] = array('in', array_diff($uids, $user_ids));
} else {
$map_user_list['uid'] = array('in', $uids);
}
} else {
if (count($uids) && count($user_ids)) {
$map_user_list['uid'] = array('not in', array_merge($user_ids, $uids));
} else {
if (count($uids)) {
$map_user_list['uid'] = array('not in', $uids);
} else {
if (count($user_ids)) {
$map_user_list['uid'] = array('not in', $user_ids);
}
}
}
}
} else {
if (count($user_ids)) {
$map_user_list['uid'] = array('not in', $user_ids);
}
}
$user_list = $this->userRoleModel->where($map_user_list)->page($page, $r)->order('id desc')->select();
$totalCount = $this->userRoleModel->where($map_user_list)->count();
foreach ($user_list as &$val) {
$user = query_user(array('nickname', 'avatar64'), $val['uid']);
$val['nickname'] = $user['nickname'];
$val['avatar'] = $user['avatar64'];
}
unset($user, $val);
$statusOptions = array(0 => array('id' => 0, 'value' => L('_ALL_')), 1 => array('id' => 1, 'value' => L('_ENABLE_')), 2 => array('id' => 2, 'value' => L('_NOT_AUDITED_')), 3 => array('id' => 3, 'value' => L('_DISABLE_')));
$singleRoleOptions = array(0 => array('id' => 0, 'value' => L('_ALL_')), 1 => array('id' => 1, 'value' => L('_SINGLE_USER_')), 2 => array('id' => 2, 'value' => L('_NON_SINGLE_USER_')));
$builder = new AdminListBuilder();
$builder->title(L('_IDENTITY_USER_LIST_'))->setSelectPostUrl(U('Role/userList'));
if ($map_user_list['status'] == 2) {
$builder->setStatusUrl(U('Role/setUserAudit', array('role_id' => $map_user_list['role_id'])))->buttonEnable('', L('_AUDIT_THROUGH_'))->buttonDelete('', L('_AUDIT_FAILURE_'));
} else {
$builder->setStatusUrl(U('Role/setUserStatus', array('role_id' => $map_user_list['role_id'])))->buttonEnable()->buttonDisable();
}
$builder->buttonModalPopup(U('Role/changeRole', array('role_id' => $map_user_list['role_id'])), array(), L('_MIGRATING_USER_'), array('data-title' => L('_MIGRATING_USER_TO_ANOTHER_IDENTITY_'), 'target-form' => 'ids'))->button(L('_INITIALIZE_THE_USER_'), array('href' => U('Role/initUnhaveUser')))->select(L('_IDENTITY:_'), 'role_id', 'select', '', '', '', $role_list)->select(L('_STATUS:_'), 'user_status', 'select', '', '', '', $statusOptions)->select('', 'single_role', 'select', '', '', '', $singleRoleOptions)->keyId()->keyImage('avatar', L('_AVATAR_'))->keyLink('nickname', L('_NICKNAME_'), 'ucenter/index/information?uid={$uid}')->keyStatus()->pagination($totalCount, $r)->data($user_list)->display();
}
示例5: userList
public function userList($page = 1, $r = 20)
{
$aRoleId = I('role_id', 0, 'intval');
$aUserStatus = I('user_status', 0, 'intval');
$aSingleRole = I('single_role', 0, 'intval');
$role_list = $this->roleModel->field('id,title as value')->order('sort asc')->select();
$role_id_list = array_column($role_list, 'id');
if ($aRoleId && in_array($aRoleId, $role_id_list)) {
//篩選角色
$map_user_list['role_id'] = $aRoleId;
} else {
$map_user_list['role_id'] = $role_list[0]['id'];
}
if ($aUserStatus) {
//篩選狀態
$map_user_list['status'] = $aUserStatus == 3 ? 0 : $aUserStatus;
}
$user_ids = D('Member')->where(array('status' => -1))->field('uid')->select();
$user_ids = array_column($user_ids, 'uid');
if ($aSingleRole) {
//單角色篩選
$uids = $this->userRoleModel->group('uid')->field('uid')->having('count(uid)=1')->select();
$uids = array_column($uids, 'uid');
//單角色用戶id列表
if ($aSingleRole == 1) {
if (count($user_ids)) {
$map_user_list['uid'] = array('in', array_diff($uids, $user_ids));
} else {
$map_user_list['uid'] = array('in', $uids);
}
} else {
if (count($uids) && count($user_ids)) {
$map_user_list['uid'] = array('not in', array_merge($user_ids, $uids));
} else {
if (count($uids)) {
$map_user_list['uid'] = array('not in', $uids);
} else {
if (count($user_ids)) {
$map_user_list['uid'] = array('not in', $user_ids);
}
}
}
}
} else {
if (count($user_ids)) {
$map_user_list['uid'] = array('not in', $user_ids);
}
}
$user_list = $this->userRoleModel->where($map_user_list)->page($page, $r)->order('id desc')->select();
$totalCount = $this->userRoleModel->where($map_user_list)->count();
foreach ($user_list as &$val) {
$user = query_user(array('nickname', 'avatar64'), $val['uid']);
$val['nickname'] = $user['nickname'];
$val['avatar'] = $user['avatar64'];
}
unset($user, $val);
$statusOptions = array(0 => array('id' => 0, 'value' => '全部'), 1 => array('id' => 1, 'value' => '啟用'), 2 => array('id' => 2, 'value' => '未審核'), 3 => array('id' => 3, 'value' => '禁用'));
$singleRoleOptions = array(0 => array('id' => 0, 'value' => '全部'), 1 => array('id' => 1, 'value' => '單角色用戶'), 2 => array('id' => 2, 'value' => '非單角色用戶'));
$builder = new AdminListBuilder();
$builder->title('角色用戶列表')->setSelectPostUrl(U('Role/userList'));
if ($map_user_list['status'] == 2) {
$builder->setStatusUrl(U('Role/setUserAudit', array('role_id' => $map_user_list['role_id'])))->buttonEnable('', '審核通過')->buttonDelete('', '審核失敗');
} else {
$builder->setStatusUrl(U('Role/setUserStatus', array('role_id' => $map_user_list['role_id'])))->buttonEnable()->buttonDisable();
}
$builder->buttonModalPopup(U('Role/changeRole', array('role_id' => $map_user_list['role_id'])), array(), '遷移用戶', array('data-title' => '遷移用戶到其他角色', 'target-form' => 'ids'))->button('初始化沒角色的用戶', array('href' => U('Role/initUnhaveUser')))->select('角色:', 'role_id', 'select', '', '', '', $role_list)->select('狀態:', 'user_status', 'select', '', '', '', $statusOptions)->select('', 'single_role', 'select', '', '', '', $singleRoleOptions)->keyId()->keyImage('avatar', '頭像')->keyLink('nickname', '昵稱', 'ucenter/index/information?uid={$uid}')->keyStatus()->pagination($totalCount, $r)->data($user_list)->display();
}