当前位置: 首页>>代码示例>>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;未经允许,请勿转载。