當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AdminListBuilder::buttonNew方法代碼示例

本文整理匯總了PHP中Admin\Builder\AdminListBuilder::buttonNew方法的典型用法代碼示例。如果您正苦於以下問題:PHP AdminListBuilder::buttonNew方法的具體用法?PHP AdminListBuilder::buttonNew怎麽用?PHP AdminListBuilder::buttonNew使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Admin\Builder\AdminListBuilder的用法示例。


在下文中一共展示了AdminListBuilder::buttonNew方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: type

 public function type($page = 1, $r = 20)
 {
     $entity = I('entity', 0, 'intval');
     if ($entity != 0) {
         $map['entity'] = $entity;
     }
     $builder = new AdminListBuilder();
     $builder->title('商品分類管理');
     $list = D('Appstore/AppstoreType')->getList($map, $r, 'id desc');
     foreach ($list['data'] as &$v) {
         switch ($v['entity']) {
             case 1:
                 $v['entity_alias'] = '插件';
                 break;
             case 2:
                 $v['entity_alias'] = '模塊';
                 break;
             case 3:
                 $v['entity_alias'] = '模板';
                 break;
             case 4:
                 $v['entity_alias'] = '服務';
                 break;
         }
     }
     unset($v);
     $builder->keyId()->keyLink('title', '分類名稱', 'addType?id=###')->keyText('entity_alias', '分類所屬');
     $builder->setSelectPostUrl(U('type'))->select('', 'entity', 'select', '', '', '', array(array('id' => 0, 'value' => '全部'), array('id' => 1, 'value' => '插件'), array('id' => 2, 'value' => '模塊'), array('id' => 3, 'value' => '主題'), array('id' => 4, 'value' => '服務')));
     $builder->buttonNew(U('addType', array('entity' => $entity)), '新增');
     $builder->data($list[data]);
     $builder->display();
 }
開發者ID:chenyongze,項目名稱:bighaha,代碼行數:32,代碼來源:AppstoreController.class.php

示例2: index

 public function index($page = 1, $r = 20)
 {
     $map['status'] = array('egt', 0);
     list($roleList, $totalCount) = $this->roleModel->selectPageByMap($map, $page, $r, 'sort asc');
     $map_group['id'] = array('in', array_column($roleList, 'group_id'));
     $group = $this->roleGroupModel->where($map_group)->field('id,title')->select();
     $group = array_combine(array_column($group, 'id'), $group);
     $authGroupList = M('AuthGroup')->where(array('status' => 1))->field('id,title')->select();
     $authGroupList = array_combine(array_column($authGroupList, 'id'), array_column($authGroupList, 'title'));
     foreach ($roleList as &$val) {
         $user_groups = explode(',', $val['user_groups']);
         $val['group'] = $group[$val['group_id']]['title'];
         foreach ($user_groups as &$vl) {
             $vl = $authGroupList[$vl];
         }
         unset($vl);
         $val['user_groups'] = implode(',', $user_groups);
     }
     unset($val);
     $builder = new AdminListBuilder();
     $builder->meta_title = L('_IDENTITY_LIST_');
     $builder->title(L('_IDENTITY_LIST_'));
     $builder->buttonNew(U('Role/editRole'))->setStatusUrl(U('setStatus'))->buttonEnable()->buttonDisable()->button(L('_DELETE_'), array('class' => 'btn ajax-post confirm', 'url' => U('setStatus', array('status' => -1)), 'target-form' => 'ids', 'confirm-info' => "確認刪除身份?刪除後不可恢複!"))->buttonSort(U('sort'));
     $builder->keyId()->keyText('title', L('_ROLE_NAME_'))->keyText('name', L('_ROLE_MARK_'))->keyText('group', L('_GROUP_'))->keyText('description', L('_DESCRIPTION_'))->keyText('user_groups', L('_DEFAULT_USER_GROUP_'))->keytext('sort', L('_SORT_'))->keyYesNo('invite', L('_DO_YOU_NEED_AN_INVITATION_TO_REGISTER_'))->keyYesNo('audit', L('_REGISTRATION_WILL_NEED_TO_AUDIT_'))->keyStatus()->keyCreateTime()->keyUpdateTime()->keyDoActionEdit('Role/editRole?id=###')->keyDoAction('Role/configScore?id=###', L('_DEFAULT_INFORMATION_CONFIGURATION_'))->data($roleList)->pagination($totalCount, $r)->display();
 }
開發者ID:naliduo,項目名稱:Lightweight-social-platform,代碼行數:25,代碼來源:RoleController.class.php

示例3: index

 public function index($page = 1, $r = 20)
 {
     $map['status'] = array('egt', 0);
     list($roleList, $totalCount) = $this->roleModel->selectPageByMap($map, $page, $r, 'sort asc');
     $map_group['id'] = array('in', array_column($roleList, 'group_id'));
     $group = $this->roleGroupModel->where($map_group)->field('id,title')->select();
     $group = array_combine(array_column($group, 'id'), $group);
     $authGroupList = M('AuthGroup')->where(array('status' => 1))->field('id,title')->select();
     $authGroupList = array_combine(array_column($authGroupList, 'id'), array_column($authGroupList, 'title'));
     foreach ($roleList as &$val) {
         $user_groups = explode(',', $val['user_groups']);
         $val['group'] = $group[$val['group_id']]['title'];
         foreach ($user_groups as &$vl) {
             $vl = $authGroupList[$vl];
         }
         unset($vl);
         $val['user_groups'] = implode(',', $user_groups);
     }
     unset($val);
     $builder = new AdminListBuilder();
     $builder->meta_title = "角色列表";
     $builder->title("角色列表");
     $builder->buttonNew(U('Role/editRole'))->setStatusUrl(U('setStatus'))->buttonEnable()->buttonDisable()->button('刪除', array('class' => 'btn ajax-post confirm', 'url' => U('setStatus', array('status' => -1)), 'target-form' => 'ids', 'confirm-info' => "確認刪除角色?刪除後不可恢複!"))->buttonSort(U('sort'));
     $builder->keyId()->keyText('title', '角色名')->keyText('name', '角色標識')->keyText('group', '所屬分組')->keyText('description', '描述')->keyText('user_groups', '默認用戶組')->keytext('sort', '排序')->keyYesNo('invite', '是否需要邀請才能注冊')->keyYesNo('audit', '注冊後是否需要審核')->keyStatus()->keyCreateTime()->keyUpdateTime()->keyDoActionEdit('Role/editRole?id=###')->keyDoAction('Role/configScore?id=###', '默認信息配置')->data($roleList)->pagination($totalCount, $r)->display();
 }
開發者ID:qimeijun,項目名稱:OCenter,代碼行數:25,代碼來源:RoleController.class.php

示例4: buildList

 /**
  * 公告列表
  * @param int $page
  * @param int $r
  * @author 鄭鍾良<zzl@ourstu.com>
  */
 public function buildList($page = 1, $r = 20)
 {
     $map['status'] = 1;
     $aDown = I('down', 0, 'intval');
     $this->assign('down', $aDown);
     if ($aDown) {
         $map['end_time'] = array('elt', time());
     } else {
         $map['end_time'] = array('gt', time());
     }
     list($list, $totalCount) = $this->announcementModel->getListPage($map, $page, 'id desc', $r);
     $builder = new AdminListBuilder();
     $builder->title('公告列表');
     $builder->buttonNew(addons_url('Announcement://admin/edit'));
     $builder->setSelectPostUrl(addons_url('Announcement://admin/buildList'))->select('', 'down', 'select', '', '', '', array(array('id' => 0, 'value' => '當前公告'), array('id' => 1, 'value' => '曆史公告')));
     $builder->keyId()->keyTitle()->keyIcon()->keyText('link', '鏈接')->keyText('content', '內容')->keyCreateTime()->keyTime('end_time', '截止日期');
     $builder->keyDoActionEdit('Announcement://admin/edit?id=###|addons_url');
     if (!$aDown) {
         $builder->ajaxButton(addons_url('Announcement://admin/setEnd'), '', '設為到期')->keyDoAction('Announcement://admin/setEnd?ids=###|addons_url', '設為到期');
     }
     $builder->data($list)->pagination($totalCount, $r);
     $builder->display();
 }
開發者ID:chenyongze,項目名稱:bighaha,代碼行數:29,代碼來源:AdminController.class.php

示例5: field

 public function field($id, $page = 1, $r = 20)
 {
     $profile = D('field_group')->where('id=' . $id)->find();
     $map['status'] = array('egt', 0);
     $map['profile_group_id'] = $id;
     $field_list = D('field_setting')->where($map)->order("sort asc")->page($page, $r)->select();
     $totalCount = D('field_setting')->where($map)->count();
     $type_default = array('input' => L('_ONE-WAY_TEXT_BOX_'), 'radio' => L('_RADIO_BUTTON_'), 'checkbox' => L('_CHECKBOX_'), 'select' => L('_DROP-DOWN_BOX_'), 'time' => L('_DATE_'), 'textarea' => L('_MULTI_LINE_TEXT_BOX_'));
     $child_type = array('string' => L('_STRING_'), 'phone' => L('_PHONE_NUMBER_'), 'email' => L('_MAILBOX_'), 'number' => L('_NUMBER_'), 'join' => L('_RELATED_FIELD_'));
     foreach ($field_list as &$val) {
         $val['form_type'] = $type_default[$val['form_type']];
         $val['child_form_type'] = $child_type[$val['child_form_type']];
     }
     $builder = new AdminListBuilder();
     $builder->title('【' . $profile['profile_name'] . '】 字段管理');
     $builder->meta_title = $profile['profile_name'] . L('_FIELD_MANAGEMENT_');
     $builder->buttonNew(U('editFieldSetting', array('id' => '0', 'profile_group_id' => $id)))->buttonDelete(U('setFieldSettingStatus', array('status' => '-1')))->setStatusUrl(U('setFieldSettingStatus'))->buttonSort(U('sortField', array('id' => $id)))->button(L('_RETURN_'), array('href' => U('profile')));
     $builder->keyId()->keyText('field_name', L('_FIELD_NAME_'))->keyBool('visiable', L('_OPEN_YE_OR_NO_'))->keyBool('required', L('_WHETHER_THE_REQUIRED_'))->keyText('sort', L('_SORT_'))->keyText('form_type', L('_FORM_TYPE_'))->keyText('child_form_type', L('_TWO_FORM_TYPE_'))->keyText('form_default_value', L('_DEFAULT_'))->keyText('validation', L('_FORM_VERIFICATION_MODE_'))->keyText('input_tips', L('_USER_INPUT_PROMPT_'));
     $builder->keyTime("createTime", L('_CREATE_TIME_'))->keyStatus()->keyDoAction('User/editFieldSetting?profile_group_id=' . $id . '&id=###', L('_EDIT_'));
     $builder->data($field_list);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
開發者ID:naliduo,項目名稱:Lightweight-social-platform,代碼行數:23,代碼來源:UserController.class.php

示例6: field

 public function field($id, $page = 1, $r = 20)
 {
     $profile = D('field_group')->where('id=' . $id)->find();
     $map['status'] = array('egt', 0);
     $map['profile_group_id'] = $id;
     $field_list = D('field_setting')->where($map)->order("sort asc")->page($page, $r)->select();
     $totalCount = D('field_setting')->where($map)->count();
     $type_default = array('input' => '單行文本框', 'radio' => '單選按鈕', 'checkbox' => '多選框', 'select' => '下拉選擇框', 'time' => '日期', 'textarea' => '多行文本框');
     $child_type = array('string' => '字符串', 'phone' => '手機號碼', 'email' => '郵箱', 'number' => '數字', 'join' => '關聯字段');
     foreach ($field_list as &$val) {
         $val['form_type'] = $type_default[$val['form_type']];
         $val['child_form_type'] = $child_type[$val['child_form_type']];
     }
     $builder = new AdminListBuilder();
     $builder->title('【' . $profile['profile_name'] . '】 字段管理');
     $builder->meta_title = $profile['profile_name'] . '字段管理';
     $builder->buttonNew(U('editFieldSetting', array('id' => '0', 'profile_group_id' => $id)))->buttonDelete(U('setFieldSettingStatus', array('status' => '-1')))->setStatusUrl(U('setFieldSettingStatus'))->buttonSort(U('sortField', array('id' => $id)))->button('返回', array('href' => U('profile')));
     $builder->keyId()->keyText('field_name', "字段名稱")->keyBool('visiable', '是否公開')->keyBool('required', '是否必填')->keyText('sort', "排序")->keyText('form_type', '表單類型')->keyText('child_form_type', '二級表單類型')->keyText('form_default_value', '默認值')->keyText('validation', '表單驗證方式')->keyText('input_tips', '用戶輸入提示');
     $builder->keyTime("createTime", "創建時間")->keyStatus()->keyDoAction('User/editFieldSetting?profile_group_id=' . $id . '&id=###', '編輯');
     $builder->data($field_list);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
開發者ID:ccccy,項目名稱:wuanlife,代碼行數:23,代碼來源:UserController.class.php

示例7: adv

 public function adv($r = 20)
 {
     $aPosId = I('pos_id', 0, 'intval');
     $advPosModel = D('Common/AdvPos');
     $pos = $advPosModel->find($aPosId);
     if ($aPosId != 0) {
         $map['pos_id'] = $aPosId;
     }
     $map['status'] = 1;
     $data = D('Adv')->where($map)->order('pos_id desc,sort desc')->findPage($r);
     foreach ($data['data'] as &$v) {
         $p = $advPosModel->find($v['pos_id']);
         $v['pos'] = '<a class="text-danger" href="' . U('adv?pos_id=' . $p['pos_id']) . '">' . $p['title'] . '</a>';
     }
     //todo 廣告管理列表
     $builder = new AdminListBuilder();
     if ($aPosId == 0) {
         $builder->title('廣告管理');
     } else {
         $builder->title($pos['title'] . '【' . $pos['name'] . '】' . ' 設置——' . $advPosModel->switchType($pos['type']));
     }
     $builder->keyId()->keyLink('title', '廣告說明', 'editAdv?id=###');
     $builder->keyHtml('pos', '所屬廣告位');
     $builder->keyText('click_count', '點擊量');
     $builder->buttonNew(U('editAdv?pos_id=' . $aPosId), '新增廣告');
     if ($aPosId != 0) {
         $builder->button('廣告排期查看', array('href' => U('schedule?pos_id=' . $aPosId)));
         $builder->button('設置廣告位', array('href' => U('editPos?id=' . $aPosId)));
     }
     $builder->keyText('url', '鏈接地址')->keyTime('start_time', '開始生效時間', '不設置則立即生效')->keyTime('end_time', '失效時間', '不設置則一直有效')->keyText('sort', '排序')->keyCreateTime()->keyStatus();
     $builder->data($data['data']);
     $builder->pagination($data['count'], $r);
     $builder->display();
 }
開發者ID:naliduo,項目名稱:Lightweight-social-platform,代碼行數:34,代碼來源:AdvController.class.php

示例8: entity

 /**
  * 實體頁麵
  */
 public function entity($page = 1, $r = 20)
 {
     $data = M('cat_entity')->where('status>-1')->page($page, $r)->order('sort desc')->select();
     $totalCount = M('cat_entity')->where('status>-1')->count();
     foreach ($data as &$v) {
         $v['fields'] = '字段管理';
     }
     unset($v);
     $listBuilder = new AdminListBuilder();
     $listBuilder->title('模型管理')->keyId()->keyLink('name', '模型英文名', 'info?entity_id=###')->keyLink('alias', '模型中文名', 'info?entity_id=###')->keyLink('fields', '字段管理', 'field?entity_id=###')->keyStatus()->keyText('sort', '排序')->keyDoActionEdit('editEntity?entity_id=###')->data($data)->pagination($totalCount, $r);
     $listBuilder->buttonNew(U('editentity'))->buttonDelete(U('dodelentity'));
     $listBuilder->display();
 }
開發者ID:terrydeng,項目名稱:beimeibang1205,代碼行數:16,代碼來源:CatController.class.php

示例9: cbd

 public function cbd($pid = 0, $upid = 0, $city = 0, $level = 0)
 {
     $pid = intval($pid);
     $builder = new AdminListBuilder();
     if ($level == 2) {
         $builder->title('樓盤列表');
     } else {
         $builder->title('商圈列表');
     }
     //取出省
     if ($pid == 0 && $upid == 0) {
         $map = array('level' => 1);
         $href = 'cbd?upid=###';
         $list = D('district')->where($map)->field('id,name')->select();
     } elseif ($pid == 0) {
         // 取出市
         $map = array('upid' => $upid);
         $href = 'cbd?pid=###&city=###';
         $list = D('district')->where($map)->field('id,name')->select();
     } elseif ($level < 2) {
         //取出市以下,展示區和cbd
         $map = array('pid' => $pid);
         //添加新增按鈕
         $level = D('cbd')->where(array('id' => $pid))->getField('level');
         $level = $level + 1;
         //level指當前數據的level
         $builder->buttonNew(U('CBDEdit', array('pid' => $pid, 'city' => $city, 'level' => $level)));
         $href = 'cbd?pid=###&level=' . $level . '&city=' . $city;
         $list = D('cbd')->where($map)->field('id,name')->select();
     } elseif ($level == 2) {
         //此處要添加具體樓盤
         $map = array('pid' => $pid);
         //添加樓盤按鈕
         $builder->buttonNew(U('PropertyEdit', array('pid' => $pid, 'city' => $city)));
         $href = 'propertyEdit?id=###';
         $list = D('property')->where($map)->field('id,name')->select();
     }
     $builder->setStatusUrl(U('setCBDStatus'))->keyId()->keyLink('name', '區域', $href);
     $builder->data($list);
     $builder->display();
 }
開發者ID:smartymoon,項目名稱:e-anjia,代碼行數:41,代碼來源:HomeController.class.php

示例10: goodsList

 public function goodsList($page = 1, $r = 20)
 {
     $map['status'] = array('egt', 0);
     $goodsList = $this->shopModel->where($map)->order('createtime desc')->page($page, $r)->select();
     $totalCount = $this->shopModel->where($map)->count();
     $builder = new AdminListBuilder();
     $builder->title('商品列表');
     $builder->meta_title = '商品列表';
     foreach ($goodsList as &$val) {
         $category = $this->shop_categoryModel->where('id=' . $val['category_id'])->getField('title');
         $val['category'] = $category;
         unset($category);
         $val['is_new'] = $val['is_new'] == 0 ? '否' : '是';
     }
     unset($val);
     $builder->buttonNew(U('Shop/goodsEdit'))->buttonDelete(U('setGoodsStatus'))->setStatusUrl(U('setGoodsStatus'));
     $builder->keyId()->keyText('goods_name', '商品名稱')->keyText('category', '商品分類')->keyText('goods_introduct', '商品廣告語')->keyText('money_need', '商品價格')->keyText('goods_num', '商品餘量')->keyText('sell_num', '已售出量')->keyLink('is_new', '是否為新品', 'Shop/setNew?id=###')->keyStatus('status', '出售狀態')->keyUpdateTime('changetime')->keyCreateTime('createtime')->keyDoActionEdit('Shop/goodsEdit?id=###');
     $builder->data($goodsList);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
開發者ID:chenyongze,項目名稱:bighaha,代碼行數:21,代碼來源:ShopController.class.php


注:本文中的Admin\Builder\AdminListBuilder::buttonNew方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。