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


PHP AdminListBuilder::button方法代碼示例

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


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

示例1: scoreLog

 public function scoreLog($r = 20, $p = 1)
 {
     if (I('type') == 'clear') {
         D('ScoreLog')->where(array('id>0'))->delete();
         $this->success('清空成功。', U('scoreLog'));
         exit;
     } else {
         $aUid = I('uid', 0, '');
         if ($aUid) {
             $map['uid'] = $aUid;
         }
         $listBuilder = new AdminListBuilder();
         $listBuilder->title('積分日誌');
         $map['status'] = array('gt', -1);
         $scoreLog = D('ScoreLog')->where($map)->order('create_time desc')->findPage($r);
         $scoreTypes = D('Ucenter/Score')->getTypeListByIndex();
         foreach ($scoreLog['data'] as &$v) {
             $v['adjustType'] = $v['action'] == 'inc' ? '增加' : '減少';
             $v['scoreType'] = $scoreTypes[$v['type']]['title'];
             $class = $v['action'] == 'inc' ? 'text-success' : 'text-danger';
             $v['value'] = '<span class="' . $class . '">' . ($v['action'] == 'inc' ? '+' : '-') . $v['value'] . $scoreTypes[$v['type']]['unit'] . '</span>';
             $v['finally_value'] = $v['finally_value'] . $scoreTypes[$v['type']]['unit'];
         }
         $listBuilder->data($scoreLog['data']);
         $listBuilder->keyId()->keyUid('uid', '用戶')->keyText('scoreType', '積分類型')->keyText('adjustType', '調整類型')->keyHtml('value', '積分變動')->keyText('finally_value', '積分最終值')->keyText('remark', '變動描述')->keyCreateTime();
         $listBuilder->pagination($scoreLog['count'], $r);
         $listBuilder->search(L('_SEARCH_'), 'uid', 'text', '輸入UID');
         $listBuilder->button('清空日誌', array('url' => U('scoreLog', array('type' => 'clear')), 'class' => 'btn ajax-get confirm'));
         $listBuilder->display();
     }
 }
開發者ID:naliduo,項目名稱:Lightweight-social-platform,代碼行數:31,代碼來源:ActionController.class.php

示例2: lists

 public function lists()
 {
     $listBuilder = new AdminListBuilder();
     /*刷新模塊列表時清空緩存*/
     $aRefresh = I('get.refresh', 0, 'intval');
     if ($aRefresh) {
         S('module_all', null);
     }
     /*刷新模塊列表時清空緩存 end*/
     $modules = $this->moduleModel->getAll();
     foreach ($modules as &$m) {
         $m['alias'] = '<i class="icon-' . $m['icon'] . '"></i> ' . $m['alias'];
         if ($m['is_setup']) {
             $m['name'] = '<i class="icon-ok" style="color: green;"></i> ' . $m['name'];
             if ($m['can_uninstall']) {
                 $m['do'] = '<a class="btn btn-error "  onclick="moduleManager.uninstall(\'' . $m['id'] . '\')"><span style="color: red;" ><i class="icon-cut"></i></span> 卸載</a>';
             }
         } else {
             $m['name'] = '<i class="icon-remove" style="color: red;"></i> ' . $m['name'];
             $m['do'] = '<a class="btn" onclick="moduleManager.install(\'' . $m['id'] . '\')"><span style="color: green;"<i class="icon-check"></i></span> 安裝</a>';
         }
         if ($m['is_com']) {
             $m['is_com'] = '<strong style="color: orange">商業模塊</strong>';
         } else {
             $m['is_com'] = '<strong style="color: green">免費模塊</strong>';
         }
     }
     unset($m);
     $listBuilder->data($modules);
     $listBuilder->title('模塊管理');
     $listBuilder->button('刷新', array('href' => U('Admin/Module/lists', array('refresh' => 1))));
     $listBuilder->keyId()->keyHtml('alias', '模塊名')->keyText('name', '模塊英文名')->keyText('summary', '模塊介紹')->keyText('version', '版本號')->keyText('is_com', '商業模塊')->keyLink('developer', '開發者', '{$website}')->keyText('entry', '前台入口')->keyText('admin_entry', '後台入口')->keyText('do', '操作');
     $listBuilder->display();
 }
開發者ID:fishling,項目名稱:chatPro,代碼行數:34,代碼來源:ModuleController.class.php

示例3: lists

 public function lists()
 {
     $listBuilder = new AdminListBuilder();
     /*刷新模塊列表時清空緩存*/
     $aRefresh = I('get.refresh', 0, 'intval');
     if ($aRefresh == 1) {
         D('Module')->reload();
     } else {
         if ($aRefresh == 2) {
             D('Module')->cleanModulesCache();
         }
     }
     /*刷新模塊列表時清空緩存 end*/
     $modules = $this->moduleModel->getAll();
     foreach ($modules as &$m) {
         $m['alias'] = '<a href="' . U('edit?', array('name' => $m['name'])) . '"><i class="icon-' . $m['icon'] . '"></i> ' . $m['alias'] . '</a>';
         if ($m['is_setup']) {
             $m['name'] = '<i class="icon-ok" style="color: green;"></i> ' . $m['name'];
             if ($m['can_uninstall'] == 1) {
                 $m['do'] = '<a class="btn btn-error "  href="' . U('uninstall', array('id' => $m['id'])) . '"><span style="color: red;" ><i class="icon-cut"></i></span> 卸載</a>';
             } else {
                 $m['do'] = '係統模塊';
             }
         } else {
             $m['do'] = '<a class="btn" href="' . U('install', array('name' => $m['name'])) . '"><span style="color: green;"<i class="icon-check"></i></span> 安裝</a>';
             $m['name'] = '<i class="icon-remove" style="color: red;"></i> ' . $m['name'];
             // $m['do'] = '<a class="btn" onclick="moduleManager.install(\'' . $m['id'] . '\')"><span style="color: green;"<i class="icon-check"></i></span> 安裝</a>';
         }
     }
     unset($m);
     $listBuilder->data($modules);
     $listBuilder->title('模塊管理');
     $listBuilder->button('刷新(讀入新的模塊)', array('href' => U('Admin/Module/lists', array('refresh' => 2))));
     $listBuilder->button('重置(根據預設模塊信息重置)', array('href' => U('Admin/Module/lists', array('refresh' => 1))));
     $listBuilder->keyId()->keyHtml('alias', '模塊名')->keyText('name', '模塊英文名')->keyText('summary', '模塊介紹')->keyText('version', '版本號')->keyLink('developer', '開發者', '{$website}')->keyText('entry', '前台入口')->keyText('admin_entry', '後台入口')->keyHtml('do', '操作');
     $listBuilder->display();
 }
開發者ID:chenyongze,項目名稱:bighaha,代碼行數:37,代碼來源:ModuleController.class.php

示例4: 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

示例5: sections

 /**
  * 章節列表
  * @author 鄭鍾良<zzl@ourstu.com>
  */
 public function sections()
 {
     $aBookId = I('get.book_id', 0, 'intval');
     $aSectionId = I('get.id', 0, 'intval');
     if ($aBookId) {
         $book = $this->bookModel->getData($aBookId);
         if (!$book) {
             $this->error(L('_THE_TUTORIAL_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED_WITH_EXCLAMATION_'));
         }
         $title = $book['title'];
         $map['status'] = array('neq', -1);
         $map['book_id'] = $aBookId;
         $map['pid'] = 0;
         $list = $this->bookSectionModel->getlist($map);
     } elseif ($aSectionId) {
         $section = $this->bookSectionModel->getData($aSectionId);
         if (!$section) {
             $this->error(L('_THE_SECTION_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED_WITH_EXCLAMATION_'));
         }
         $title = '';
         $title = $this->bookSectionModel->getTitle($aSectionId, $title);
         $map['status'] = array('neq', -1);
         $map['book_id'] = $section['book_id'];
         $map['pid'] = $aSectionId;
         $list = $this->bookSectionModel->getlist($map);
     } else {
         $this->error(L('_PLEASE_CHOOSE_A_CHAPTER_OR_TUTORIAL_WITH_EXCLAMATION_'));
     }
     foreach ($list as &$val) {
         if (!$val['type']) {
             $val['sections_link'] = '<a href="' . U('Book/sections', array('id' => $val['id'])) . '">章節</a>&nbsp;&nbsp;<a href="' . U('Book/editSections', array('id' => $val['id'])) . '">編輯章節</a>';
             $val['type_title'] = L('_CHAPTER_');
         } else {
             $val['type_title'] = L('_ARTICLE_');
         }
         if (!$val['is_show']) {
             $val['is_show'] = L('_DRAFT_');
         } else {
             $val['is_show'] = L('_NORMAL_');
         }
     }
     unset($val);
     $builder = new AdminListBuilder();
     $builder->title(op_t($title))->data($list);
     if ($aBookId) {
         $builder->button(L('_EDIT_THIS_LAYER_SECTION_'), array('href' => U('Book/editSections', array('book_id' => $aBookId))));
     } else {
         $builder->button(L('_EDIT_THIS_LAYER_SECTION_'), array('href' => U('Book/editSections', array('id' => $aSectionId))));
     }
     $builder->setStatusUrl(U('Book/setSectionStatus'))->buttonEnable()->buttonDisable()->buttonDelete()->ajaxButton(U('Book/changeSectionType'), array('type' => 1), L('_TURN_TO_THE_ARTICLE_TYPE_'))->ajaxButton(U('Book/changeSectionType'), array('type' => 0), L('_TURN_TO_CHAPTER_TYPE_'))->buttonSort(U('Book/sortSections', array('pid' => $map['pid'], 'book_id' => $map['book_id'])), L('_SORT_'))->keyId()->keyText('type_title', L('_TYPE_'))->keyLink('title', L('_TITLE_'), 'Book/Index/read?section_id=###')->keyText('sections_link', L('_SECTION_OPERATION_'))->keyDoActionEdit('Book/editSection?id=###')->keyDoAction('Book/copySection?id=###', L('_COPY_'))->keyBool('open_child', L('_START_SUB_CHAPTER_'))->keyText('keywords', L('_KEY_WORDS_'))->keyText('is_show', L('_DRAFT_NORMAL_WITH_SLASH_'))->keyUid()->keyStatus()->keyCreateTime()->display();
 }
開發者ID:sunjie20081001,項目名稱:sns,代碼行數:55,代碼來源:BookController.class.php


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