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


PHP AdminListBuilder::buttonEnable方法代码示例

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


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

示例1: pos

 public function pos($page = 1, $r = 20)
 {
     $aModule = I('module', '', 'text');
     $aTheme = I('theme', 'all', 'text');
     $aStatus = I('status', 1, 'intval');
     $_GET['status'] = $aStatus;
     if ($aModule == '') {
         $this->posModule();
         return;
     }
     $adminList = new AdminListBuilder();
     $map['path'] = array('like', ucfirst($aModule . '/%'));
     $map['status'] = $aStatus;
     if ($aTheme == 'all' || $aTheme == '') {
     } else {
         $map['theme'] = array('like', array("%,{$aTheme}", "%,{$aTheme},%", "{$aTheme},%"));
     }
     $advPosModel = D('AdvPos');
     $advModel = D('Adv');
     $advPoses = $advPosModel->where($map)->select();
     $themes = D('Common/Theme')->getThemeList();
     foreach ($advPoses as &$v) {
         switch ($v['type']) {
             case 1:
                 $v['type_html'] = '<span class="text-danger">单图</span>';
                 break;
             case 2:
                 $v['type_html'] = '<span class="text-warning">多图轮播</span>';
                 break;
             case 3:
                 $v['type_html'] = '<span class="text-success">文字链接</span>';
                 break;
             case 4:
                 $v['type_html'] = '<span class="text-error">代码块</span>';
                 break;
         }
         if ($v['theme'] != 'all') {
             $theme_names = explode(',', $v['theme']);
             foreach ($theme_names as $t) {
                 $temp_theme[] = $themes[$t]['title'];
             }
             $v['theme_html'] = implode('&nbsp;&nbsp;,&nbsp;&nbsp;', $temp_theme);
             //implode(',',array_map(array($this,'getValue'),$themes,$v['theme']));//   $themes[$v['theme']]['title'];
         } else {
             $v['theme_html'] = '全部主题';
         }
         $count = $advModel->where(array('pos_id' => $v['id'], 'status' => 1))->count();
         $v['do'] = '<a href="' . U('editPos?copy=' . $v['id']) . '"><i class="icon-copy"></i> 复制</a>&nbsp;&nbsp;&nbsp;&nbsp;' . '<a href="' . U('editPos?id=' . $v['id']) . '"><i class="icon-cog"></i> 设置</a>&nbsp;&nbsp;&nbsp;&nbsp;' . '<a href="' . U('adv?pos_id=' . $v['id']) . '" ><i class="icon-sitemap"></i> 管理广告(' . $count . ')</a>&nbsp;&nbsp;&nbsp;&nbsp;' . '<a href="' . U('editAdv?pos_id=' . $v['id']) . '"><i class="icon-plus"></i> 添加广告</a>&nbsp;&nbsp;&nbsp;&nbsp;' . '<a href="' . U($v['path']) . '#adv_' . $v['id'] . '" target="_blank"><i class="icon-share-alt"></i>到前台查看</a>&nbsp;&nbsp;';
     }
     unset($v);
     $adminList->title('广告位管理');
     $adminList->buttonNew(U('editPos'), '添加广告位');
     $adminList->buttonDelete(U('setPosStatus'));
     $adminList->buttonDisable(U('setPosStatus'));
     $adminList->buttonEnable(U('setPosStatus'));
     $adminList->keyId()->keyTitle()->keyHtml('do', '操作', '320px')->keyText('name', '广告位英文名')->keyText('path', '路径')->keyHtml('type_html', '广告类型')->keyStatus()->keyText('width', '宽度')->keyText('height', '高度')->keyText('margin', '边缘留白')->keyText('padding', '内部留白')->keyText('theme_html', '适用主题');
     $themes_array[] = array('id' => 'all', 'value' => '--全部主题--');
     foreach ($themes as $v) {
         $themes_array[] = array('id' => $v['name'], 'value' => $v['title']);
     }
     $status_array = array(array('id' => 1, 'value' => '正常'), array('id' => 0, 'value' => '禁用'), array('id' => -1, 'value' => '已删除'));
     $adminList->select('所属主题:', 'theme', 'select', '描述', '', '', $themes_array);
     $adminList->select('状态:', 'status', 'select', '广告位状态', '', '', $status_array);
     $adminList->data($advPoses);
     $adminList->display();
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:66,代码来源:AdvController.class.php

示例2: index

 public function index($page = 1, $r = 20)
 {
     $aStatus = I('get.status', 0, 'intval');
     if ($aStatus == 0) {
         $map['status'] = 1;
     } elseif ($aStatus == 1) {
         $map['status'] = 2;
     } else {
         $map['status'] = 0;
     }
     list($list, $totalCount) = $this->questionModel->getListPageByMap($map, $page, 'is_recommend desc,create_time desc', $r, '*');
     $builder = new AdminListBuilder();
     $builder->title('问题列表页');
     $builder->setSelectPostUrl(U('Question/index'))->select('', 'status', 'select', '', '', '', array(array('id' => 0, 'value' => '当前问题(启用)'), array('id' => 1, 'value' => '未审核'), array('id' => 2, 'value' => '审核失败或已禁用')));
     $builder->setStatusUrl(U('Question/setQuestionStatus'));
     if ($aStatus == 1) {
         $builder->buttonEnable(null, '审核通过')->buttonDisable(null, '审核失败')->buttonDelete(null, '直接删除');
     } elseif ($aStatus == 2) {
         $builder->buttonEnable(null, '启用或审核通过')->buttonDelete();
     } else {
         $builder->buttonEnable()->buttonDisable()->buttonDelete()->ajaxButton(U('Question/recommend'), array('recommend' => 1), '设为推荐')->ajaxButton(U('Question/recommend'), array('recommend' => 0), '取消推荐');
     }
     $builder->keyId()->keyLink('title', '标题', 'Question/Index/detail?id=###')->keyUid()->keyText('category', '分类')->keyBool('is_recommend', '是否为推荐')->keyCreateTime()->keyUpdateTime()->keyStatus();
     $builder->pagination($totalCount, $r)->data($list)->display();
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:25,代码来源:QuestionController.class.php


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