public function operate($type = 'move', $from = 0)
 {
     $builder = new AdminConfigBuilder();
     $from = D('Mpbase/CustomMenu')->find($from);
     $opt = array();
     $cms = $this->model->select();
     foreach ($cms as $cm) {
         $opt[$cm['id']] = $cm['title'];
     }
     if ($type === 'move') {
         $builder->title('移动分类')->keyId()->keySelect('pid', '父分类', '选择父分类', $opt)->buttonSubmit(U('Custommenu/add'))->buttonBack()->data($from)->display();
     } else {
         $builder->title('合并分类')->keyId()->keySelect('toid', '合并至的分类', '选择合并至的分类', $opt)->buttonSubmit(U('Custommenu/doMerge'))->buttonBack()->data($from)->display();
     }
 }
示例#2
0
 public function operate($type = 'move', $from = 0)
 {
     $builder = new AdminConfigBuilder();
     $from = D('EventType')->find($from);
     $opt = array();
     $types = $this->eventTypeModel->select();
     foreach ($types as $event) {
         $opt[$event['id']] = $event['title'];
     }
     if ($type === 'move') {
         $builder->title('移动分类')->keyId()->keySelect('pid', '父分类', '选择父分类', $opt)->buttonSubmit(U('EventType/add'))->buttonBack()->data($from)->display();
     } else {
         $builder->title('合并分类')->keyId()->keySelect('toid', '合并至的分类', '选择合并至的分类', $opt)->buttonSubmit(U('EventType/doMerge'))->buttonBack()->data($from)->display();
     }
 }
 /**
  * 分类添加
  * @author 郑钟良<*****@*****.**>
  */
 public function add($id = 0, $pid = 0)
 {
     if (IS_POST) {
         if ($id != 0) {
             $result = $this->userTagModel->saveData();
             if ($result) {
                 $this->success(L('_SUCCESS_EDIT_') . L('_PERIOD_'), U('UserTag/userTag'));
             } else {
                 $this->error(L('_FAIL_EDIT_') . L('_PERIOD_') . $this->userTagModel->getError());
             }
         } else {
             $result = $this->userTagModel->addData();
             if ($result) {
                 $this->success(L('_SUCCESS_ADD_') . L('_PERIOD_'));
             } else {
                 $this->error(L('_FAIL_ADD_') . L('_PERIOD_') . $this->userTagModel->getError());
             }
         }
     } else {
         $builder = new AdminConfigBuilder();
         $opt = array();
         if ($id != 0) {
             $category = $this->userTagModel->find($id);
             if ($category['pid'] != 0) {
                 $categorys = $this->userTagModel->where(array('pid' => 0))->select();
                 foreach ($categorys as $cate) {
                     $opt[$cate['id']] = $cate['title'];
                 }
             }
         } else {
             $category = array('pid' => $pid, 'status' => 1);
             $father_category_pid = $this->userTagModel->where(array('id' => $pid))->getField('pid');
             if ($father_category_pid != 0) {
                 $this->error(L('_ERROR_CATEGORY_HIR_LIMIT_') . L('_EXCLAMATION_'));
             }
             $categorys = $this->userTagModel->where(array('pid' => 0))->select();
             foreach ($categorys as $cate) {
                 $opt[$cate['id']] = $cate['title'];
             }
         }
         if ($pid != 0) {
             $builder->title(L('_TAG_ADD_'));
         } else {
             $builder->title(L('_CATEGORY_ADD_'));
         }
         $builder->keyId()->keyText('title', L('_TITLE_'))->keySelect('pid', L('_FATHER_CLASS_'), L('_FATHER_CLASS_SELECT_'), array('0' => L('_TOP_CLASS_')) + $opt)->keyStatus()->data($category)->buttonSubmit(U('UserTag/add'))->buttonBack()->display();
     }
 }
 /**
  * 分类添加
  * @author 郑钟良<*****@*****.**>
  */
 public function add($id = 0, $pid = 0)
 {
     if (IS_POST) {
         if ($id != 0) {
             $result = $this->userTagModel->saveData();
             if ($result) {
                 $this->success('编辑成功。', U('UserTag/userTag'));
             } else {
                 $this->error('编辑失败。' . $this->userTagModel->getError());
             }
         } else {
             $result = $this->userTagModel->addData();
             if ($result) {
                 $this->success('新增成功。');
             } else {
                 $this->error('新增失败。' . $this->userTagModel->getError());
             }
         }
     } else {
         $builder = new AdminConfigBuilder();
         $opt = array();
         if ($id != 0) {
             $category = $this->userTagModel->find($id);
             if ($category['pid'] != 0) {
                 $categorys = $this->userTagModel->where(array('pid' => 0))->select();
                 foreach ($categorys as $cate) {
                     $opt[$cate['id']] = $cate['title'];
                 }
             }
         } else {
             $category = array('pid' => $pid, 'status' => 1);
             $father_category_pid = $this->userTagModel->where(array('id' => $pid))->getField('pid');
             if ($father_category_pid != 0) {
                 $this->error('分类不能超过二级!');
             }
             $categorys = $this->userTagModel->where(array('pid' => 0))->select();
             foreach ($categorys as $cate) {
                 $opt[$cate['id']] = $cate['title'];
             }
         }
         if ($pid != 0) {
             $builder->title('新增标签');
         } else {
             $builder->title('新增分类');
         }
         $builder->keyId()->keyText('title', '标题')->keySelect('pid', '父分类', '选择父级分类', array('0' => '顶级分类') + $opt)->keyStatus()->data($category)->buttonSubmit(U('UserTag/add'))->buttonBack()->display();
     }
 }
 /**
  * 编辑公告
  * @author 郑钟良<*****@*****.**>
  */
 public function edit()
 {
     $aId = I('id', 0, 'intval');
     $title = $aId ? "编辑" : "新增";
     if (IS_POST) {
         $aId && ($data['id'] = $aId);
         $data['title'] = I('post.title', '', 'op_t');
         $data['icon'] = I('post.icon', 'icon-star', 'op_t');
         $data['link'] = I('post.link');
         if (mb_strlen($data['link'], 'utf-8') && !in_array(strtolower(substr($data['link'], 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) {
             $data['link'] = 'http://' . $data['link'];
         }
         $data['content'] = I('post.content', '', 'op_t');
         $data['end_time'] = intval(I('post.end_time'));
         $result = $this->announcementModel->editData($data);
         if ($result) {
             S('Announcement_list', null);
             //清空缓存
             $this->success($title . '公告成功!', addons_url('Announcement://admin/buildList'));
         } else {
             $this->error($title . '公告失败!' . $this->announcementModel->getError());
         }
     } else {
         if ($aId) {
             $data = $this->announcementModel->where(array('id' => $aId))->find();
         }
         $builder = new AdminConfigBuilder();
         $builder->title($title . '公告')->data($data);
         $builder->keyId()->keyText('title', '标题')->keyIcon('icon', '图标')->keyText('link', '链接')->keyTextArea('content', '内容')->keyTime('end_time', '有效期')->keyDefault('end_time', time() + 604800);
         $builder->buttonSubmit()->buttonBack()->display();
     }
 }
    public function index()
    {
        $admin_config = new AdminConfigBuilder();
        $data = $admin_config->handleConfig();
        $mStep = A('Ucenter/RegStep', 'Widget')->mStep;
        $step = array();
        foreach ($mStep as $key => $v) {
            $step[] = array('data-id' => $key, 'title' => $v);
        }
        $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $step), array('data-id' => 'enable', 'title' => '启用', 'items' => array()));
        //$default=array('禁用'=>$step,'启用并可跳过'=>array(),'启用但不可跳过'=>array());
        $data['REG_STEP'] = $admin_config->parseKanbanArray($data['REG_STEP'], $step, $default);
        empty($data['LEVEL']) && ($data['LEVEL'] = <<<str
0:Lv1 实习
50:Lv2 试用
100:Lv3 转正
200:Lv4 助理
400:Lv 5 经理
800:Lv6 董事
1600:Lv7 董事长
str
);
        empty($data['OPEN_QUICK_LOGIN']) && ($data['OPEN_QUICK_LOGIN'] = 0);
        $admin_config->title('用户配置')->keyCheckBox('REG_SWITCH', '注册开关', '允许使用的注册选项,全不选即为关闭注册', array('username' => '用户名', 'email' => '邮箱', 'mobile' => '手机'))->keyRadio('EMAIL_VERIFY_TYPE', '邮箱验证类型', '邮箱验证的类型', array(0 => '不验证', 1 => '注册后发送激活邮件', 2 => '注册前发送验证邮件'))->keyRadio('MOBILE_VERIFY_TYPE', '手机验证类型', '手机验证的类型', array(0 => '不验证', 1 => '注册前发送验证短信'))->keyKanban('REG_STEP', '注册步骤', '注册后需要进行的步骤')->keyCheckBox('REG_CAN_SKIP', '注册步骤是否可跳过', '勾选为可跳过,默认不可跳过', $mStep)->keyEditor('REG_EMAIL_VERIFY', '邮箱验证模版', '用于进行邮箱的验证', 'all')->keyEditor('REG_EMAIL_ACTIVATE', '邮箱激活模版', '用于进行用户的激活')->keyCheckBox('SMS_SP', '短信提供商', '可选的短信通道提供商,全不选即为关闭短信通道', array('ucpaas' => '云之讯', 'UCToo' => 'UCToo'))->keyText('SMS_HTTP', '短信平台HTTP', '短信平台HTTP')->keyText('SMS_HTTPS', '短信平台HTTPS', '短信平台HTTPS')->keyText('SMS_UID', '短信平台帐号', '短信平台帐号')->keyText('SMS_PWD', '短信平台密码', '短信平台密码')->keyText('SMS_ACCOUNTSID', '短信平台开发者ID', '短信平台开发者ID')->keyText('SMS_TOKEN', '短信平台TOKEN', '短信平台TOKEN')->keyText('SMS_APPID', '短信平台应用ID', '短信平台应用ID')->keyText('SMS_TEMPLATEID', '短信平台模板ID', '短信平台模板ID')->keyTextArea('SMS_CONTENT', '短信内容', '短信内容')->keyTextArea('LEVEL', '等级配置', '每行一条,名称和积分之间用冒号分隔')->keyRadio('OPEN_QUICK_LOGIN', '快捷登录', '默认关闭,开启后用户登录方式更换成快捷登录!', array(0 => '关闭', 1 => '开启'))->group('注册配置', 'REG_SWITCH,EMAIL_VERIFY_TYPE,MOBILE_VERIFY_TYPE,REG_STEP,REG_CAN_SKIP')->group('登录配置', 'OPEN_QUICK_LOGIN')->group('邮箱验证模版', 'REG_EMAIL_VERIFY')->group('邮箱激活模版', 'REG_EMAIL_ACTIVATE')->group('短信配置', 'SMS_SP,SMS_HTTP,SMS_HTTPS,SMS_UID,SMS_PWD,SMS_ACCOUNTSID,SMS_TOKEN,SMS_APPID,SMS_TEMPLATEID,SMS_CONTENT')->group('基础设置', 'LEVEL')->buttonSubmit('', '保存')->data($data);
        $admin_config->display();
    }
    public function index()
    {
        $admin_config = new AdminConfigBuilder();
        $data = $admin_config->handleConfig();
        $mStep = A('Ucenter/RegStep', 'Widget')->mStep;
        $step = array();
        foreach ($mStep as $key => $v) {
            $step[] = array('data-id' => $key, 'title' => $v);
        }
        $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $step), array('data-id' => 'enable', 'title' => '启用', 'items' => array()));
        //$default=array('禁用'=>$step,'启用并可跳过'=>array(),'启用但不可跳过'=>array());
        $data['REG_STEP'] = $admin_config->parseKanbanArray($data['REG_STEP'], $step, $default);
        empty($data['LEVEL']) && ($data['LEVEL'] = <<<str
0:Lv1 实习
50:Lv2 试用
100:Lv3 转正
200:Lv4 助理
400:Lv 5 经理
800:Lv6 董事
1600:Lv7 董事长
str
);
        empty($data['OPEN_QUICK_LOGIN']) && ($data['OPEN_QUICK_LOGIN'] = 0);
        $admin_config->title('用户配置')->keyCheckBox('REG_SWITCH', '注册开关', '允许使用的注册选项,全不选即为关闭注册', array('username' => '用户名', 'email' => '邮箱', 'mobile' => '手机'))->keyRadio('EMAIL_VERIFY_TYPE', '邮箱验证类型', '邮箱验证的类型', array(0 => '不验证', 1 => '注册后发送激活邮件', 2 => '注册前发送验证邮件'))->keyRadio('MOBILE_VERIFY_TYPE', '手机验证类型', '手机验证的类型', array(0 => '不验证', 1 => '注册前发送验证短信'))->keyText('NEW_USER_FOLLOW', '新用户关注', '输入用户id,多个用户以‘,’分割')->keyText('NEW_USER_FANS', '新用户粉丝', '输入用户id,多个用户以‘,’分割')->keyText('NEW_USER_FRIENDS', '新用户好友', '输入用户id,多个用户以‘,’分割')->keyKanban('REG_STEP', '注册步骤', '注册后需要进行的步骤')->keyCheckBox('REG_CAN_SKIP', '注册步骤是否可跳过', '勾选为可跳过,默认不可跳过', $mStep)->keyEditor('REG_EMAIL_VERIFY', '邮箱验证模版', '用于进行邮箱的验证', 'all')->keyEditor('REG_EMAIL_ACTIVATE', '邮箱激活模版', '用于进行用户的激活')->keyText('SMS_HTTP', '短信平台HTTP', '短信平台HTTP,可用服务商:<a href="http://www.yunsms.cn/" target="_blank">云短信</a>')->keyText('SMS_UID', '短信平台帐号', '短信平台帐号')->keyText('SMS_PWD', '短信平台密码', '短信平台密码')->keyTextArea('SMS_CONTENT', '短信内容', '短信内容')->keyTextArea('LEVEL', '等级配置', '每行一条,名称和积分之间用冒号分隔')->keyRadio('OPEN_QUICK_LOGIN', '快捷登录', '默认关闭,开启后用户登录方式更换成快捷登录!', array(0 => '关闭', 1 => '开启'))->group('注册配置', 'REG_SWITCH,EMAIL_VERIFY_TYPE,MOBILE_VERIFY_TYPE,REG_STEP,REG_CAN_SKIP,NEW_USER_FOLLOW,NEW_USER_FANS,NEW_USER_FRIENDS')->group('登录配置', 'OPEN_QUICK_LOGIN')->group('邮箱验证模版', 'REG_EMAIL_VERIFY')->group('邮箱激活模版', 'REG_EMAIL_ACTIVATE')->group('短信配置', 'SMS_HTTP,SMS_UID,SMS_PWD,SMS_CONTENT')->group('基础设置', 'LEVEL')->buttonSubmit('', '保存')->data($data);
        $admin_config->display();
    }
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('基本配置');
     $builder->keyText('WEBSITE_NAME', '网站名称显示')->keyEditor('COPY_RIGHT', '网站版权信息')->group('通用设置', 'WEBSITE_NAME,COPY_RIGHT');
     $builder->keyTextArea('SUMMARY', '登陆页导语', '不要过长,一句话即可')->group('登陆页设置', 'SUMMARY');
     $builder->buttonSubmit();
     $builder->data($data);
     $builder->display();
 }
 public function editLimit()
 {
     $aId = I('id', 0, 'intval');
     $model = D('ActionLimit');
     if (IS_POST) {
         $data['title'] = I('post.title', '', 'op_t');
         $data['name'] = I('post.name', '', 'op_t');
         $data['frequency'] = I('post.frequency', 1, 'intval');
         $data['time_number'] = I('post.time_number', 1, 'intval');
         $data['time_unit'] = I('post.time_unit', '', 'op_t');
         $data['punish'] = I('post.punish', '', 'op_t');
         $data['if_message'] = I('post.if_message', '', 'op_t');
         $data['message_content'] = I('post.message_content', '', 'op_t');
         $data['action_list'] = I('post.action_list', '', 'op_t');
         $data['status'] = I('post.status', 1, 'intval');
         $data['module'] = I('post.module', '', 'op_t');
         $data['punish'] = implode(',', $data['punish']);
         foreach ($data['action_list'] as &$v) {
             $v = '[' . $v . ']';
         }
         unset($v);
         $data['action_list'] = implode(',', $data['action_list']);
         if ($aId != 0) {
             $data['id'] = $aId;
             $res = $model->editActionLimit($data);
         } else {
             $res = $model->addActionLimit($data);
         }
         if ($res) {
             $this->success(($aId == 0 ? '添加' : '编辑') . '成功', $aId == 0 ? U('', array('id' => $res)) : '');
         } else {
             $this->error($aId == 0 ? '操作失败,请添加正确信息!' : '操作失败,请确保修改了信息并且信息正确!');
         }
     } else {
         $builder = new AdminConfigBuilder();
         $modules = D('Module')->getAll();
         $module['all'] = '全站';
         foreach ($modules as $k => $v) {
             $module[$v['name']] = $v['alias'];
         }
         if ($aId != 0) {
             $limit = $model->getActionLimit(array('id' => $aId));
             $limit['punish'] = explode(',', $limit['punish']);
             $limit['action_list'] = str_replace('[', '', $limit['action_list']);
             $limit['action_list'] = str_replace(']', '', $limit['action_list']);
             $limit['action_list'] = explode(',', $limit['action_list']);
         } else {
             $limit = array('status' => 1, 'time_number' => 1);
         }
         $opt_punish = $this->getPunish();
         $opt = D('Action')->getActionOpt();
         $builder->title(($aId == 0 ? '新增' : '编辑') . '行为限制')->keyId()->keyTitle()->keyText('name', '名称')->keySelect('module', '所属模块', '', $module)->keyText('frequency', '频率')->keyMultiInput('time_number|time_unit', '时间单位', '时间单位', array(array('type' => 'text', 'style' => 'width:295px;margin-right:5px'), array('type' => 'select', 'opt' => $this->getTimeUnit(), 'style' => 'width:100px')))->keyChosen('punish', '处罚', '可多选', $opt_punish)->keyBool('if_message', '是否发送提醒')->keyTextArea('message_content', '消息提示内容')->keyChosen('action_list', '行为', '可多选,不选为全部行为', $opt)->keyStatus()->data($limit)->buttonSubmit(U('editLimit'))->buttonBack()->display();
     }
 }
 public function editLimit()
 {
     $aId = I('id', 0, 'intval');
     $model = D('ActionLimit');
     if (IS_POST) {
         $data['title'] = I('post.title', '', 'op_t');
         $data['name'] = I('post.name', '', 'op_t');
         $data['frequency'] = I('post.frequency', 1, 'intval');
         $data['time_number'] = I('post.time_number', 1, 'intval');
         $data['time_unit'] = I('post.time_unit', '', 'op_t');
         $data['punish'] = I('post.punish', '', 'op_t');
         $data['if_message'] = I('post.if_message', '', 'op_t');
         $data['message_content'] = I('post.message_content', '', 'op_t');
         $data['action_list'] = I('post.action_list', '', 'op_t');
         $data['status'] = I('post.status', 1, 'intval');
         $data['module'] = I('post.module', '', 'op_t');
         $data['punish'] = implode(',', $data['punish']);
         foreach ($data['action_list'] as &$v) {
             $v = '[' . $v . ']';
         }
         unset($v);
         $data['action_list'] = implode(',', $data['action_list']);
         if ($aId != 0) {
             $data['id'] = $aId;
             $res = $model->editActionLimit($data);
         } else {
             $res = $model->addActionLimit($data);
         }
         if ($res) {
             $this->success(($aId == 0 ? L('_ADD_') : L('_EDIT_')) . L('_SUCCESS_'), $aId == 0 ? U('', array('id' => $res)) : '');
         } else {
             $this->error($aId == 0 ? L('_THE_OPERATION_FAILED_') : L('_THE_OPERATION_FAILED_VICE_'));
         }
     } else {
         $builder = new AdminConfigBuilder();
         $modules = D('Module')->getAll();
         $module['all'] = L('_TOTAL_STATION_');
         foreach ($modules as $k => $v) {
             $module[$v['name']] = $v['alias'];
         }
         if ($aId != 0) {
             $limit = $model->getActionLimit(array('id' => $aId));
             $limit['punish'] = explode(',', $limit['punish']);
             $limit['action_list'] = str_replace('[', '', $limit['action_list']);
             $limit['action_list'] = str_replace(']', '', $limit['action_list']);
             $limit['action_list'] = explode(',', $limit['action_list']);
         } else {
             $limit = array('status' => 1, 'time_number' => 1);
         }
         $opt_punish = $this->getPunish();
         $opt = D('Action')->getActionOpt();
         $builder->title(($aId == 0 ? L('_NEW_') : L('_EDIT_')) . L('_ACT_RESTRICTION_'))->keyId()->keyTitle()->keyText('name', L('_NAME_'))->keySelect('module', L('_MODULE_'), '', $module)->keyText('frequency', L('_FREQUENCY_'))->keyMultiInput('time_number|time_unit', L('_TIME_UNIT_'), L('_TIME_UNIT_'), array(array('type' => 'text', 'style' => 'width:295px;margin-right:5px'), array('type' => 'select', 'opt' => $this->getTimeUnit(), 'style' => 'width:100px')))->keyChosen('punish', L('_PUNISHMENT_'), L('_MULTI_SELECT_'), $opt_punish)->keyBool('if_message', L('_SEND_REMINDER_'))->keyTextArea('message_content', L('_MESSAGE_PROMPT_CONTENT_'))->keyChosen('action_list', L('_ACT_'), L('_MULTI_SELECT_DEFAULT_'), $opt)->keyStatus()->data($limit)->buttonSubmit(U('editLimit'))->buttonBack()->display();
     }
 }
 public function index()
 {
     $pkgList = $this->expressionModel->getPkgList(0);
     $admin_config = new AdminConfigBuilder();
     $data = $admin_config->handleConfig();
     $tab = array();
     foreach ($pkgList as $key => $v) {
         $tab[] = array('data-id' => $v['name'], 'title' => $v['title']);
     }
     $default = array(array('data-id' => 'disable', 'title' => L('_DISABLE_'), 'items' => array()), array('data-id' => 'enable', 'title' => L('_ENABLE_'), 'items' => $tab));
     $data['PKGLIST'] = $admin_config->parseKanbanArray($data['PKGLIST'], $tab, $default);
     $admin_config->title(L('_FACIAL_EXPRESSIONS_'))->keyKanban('PKGLIST', L('_EXPRESSION_PACKAGE_STATUS_AND_SORT_'))->buttonSubmit('', L('_SAVE_'))->data($data);
     $admin_config->display();
 }
 public function index()
 {
     $pkgList = $this->expressionModel->getPkgList(0);
     $admin_config = new AdminConfigBuilder();
     $data = $admin_config->handleConfig();
     $tab = array();
     foreach ($pkgList as $key => $v) {
         $tab[] = array('data-id' => $v['name'], 'title' => $v['title']);
     }
     $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => array()), array('data-id' => 'enable', 'title' => '启用', 'items' => $tab));
     $data['PKGLIST'] = $admin_config->parseKanbanArray($data['PKGLIST'], $tab, $default);
     $admin_config->title('表情基本设置')->keyKanban('PKGLIST', '表情包状态并排序')->buttonSubmit('', '保存')->data($data);
     $admin_config->display();
 }
 public function index()
 {
     $ExpressionPkg = $this->_rootPath . '/Uploads/expression';
     $pkgList = D('Core/Expression')->myreaddir($ExpressionPkg);
     $pkg['all'] = '全部';
     $pkg['miniblog'] = 'miniblog';
     foreach ($pkgList as $v) {
         $pkg[$v] = $v;
     }
     unset($v);
     $admin_config = new AdminConfigBuilder();
     $data = $admin_config->handleConfig();
     $admin_config->title('表情基本设置')->keySelect('EXPRESSION', '表情包选择', '', $pkg)->buttonSubmit('', '保存')->data($data);
     $admin_config->display();
 }
示例#14
0
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('基本设置');
     $data['MAX_SHOW_HEIGHT'] = $data['MAX_SHOW_HEIGHT'] ? $data['MAX_SHOW_HEIGHT'] : 160;
     $builder->keyInteger('MAX_SHOW_HEIGHT', '标签面板初始最大展示高度')->keyDefault('MAX_SHOW_HEIGHT', 160);
     $role_list = M('Role')->where(array('status' => 1))->field('id,title')->select();
     foreach ($role_list as &$val) {
         $val = array('data-id' => $val['id'], 'title' => $val['title']);
     }
     unset($val);
     $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $role_list), array('data-id' => 'enable', 'title' => '启用', 'items' => array()));
     $builder->keyKanban('SHOW_ROLE_TAB', '找人界面展示身份tab', '拖拽到右侧以展示这些身份tab,操作的项目对应系统身份');
     $data['SHOW_ROLE_TAB'] = $builder->parseKanbanArray($data['SHOW_ROLE_TAB'], $role_list, $default);
     $builder->group('基本设置', 'MAX_SHOW_HEIGHT,SHOW_ROLE_TAB');
     $data['USER_SHOW_TITLE1'] = $data['USER_SHOW_TITLE1'] ? $data['USER_SHOW_TITLE1'] : '活跃会员';
     $data['USER_SHOW_COUNT1'] = $data['USER_SHOW_COUNT1'] ? $data['USER_SHOW_COUNT1'] : 5;
     $data['USER_SHOW_ORDER_FIELD1'] = $data['USER_SHOW_ORDER_FIELD1'] ? $data['USER_SHOW_ORDER_FIELD1'] : 'score1';
     $data['USER_SHOW_ORDER_TYPE1'] = $data['USER_SHOW_ORDER_TYPE1'] ? $data['USER_SHOW_ORDER_TYPE1'] : 'desc';
     $data['USER_SHOW_CACHE_TIME1'] = $data['USER_SHOW_CACHE_TIME1'] ? $data['USER_SHOW_CACHE_TIME1'] : '600';
     $data['USER_SHOW_TITLE2'] = $data['USER_SHOW_TITLE2'] ? $data['USER_SHOW_TITLE2'] : '最新会员';
     $data['USER_SHOW_COUNT2'] = $data['USER_SHOW_COUNT2'] ? $data['USER_SHOW_COUNT2'] : 5;
     $data['USER_SHOW_ORDER_FIELD2'] = $data['USER_SHOW_ORDER_FIELD2'] ? $data['USER_SHOW_ORDER_FIELD2'] : 'reg_time';
     $data['USER_SHOW_ORDER_TYPE2'] = $data['USER_SHOW_ORDER_TYPE2'] ? $data['USER_SHOW_ORDER_TYPE2'] : 'desc';
     $data['USER_SHOW_CACHE_TIME2'] = $data['USER_SHOW_CACHE_TIME2'] ? $data['USER_SHOW_CACHE_TIME2'] : '600';
     $score = D("Ucenter/Score")->getTypeList(array('status' => 1));
     $order['reg_time'] = '注册时间';
     $order['last_login_time'] = '最后登录时间';
     foreach ($score as $s) {
         $order['score' . $s['id']] = '【' . $s['title'] . '】';
     }
     $builder->keyText('USER_SHOW_TITLE1', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT1', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD1', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE1', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME1', '缓存时间', '默认600秒,以秒为单位');
     $builder->keyText('USER_SHOW_TITLE2', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT2', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD2', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE2', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME2', '缓存时间', '默认600秒,以秒为单位');
     $builder->group('首页展示左侧栏', 'USER_SHOW_TITLE1,USER_SHOW_COUNT1,USER_SHOW_ORDER_FIELD1,USER_SHOW_ORDER_TYPE1,USER_SHOW_CACHE_TIME1');
     $builder->group('首页展示右侧栏', 'USER_SHOW_TITLE2,USER_SHOW_COUNT2,USER_SHOW_ORDER_FIELD2,USER_SHOW_ORDER_TYPE2,USER_SHOW_CACHE_TIME2');
     $builder->data($data);
     $builder->buttonSubmit();
     $builder->display();
 }
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title(L('_BASIC_CONF_'));
     $data['MAX_SHOW_HEIGHT'] = $data['MAX_SHOW_HEIGHT'] ? $data['MAX_SHOW_HEIGHT'] : 160;
     $builder->keyInteger('MAX_SHOW_HEIGHT', L('_MAX_SHOW_HEIGHT_'))->keyDefault('MAX_SHOW_HEIGHT', 160);
     $role_list = M('Role')->where(array('status' => 1))->field('id,title')->select();
     foreach ($role_list as &$val) {
         $val = array('data-id' => $val['id'], 'title' => $val['title']);
     }
     unset($val);
     $default = array(array('data-id' => 'disable', 'title' => L('_DISABLE_'), 'items' => $role_list), array('data-id' => 'enable', 'title' => L('_ENABLED_'), 'items' => array()));
     $builder->keyKanban('SHOW_ROLE_TAB', L('_IDENTITY_TAB_'), L('_IDENTITY_TAB_AFFIX_'));
     $data['SHOW_ROLE_TAB'] = $builder->parseKanbanArray($data['SHOW_ROLE_TAB'], $role_list, $default);
     $builder->group(L('_BASIC_CONF_'), 'MAX_SHOW_HEIGHT,SHOW_ROLE_TAB');
     $data['USER_SHOW_TITLE1'] = $data['USER_SHOW_TITLE1'] ? $data['USER_SHOW_TITLE1'] : L('_ACTIVE_MEMBER_');
     $data['USER_SHOW_COUNT1'] = $data['USER_SHOW_COUNT1'] ? $data['USER_SHOW_COUNT1'] : 5;
     $data['USER_SHOW_ORDER_FIELD1'] = $data['USER_SHOW_ORDER_FIELD1'] ? $data['USER_SHOW_ORDER_FIELD1'] : 'score1';
     $data['USER_SHOW_ORDER_TYPE1'] = $data['USER_SHOW_ORDER_TYPE1'] ? $data['USER_SHOW_ORDER_TYPE1'] : 'desc';
     $data['USER_SHOW_CACHE_TIME1'] = $data['USER_SHOW_CACHE_TIME1'] ? $data['USER_SHOW_CACHE_TIME1'] : '600';
     $data['USER_SHOW_TITLE2'] = $data['USER_SHOW_TITLE2'] ? $data['USER_SHOW_TITLE2'] : L('_NEW_MEMBER_');
     $data['USER_SHOW_COUNT2'] = $data['USER_SHOW_COUNT2'] ? $data['USER_SHOW_COUNT2'] : 5;
     $data['USER_SHOW_ORDER_FIELD2'] = $data['USER_SHOW_ORDER_FIELD2'] ? $data['USER_SHOW_ORDER_FIELD2'] : 'reg_time';
     $data['USER_SHOW_ORDER_TYPE2'] = $data['USER_SHOW_ORDER_TYPE2'] ? $data['USER_SHOW_ORDER_TYPE2'] : 'desc';
     $data['USER_SHOW_CACHE_TIME2'] = $data['USER_SHOW_CACHE_TIME2'] ? $data['USER_SHOW_CACHE_TIME2'] : '600';
     $score = D("Ucenter/Score")->getTypeList(array('status' => 1));
     $order['reg_time'] = L('_REGISTER_TIME_');
     $order['last_login_time'] = L('_LAST_LOGIN_TIME_');
     foreach ($score as $s) {
         $order['score' . $s['id']] = '【' . $s['title'] . '】';
     }
     $builder->keyText('USER_SHOW_TITLE1', L('_TITLE_NAME_'), L('_BLOCK_TITLE_'));
     $builder->keyText('USER_SHOW_COUNT1', L('_SHOW_PEOPLE_'), L('_TIP_AFTER_ENABLED_'));
     $builder->keyRadio('USER_SHOW_ORDER_FIELD1', L('_SORT_NUMBER_'), L('_SHOW_SORT_STYLE_'), $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE1', L('_SORT_STYLE_'), L('_SHOW_SORT_STYLE_'), array('desc' => L('_COUNTER_'), 'asc' => L('_DIRECT_')));
     $builder->keyText('USER_SHOW_CACHE_TIME1', L('_CACHE_TIME_'), L('_TIP_CACHE_TIME_'));
     $builder->keyText('USER_SHOW_TITLE2', L('_TITLE_NAME_'), L('_BLOCK_TITLE_'));
     $builder->keyText('USER_SHOW_COUNT2', L('_SHOW_PEOPLE_'), L('_TIP_AFTER_ENABLED_'));
     $builder->keyRadio('USER_SHOW_ORDER_FIELD2', L('_SORT_NUMBER_'), L('_SHOW_SORT_STYLE_'), $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE2', L('_SORT_STYLE_'), L('_SHOW_SORT_STYLE_'), array('desc' => L('_COUNTER_'), 'asc' => L('_DIRECT_')));
     $builder->keyText('USER_SHOW_CACHE_TIME2', L('_CACHE_TIME_'), L('_TIP_CACHE_TIME_'));
     $builder->group(L('_HOME_SHOW_LEFT_'), 'USER_SHOW_TITLE1,USER_SHOW_COUNT1,USER_SHOW_ORDER_FIELD1,USER_SHOW_ORDER_TYPE1,USER_SHOW_CACHE_TIME1');
     $builder->group(L('_HOME_SHOW_RIGHT_'), 'USER_SHOW_TITLE2,USER_SHOW_COUNT2,USER_SHOW_ORDER_FIELD2,USER_SHOW_ORDER_TYPE2,USER_SHOW_CACHE_TIME2');
     $builder->data($data);
     $builder->buttonSubmit();
     $builder->display();
 }
示例#16
0
 public function editRule($id = null)
 {
     //判断是否为编辑模式
     $isEdit = $id ? true : false;
     //读取规则内容
     if ($isEdit) {
         $rule = M('SeoRule')->where(array('id' => $id))->find();
     } else {
         $rule = array('status' => 1);
     }
     //
     $rule['action2'] = $rule['action'];
     //显示页面
     $builder = new AdminConfigBuilder();
     $builder->title($isEdit ? '编辑规则' : '添加规则')->keyId()->keyText('title', '名称', '规则名称,方便记忆')->keyText('app', '应用名称', '不填表示所有应用')->keyText('controller', '控制器', '不填表示所有控制器')->keyText('action2', '方法', '不填表示所有方法')->keyText('seo_title', 'SEO标题', '不填表示使用下一条规则,支持变量')->keyText('seo_keywords', 'SEO关键字', '不填表示使用下一条规则,支持变量')->keyTextArea('seo_description', 'SEO描述', '不填表示使用下一条规则,支持变量')->keyStatus()->data($rule)->buttonSubmit(U('doEditRule'))->buttonBack()->display();
 }
 public function config()
 {
     $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
     $configBuilder = new AdminConfigBuilder();
     $data = $configBuilder->callback('configCallback')->handleConfig();
     $param = array();
     $param['opt'] = $field;
     $de_data = $data['RE_FIELD'];
     $param['jsonData'] = $de_data;
     $param['data'] = json_decode($de_data, true);
     $param_w = array();
     $param_w['opt'] = $field;
     $w_data = $data['WITHDRAW_FIELD'];
     $param_w['jsonData'] = $w_data;
     $param_w['data'] = json_decode($w_data, true);
     $configBuilder->title('充值设置')->data($data)->keyBool('OPEN_RECHARGE', '开启充值')->keyTextArea('RECHARGE_AMOUNT', '充值面额', '一行一个')->keyBool('CAN_INPUT', '允许自由充值')->keyText('MIN_AMOUNT', '最小充值面额,0为不限制,只对自由充值开启有效')->keyCheckBox('METHOD', '支付方式', '选择支付种类', array('alipay' => '支付宝'))->keyUserDefined('RE_FIELD', '支持充值的积分类型', '选择支持充值的积分类型和积分的兑率,如填写100则表示1RMB=100积分', T('Recharge@Recharge/config'), $param)->keyDefault('METHOD', 'alipay')->keyDefault('MIN_AMOUNT', 0)->keyBool('OPEN_WITHDRAW', '开启提现')->keyTextArea('WITHDRAW_AMOUNT', '提现面额', '一行一个')->keyBool('WITHDRAW_CAN_INPUT', '允许自由提现')->keyText('WITHDRAW_MIN_AMOUNT', '最小提现面额,0为不限制,只对自由提现开启有效')->keyCheckBox('WITHDRAW_METHOD', '支付方式', '选择支付种类', array('alipay' => '支付宝'))->keyUserDefined('WITHDRAW_FIELD', '支持提现的积分类型', '选择支持提现的积分类型和积分的兑率,如填写100则表示100积分=1RMB', T('Recharge@Recharge/config'), $param_w)->keyDefault('WITHDRAW_METHOD', 'alipay')->keyDefault('WITHDRAW_MIN_AMOUNT', 0)->group('充值设置', 'OPEN_RECHARGE,RECHARGE_AMOUNT,CAN_INPUT,MIN_AMOUNT,METHOD,RE_FIELD')->group('提现设置', 'OPEN_WITHDRAW,WITHDRAW_AMOUNT,WITHDRAW_CAN_INPUT,WITHDRAW_MIN_AMOUNT,WITHDRAW_METHOD,WITHDRAW_FIELD');
     if (check_is_in_config('alipay', $data['METHOD'])) {
         $configBuilder->keyText('ALIPAY_PARTNER', '合作身份者id', '以2088开头的16位纯数字')->keyText('ALIPAY_SELLER_EMAIL', '收款支付宝账号')->keyText('ALIPAY_KEY', '安全检验码', '以数字和字母组成的32位字符')->group('支付宝配置', 'ALIPAY_PARTNER,ALIPAY_SELLER_EMAIL,ALIPAY_KEY');
     }
     $configBuilder->buttonSubmit()->buttonBack();
     $configBuilder->display();
 }
示例#18
0
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1;
     $builder->title('首页设置');
     $modules = D('Common/Module')->getAll();
     foreach ($modules as $m) {
         if ($m['is_setup'] == 1 && $m['entry'] != '') {
             if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) {
                 $module[] = array('data-id' => $m['name'], 'title' => $m['alias']);
             }
         }
     }
     $module[] = array('data-id' => 'slider', 'title' => '轮播');
     $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $module), array('data-id' => 'enable', 'title' => '启用', 'items' => array()));
     $builder->keyKanban('BLOCK', '展示模块', '拖拽到右侧以展示这些模块,新的模块安装后会多出一些可操作的项目');
     $data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default);
     $builder->group('展示模块', 'BLOCK');
     $builder->keySingleImage('PIC1', '图片');
     $builder->keyText('URL1', '链接');
     $builder->keyText('TITLE1', '标题');
     $builder->keyRadio('TARGET1', '新窗口打开', '', array('_blank' => '新窗口', '_self' => '本窗口'));
     $builder->group('幻灯片1', 'PIC1,URL1,TITLE1,TARGET1');
     $builder->keySingleImage('PIC2', '图片');
     $builder->keyText('URL2', '链接');
     $builder->keyText('TITLE2', '标题');
     $builder->keyRadio('TARGET2', '新窗口打开', '', array('_blank' => '新窗口', '_self' => '本窗口'));
     $builder->group('幻灯片2', 'PIC2,URL2,TITLE2,TARGET2');
     $builder->keySingleImage('PIC3', '图片');
     $builder->keyText('URL3', '链接');
     $builder->keyText('TITLE3', '标题');
     $builder->keyRadio('TARGET3', '新窗口打开', '', array('_blank' => '新窗口', '_self' => '本窗口'));
     $builder->group('幻灯片3', 'PIC3,URL3,TITLE3,TARGET3');
     $show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home');
     $builder->buttonSubmit();
     $builder->data($data);
     $builder->display();
 }
示例#19
0
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1;
     $builder->title(L('_HOME_SETTING_'));
     $modules = D('Common/Module')->getAll();
     foreach ($modules as $m) {
         if ($m['is_setup'] == 1 && $m['entry'] != '') {
             if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) {
                 $module[] = array('data-id' => $m['name'], 'title' => $m['alias']);
             }
         }
     }
     $module[] = array('data-id' => 'slider', 'title' => L('_CAROUSEL_'));
     $default = array(array('data-id' => 'disable', 'title' => L('_DISABLED_'), 'items' => $module), array('data-id' => 'enable', 'title' => L('_ENABLED_'), 'items' => array()));
     $builder->keyKanban('BLOCK', L('_DISPLAY_BLOCK_'), L('_TIP_DISPLAY_BLOCK_'));
     $data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default);
     $builder->group(L('_DISPLAY_BLOCK_'), 'BLOCK');
     $builder->keySingleImage('PIC1', L('_PICTURE_'));
     $builder->keyText('URL1', L('_LINK_'));
     $builder->keyText('TITLE1', L('_TITLE_'));
     $builder->keyRadio('TARGET1', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_')));
     $builder->group(L('_SLIDE1_'), 'PIC1,URL1,TITLE1,TARGET1');
     $builder->keySingleImage('PIC2', L('_PICTURE_'));
     $builder->keyText('URL2', L('_LINK_'));
     $builder->keyText('TITLE2', L('_TITLE_'));
     $builder->keyRadio('TARGET2', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_')));
     $builder->group(L('_SLIDE2_'), 'PIC2,URL2,TITLE2,TARGET2');
     $builder->keySingleImage('PIC3', L('_PICTURE_'));
     $builder->keyText('URL3', L('_LINK_'));
     $builder->keyText('TITLE3', L('_TITLE_'));
     $builder->keyRadio('TARGET3', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_')));
     $builder->group(L('_SLIDE3_'), 'PIC3,URL3,TITLE3,TARGET3');
     $show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home');
     $builder->buttonSubmit();
     $builder->data($data);
     $builder->display();
 }
    public function index()
    {
        $admin_config = new AdminConfigBuilder();
        $data = $admin_config->handleConfig();
        $mStep = A('Ucenter/RegStep', 'Widget')->mStep;
        $step = array();
        foreach ($mStep as $key => $v) {
            $step[] = array('data-id' => $key, 'title' => $v);
        }
        $default = array(array('data-id' => 'disable', 'title' => L('_DISABLE_'), 'items' => $step), array('data-id' => 'enable', 'title' => L('_ENABLE_'), 'items' => array()));
        //$default=array(L('_DISABLE_')=>$step,L('_ENABLE_AND_SKIP_')=>array(),L('_ENABLE_BUT_NOT_SKIP_')=>array());
        $data['REG_STEP'] = $admin_config->parseKanbanArray($data['REG_STEP'], $step, $default);
        empty($data['LEVEL']) && ($data['LEVEL'] = <<<str
0:Lv1 实习
50:Lv2 试用
100:Lv3 转正
200:Lv4 助理
400:Lv 5 经理
800:Lv6 董事
1600:Lv7 董事长
str
);
        empty($data['OPEN_QUICK_LOGIN']) && ($data['OPEN_QUICK_LOGIN'] = 0);
        empty($data['LOGIN_SWITCH']) && ($data['LOGIN_SWITCH'] = 'username');
        $addons = \Think\Hook::get('sms');
        $opt = array('none' => L('_NONE_'));
        foreach ($addons as $name) {
            if (class_exists($name)) {
                $class = new $name();
                $config = $class->getConfig();
                if ($config['switch']) {
                    $opt[$class->info['name']] = $class->info['title'];
                }
            }
        }
        $admin_config->title(L('_USER_CONFIGURATION_'))->data($data)->keyCheckBox('REG_SWITCH', L('_REGISTRATION_SWITCH_'), L('_THE_REGISTRATION_OPTION_THAT_ALLOWS_THE_USE_OF_THE_REGISTRATION_IS_CLOSED_'), array('username' => L('_USER_NAME_'), 'email' => L('_MAILBOX_'), 'mobile' => L('_MOBILE_PHONE_')))->keyRadio('EMAIL_VERIFY_TYPE', L('_MAILBOX_VERIFICATION_TYPE_'), L('_TYPE_MAILBOX_VERIFICATION_'), array(0 => L('_NOT_VERIFIED_'), 1 => L('_POST_REGISTRATION_ACTIVATION_MAIL_'), 2 => L('_EMAIL_VERIFY_SEND_BEFORE_REG_')))->keyRadio('MOBILE_VERIFY_TYPE', L('_MOBILE_VERIFICATION_TYPE_'), L('_TYPE_OF_CELL_PHONE_VERIFICATION_'), array(0 => L('_NOT_VERIFIED_'), 1 => L('_REGISTER_BEFORE_SENDING_A_VALIDATION_MESSAGE_')))->keyText('NEW_USER_FOLLOW', L('_NEW_USER_ATTENTION_'), L('_ID_INPUT_SEPARATE_COMMA_'))->keyText('NEW_USER_FANS', L('_NEW_USER_FANS_'), L('_ID_INPUT_SEPARATE_COMMA_'))->keyText('NEW_USER_FRIENDS', L('_NEW_FRIENDS_'), L('_ID_INPUT_SEPARATE_COMMA_'))->keyKanban('REG_STEP', L('_REGISTRATION_STEP_'), L('_STEPS_TO_BE_MADE_AFTER_REGISTRATION_'))->keyCheckBox('REG_CAN_SKIP', L('_WHETHER_THE_REGISTRATION_STEP_CAN_BE_SKIPPED_'), L('_CHECK_TO_SKIP_AND_YOU_CANT_SKIP_THE_DEFAULT_'), $mStep)->keyEditor('REG_EMAIL_VERIFY', L('_MAILBOX_VERIFICATION_TEMPLATE_'), L('_PLEASE_EMAIL_VERIFY_'), 'all')->keyEditor('REG_EMAIL_ACTIVATE', L('_MAILBOX_ACTIVATION_TEMPLATE_'), L('_PLEASE_USER_ACTIVE_'))->keySelect('SMS_HOOK', L('_SMS_SENDING_SERVICE_PROVIDER_'), L('_SMS_SEND_SERVICE_PROVIDERS_NEED_TO_INSTALL_THE_PLUG-IN_'), $opt)->keyText('SMS_RESEND', L('_THE_MESSAGE_RETRANSMISSION_TIME_'), L('_THE_MESSAGE_RETRANSMISSION_TIME_'))->keyText('SMS_UID', L('_SMS_PLATFORM_ACCOUNT_NUMBER_'), L('_SMS_PLATFORM_ACCOUNT_NUMBER_'))->keyText('SMS_PWD', L('_SMS_PLATFORM_PASSWORD_'), L('_SMS_PLATFORM_PASSWORD_'))->keyTextArea('SMS_CONTENT', L('_MESSAGE_CONTENT_'), L('_MSG_VERICODE_ACCOUNT_'))->keyTextArea('LEVEL', L('_HIERARCHY_'), L('_ONE_PER_LINE_BETWEEN_THE_NAME_AND_THE_INTEGRAL_BY_A_COLON_'))->keyInteger('NICKNAME_MIN_LENGTH', L('_NICKNAME_LENGTH_MINIMUM_'))->keyDefault('NICKNAME_MIN_LENGTH', 2)->keyInteger('NICKNAME_MAX_LENGTH', L('_NICKNAME_LENGTH_MAXIMUM_'))->keyDefault('NICKNAME_MAX_LENGTH', 32)->keyInteger('USERNAME_MIN_LENGTH', L('_USERNAME_LENGTH_MINIMUM_'))->keyDefault('USERNAME_MIN_LENGTH', 2)->keyInteger('USERNAME_MAX_LENGTH', L('_USERNAME_LENGTH_MAXIMUM_'))->keyDefault('USERNAME_MAX_LENGTH', 32)->keyRadio('OPEN_QUICK_LOGIN', L('_QUICK_LOGIN_'), L('_BY_DEFAULT_AFTER_THE_USER_IS_LOGGED_IN_THE_USER_IS_LOGGED_IN_'), array(0 => L('_OFF_'), 1 => L('_OPEN_')))->keyCheckBox('LOGIN_SWITCH', L('_LOGIN_PROMPT_SWITCH_'), L('_JUST_THE_TIP_OF_THE_LOGIN_BOX_'), array('username' => L('_USER_NAME_'), 'email' => L('_MAILBOX_'), 'mobile' => L('_MOBILE_PHONE_')))->group(L('_REGISTER_CONFIGURATION_'), 'REG_SWITCH,EMAIL_VERIFY_TYPE,MOBILE_VERIFY_TYPE,REG_STEP,REG_CAN_SKIP,NEW_USER_FOLLOW,NEW_USER_FANS,NEW_USER_FRIENDS')->group(L('_LOGIN_CONFIGURATION_'), 'OPEN_QUICK_LOGIN,LOGIN_SWITCH')->group(L('_MAILBOX_VERIFICATION_TEMPLATE_'), 'REG_EMAIL_VERIFY')->group(L('_MAILBOX_ACTIVATION_TEMPLATE_'), 'REG_EMAIL_ACTIVATE')->group(L('_SMS_CONFIGURATION_'), 'SMS_HTTP,SMS_UID,SMS_PWD,SMS_CONTENT,SMS_HOOK,SMS_RESEND')->group(L('_BASIC_SETTINGS_'), 'LEVEL,NICKNAME_MIN_LENGTH,NICKNAME_MAX_LENGTH,USERNAME_MIN_LENGTH,USERNAME_MAX_LENGTH')->buttonSubmit('', L('_SAVE_'))->keyDefault('REG_EMAIL_VERIFY', L('_VERICODE_ACCOUNT_') . L('_PERIOD_'))->keyDefault('REG_EMAIL_ACTIVATE', L('_LINK_ACTIVE_IS_'))->keyDefault('SMS_CONTENT', L('_VERICODE_ACCOUNT_'))->keyDefault('SMS_RESEND', '60');
        $admin_config->display();
    }
    public function index()
    {
        $admin_config = new AdminConfigBuilder();
        $data = $admin_config->handleConfig();
        $mStep = A('Ucenter/RegStep', 'Widget')->mStep;
        $step = array();
        foreach ($mStep as $key => $v) {
            $step[] = array('data-id' => $key, 'title' => $v);
        }
        $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $step), array('data-id' => 'enable', 'title' => '启用', 'items' => array()));
        //$default=array('禁用'=>$step,'启用并可跳过'=>array(),'启用但不可跳过'=>array());
        $data['REG_STEP'] = $admin_config->parseKanbanArray($data['REG_STEP'], $step, $default);
        empty($data['LEVEL']) && ($data['LEVEL'] = <<<str
0:Lv1 实习
50:Lv2 试用
100:Lv3 转正
200:Lv4 助理
400:Lv 5 经理
800:Lv6 董事
1600:Lv7 董事长
str
);
        empty($data['OPEN_QUICK_LOGIN']) && ($data['OPEN_QUICK_LOGIN'] = 0);
        empty($data['LOGIN_SWITCH']) && ($data['LOGIN_SWITCH'] = 'username');
        $addons = \Think\Hook::get('sms');
        $opt = array('none' => '无');
        foreach ($addons as $name) {
            if (class_exists($name)) {
                $class = new $name();
                $config = $class->getConfig();
                if ($config['switch']) {
                    $opt[$class->info['name']] = $class->info['title'];
                }
            }
        }
        $admin_config->title('用户配置')->data($data)->keyCheckBox('REG_SWITCH', '注册开关', '允许使用的注册选项,全不选即为关闭注册', array('username' => '用户名', 'email' => '邮箱', 'mobile' => '手机'))->keyRadio('EMAIL_VERIFY_TYPE', '邮箱验证类型', '邮箱验证的类型', array(0 => '不验证', 1 => '注册后发送激活邮件', 2 => '注册前发送验证邮件'))->keyRadio('MOBILE_VERIFY_TYPE', '手机验证类型', '手机验证的类型', array(0 => '不验证', 1 => '注册前发送验证短信'))->keyText('NEW_USER_FOLLOW', '新用户关注', '输入用户id,多个用户以‘,’分割')->keyText('NEW_USER_FANS', '新用户粉丝', '输入用户id,多个用户以‘,’分割')->keyText('NEW_USER_FRIENDS', '新用户好友', '输入用户id,多个用户以‘,’分割')->keyKanban('REG_STEP', '注册步骤', '注册后需要进行的步骤')->keyCheckBox('REG_CAN_SKIP', '注册步骤是否可跳过', '勾选为可跳过,默认不可跳过', $mStep)->keyEditor('REG_EMAIL_VERIFY', '邮箱验证模版', '用于进行邮箱的验证,必填{$verify}验证码,{$account}账号', 'all')->keyEditor('REG_EMAIL_ACTIVATE', '邮箱激活模版', '用于进行用户的激活,必填{$url}激活链接,{$title}网站名称')->keySelect('SMS_HOOK', '短信发送服务商', '短信发送服务商,需要安装插件', $opt)->keyText('SMS_RESEND', '短信重发时间', '短信重发时间')->keyText('SMS_UID', '短信平台帐号', '短信平台帐号')->keyText('SMS_PWD', '短信平台密码', '短信平台密码')->keyTextArea('SMS_CONTENT', '短信内容', '短信内容,必填{$verify}验证码,{$account}账号')->keyTextArea('LEVEL', '等级配置', '每行一条,名称和积分之间用冒号分隔')->keyInteger('NICKNAME_MIN_LENGTH', '昵称长度最小值')->keyDefault('NICKNAME_MIN_LENGTH', 2)->keyInteger('NICKNAME_MAX_LENGTH', '昵称长度最大值')->keyDefault('NICKNAME_MAX_LENGTH', 32)->keyInteger('USERNAME_MIN_LENGTH', '用户名长度最小值')->keyDefault('USERNAME_MIN_LENGTH', 2)->keyInteger('USERNAME_MAX_LENGTH', '用户名长度最大值')->keyDefault('USERNAME_MAX_LENGTH', 32)->keyRadio('OPEN_QUICK_LOGIN', '快捷登录', '默认关闭,开启后用户登录方式更换成快捷登录!', array(0 => '关闭', 1 => '开启'))->keyCheckBox('LOGIN_SWITCH', '登录提示开关', '仅用于登录框的提示作用', array('username' => '用户名', 'email' => '邮箱', 'mobile' => '手机'))->group('注册配置', 'REG_SWITCH,EMAIL_VERIFY_TYPE,MOBILE_VERIFY_TYPE,REG_STEP,REG_CAN_SKIP,NEW_USER_FOLLOW,NEW_USER_FANS,NEW_USER_FRIENDS')->group('登录配置', 'OPEN_QUICK_LOGIN,LOGIN_SWITCH')->group('邮箱验证模版', 'REG_EMAIL_VERIFY')->group('邮箱激活模版', 'REG_EMAIL_ACTIVATE')->group('短信配置', 'SMS_HTTP,SMS_UID,SMS_PWD,SMS_CONTENT,SMS_HOOK,SMS_RESEND')->group('基础设置', 'LEVEL,NICKNAME_MIN_LENGTH,NICKNAME_MAX_LENGTH,USERNAME_MIN_LENGTH,USERNAME_MAX_LENGTH')->buttonSubmit('', '保存')->keyDefault('REG_EMAIL_VERIFY', '您的验证码为{$verify}验证码,账号为{$account}。')->keyDefault('REG_EMAIL_ACTIVATE', '您在{$title}的激活链接为<a href="{$url}" target="_blank">激活</a>,或者请复制链接:{$url}到浏览器打开。')->keyDefault('SMS_CONTENT', '您的校验码为{$verify},注册账号为{$account}')->keyDefault('SMS_RESEND', '60');
        $admin_config->display();
    }
示例#22
0
 public function editRule($id = null)
 {
     //判断是否为编辑模式
     $isEdit = $id ? true : false;
     //读取规则内容
     if ($isEdit) {
         $rule = M('SeoRule')->where(array('id' => $id))->find();
     } else {
         $rule = array('status' => 1);
     }
     //
     $rule['action2'] = $rule['action'];
     //显示页面
     $builder = new AdminConfigBuilder();
     $modules = D('Module')->getAll();
     $app = array('' => '-所有模块-');
     foreach ($modules as $m) {
         if ($m['is_setup']) {
             $app[$m['name']] = $m['alias'];
         }
     }
     $builder->title($isEdit ? '编辑规则' : '添加规则')->keyId()->keyText('title', '名称', '规则名称,方便记忆')->keySelect('app', '模块名称', '不填表示所有模块', $app)->keyText('controller', '控制器', '不填表示所有控制器')->keyText('action2', '方法', '不填表示所有方法')->keyText('seo_title', 'SEO标题', '不填表示使用下一条规则,支持变量')->keyText('seo_keywords', 'SEO关键字', '不填表示使用下一条规则,支持变量')->keyTextArea('seo_description', 'SEO描述', '不填表示使用下一条规则,支持变量')->keyStatus()->data($rule)->buttonSubmit(U('doEditRule'))->buttonBack()->display();
 }
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('基本设置');
     $data['USER_SHOW_TITLE1'] = $data['USER_SHOW_TITLE1'] ? $data['USER_SHOW_TITLE1'] : '活跃会员';
     $data['USER_SHOW_COUNT1'] = $data['USER_SHOW_COUNT1'] ? $data['USER_SHOW_COUNT1'] : 5;
     $data['USER_SHOW_ORDER_FIELD1'] = $data['USER_SHOW_ORDER_FIELD1'] ? $data['USER_SHOW_ORDER_FIELD1'] : 'score1';
     $data['USER_SHOW_ORDER_TYPE1'] = $data['USER_SHOW_ORDER_TYPE1'] ? $data['USER_SHOW_ORDER_TYPE1'] : 'desc';
     $data['USER_SHOW_CACHE_TIME1'] = $data['USER_SHOW_CACHE_TIME1'] ? $data['USER_SHOW_CACHE_TIME1'] : '600';
     $data['USER_SHOW_TITLE2'] = $data['USER_SHOW_TITLE2'] ? $data['USER_SHOW_TITLE2'] : '最新会员';
     $data['USER_SHOW_COUNT2'] = $data['USER_SHOW_COUNT2'] ? $data['USER_SHOW_COUNT2'] : 5;
     $data['USER_SHOW_ORDER_FIELD2'] = $data['USER_SHOW_ORDER_FIELD2'] ? $data['USER_SHOW_ORDER_FIELD2'] : 'reg_time';
     $data['USER_SHOW_ORDER_TYPE2'] = $data['USER_SHOW_ORDER_TYPE2'] ? $data['USER_SHOW_ORDER_TYPE2'] : 'desc';
     $data['USER_SHOW_CACHE_TIME2'] = $data['USER_SHOW_CACHE_TIME2'] ? $data['USER_SHOW_CACHE_TIME2'] : '600';
     $score = D("Ucenter/Score")->getTypeList(array('status' => 1));
     $order['reg_time'] = '注册时间';
     $order['last_login_time'] = '最后登录时间';
     foreach ($score as $s) {
         $order['score' . $s['id']] = '【' . $s['title'] . '】';
     }
     $builder->keyText('USER_SHOW_TITLE1', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT1', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD1', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE1', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME1', '缓存时间', '默认600秒,以秒为单位');
     $builder->keyText('USER_SHOW_TITLE2', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT2', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD2', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE2', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME2', '缓存时间', '默认600秒,以秒为单位');
     $builder->group('首页展示左侧栏', 'USER_SHOW_TITLE1,USER_SHOW_COUNT1,USER_SHOW_ORDER_FIELD1,USER_SHOW_ORDER_TYPE1,USER_SHOW_CACHE_TIME1');
     $builder->group('首页展示右侧栏', 'USER_SHOW_TITLE2,USER_SHOW_COUNT2,USER_SHOW_ORDER_FIELD2,USER_SHOW_ORDER_TYPE2,USER_SHOW_CACHE_TIME2');
     $builder->data($data);
     $builder->buttonSubmit();
     $builder->display();
 }
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1;
     $builder->title(L('_HOME_SETTING_'));
     $modules = D('Common/Module')->getAll();
     foreach ($modules as $m) {
         if ($m['is_setup'] == 1 && $m['entry'] != '') {
             if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) {
                 $module[] = array('data-id' => $m['name'], 'title' => $m['alias']);
             }
         }
     }
     $module[] = array('data-id' => 'slider', 'title' => L('_CAROUSEL_'));
     $default = array(array('data-id' => 'disable', 'title' => L('_DISABLED_'), 'items' => $module), array('data-id' => 'enable', 'title' => L('_ENABLED_'), 'items' => array()));
     $builder->keyKanban('BLOCK', L('_DISPLAY_BLOCK_'), L('_TIP_DISPLAY_BLOCK_'));
     $data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default);
     $builder->group(L('_DISPLAY_BLOCK_'), 'BLOCK');
     $show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home');
     $builder->buttonSubmit();
     $builder->data($data);
     $builder->display();
 }
 /**
  * 编辑用户邀请信息
  * @author 郑钟良<*****@*****.**>
  */
 public function editUserInfo()
 {
     $aId = I('id', 0, 'intval');
     if ($aId <= 0) {
         $this->error(L('_PARAMETER_ERROR_'));
     }
     if (IS_POST) {
         $data['num'] = I('num', 0, 'intval');
         $data['already_num'] = I('already_num', 0, 'intval');
         $data['success_num'] = I('success_num', 0, 'intval');
         if ($data['num'] < 0 || $data['already_num'] < 0 || $data['success_num'] < 0) {
             $this->error(L('_PLEASE_FILL_IN_THE_CORRECT_DATA_'));
         }
         $result = $this->inviteUserInfoModel->saveData($data, $aId);
         if ($result) {
             $this->success(L('_EDITOR_SUCCESS_'), U('Admin/Invite/userInfo'));
         } else {
             $this->error(L('_EDIT_FAILED_'));
         }
     } else {
         $map['id'] = $aId;
         $data = $this->inviteUserInfoModel->getInfo($map);
         $builder = new AdminConfigBuilder();
         $builder->title(L('_EDIT_USER_INVITATION_INFORMATION_'))->keyId()->keyReadOnly('uid', L('_USER_ID_'))->keyReadOnly('invite_type', L('_INVITATION_CODE_TYPE_ID_'))->keyInteger('num', L('_AVAILABLE_'))->keyInteger('already_num', L('_INVITED_PLACES_'))->keyInteger('success_num', L('_SUCCESSFUL_INVITATION_'))->data($data)->buttonSubmit()->buttonBack()->display();
     }
 }
 /**
  * 编辑用户邀请信息
  * @author 郑钟良<*****@*****.**>
  */
 public function editUserInfo()
 {
     $aId = I('id', 0, 'intval');
     if ($aId <= 0) {
         $this->error('参数错误!');
     }
     if (IS_POST) {
         $data['num'] = I('num', 0, 'intval');
         $data['already_num'] = I('already_num', 0, 'intval');
         $data['success_num'] = I('success_num', 0, 'intval');
         if ($data['num'] < 0 || $data['already_num'] < 0 || $data['success_num'] < 0) {
             $this->error('请填入正确数据!');
         }
         $result = $this->inviteUserInfoModel->saveData($data, $aId);
         if ($result) {
             $this->success('编辑成功!', U('Admin/Invite/userInfo'));
         } else {
             $this->error('编辑失败!');
         }
     } else {
         $map['id'] = $aId;
         $data = $this->inviteUserInfoModel->getInfo($map);
         $builder = new AdminConfigBuilder();
         $builder->title('编辑用户邀请信息')->keyId()->keyReadOnly('uid', '用户id')->keyReadOnly('invite_type', '邀请码类型id')->keyInteger('num', '可邀请名额')->keyInteger('already_num', '已邀请名额')->keyInteger('success_num', '成功邀请名额')->data($data)->buttonSubmit()->buttonBack()->display();
     }
 }
 public function editScoreType()
 {
     $aId = I('id', 0, 'intval');
     $model = D('Ucenter/Score');
     if (IS_POST) {
         $data['title'] = I('post.title', '', 'op_t');
         $data['status'] = I('post.status', 1, 'intval');
         $data['unit'] = I('post.unit', '', 'op_t');
         if ($aId != 0) {
             $data['id'] = $aId;
             $res = $model->editType($data);
         } else {
             $res = $model->addType($data);
         }
         if ($res) {
             $this->success(($aId == 0 ? L('_ADD_') : L('_EDIT_')) . L('_SUCCESS_'));
         } else {
             $this->error(($aId == 0 ? L('_ADD_') : L('_EDIT_')) . L('_FAILURE_'));
         }
     } else {
         $builder = new AdminConfigBuilder();
         if ($aId != 0) {
             $type = $model->getType(array('id' => $aId));
         } else {
             $type = array('status' => 1, 'sort' => 0);
         }
         $builder->title(($aId == 0 ? L('_NEW_') : L('_EDIT_')) . L('_INTEGRAL_CLASSIFICATION_'))->keyId()->keyText('title', L('_NAME_'))->keyText('unit', L('_UNIT_'))->keySelect('status', L('_STATUS_'), null, array(-1 => L('_DELETE_'), 0 => L('_DISABLE_'), 1 => L('_ENABLE_')))->data($type)->buttonSubmit(U('editScoreType'))->buttonBack()->display();
     }
 }
 public function editComment($id)
 {
     //读取评论内容
     $model = M('WeiboComment');
     $comment = $model->where(array('id' => $id))->find();
     //显示页面
     $builder = new AdminConfigBuilder();
     $builder->title('编辑评论')->keyId()->keyTextArea('content', '内容')->keyCreateTime()->keyStatus()->data($comment)->buttonSubmit(U('doEditComment'))->buttonBack()->display();
 }
示例#29
0
 /**
  * 打开内容修改表单
  * @param  integer $id 内容id
  * @return void
  */
 public function content_edit($id)
 {
     if (!check_auth('editIssueContent')) {
         $this->error('抱歉,您不具备投稿权限。');
     }
     $issue_content = D('Issue/IssueContent')->find($id);
     if (!$issue_content) {
         $this->error('404 not found');
     }
     if (!check_auth('editIssueContent')) {
         //不是管理员则进行检测
         if ($issue_content['uid'] != is_login()) {
             $this->error('404 not found');
         }
     }
     $issue = D('Issue/Issue')->find($issue_content['issue_id']);
     $issues = D('Issue/Issue')->where(array('status' => 1, 'pid' => 0))->order('sort')->getField('id,title');
     $builder = new AdminConfigBuilder();
     $this->setTitle('修改文章');
     $builder->title('修改文章');
     $builder->keyId()->keyRelationSelect('issue_id', '分类', null, $issues, U('issue_list'), array('cat_0' => $issue['pid'], 'cat_1' => $issue_content['issue_id']))->keyText('title', '标题')->keySingleImage('cover_id', '封面图片')->keyText('url', '网址')->keyEditor('content', '内容');
     $builder->data($issue_content);
     $builder->buttonSubmit(U('content_post'))->buttonBack()->display();
 }
 /**
  * 编辑单页文章
  * @author 郑钟良<*****@*****.**>
  */
 public function editPaper()
 {
     $aId = I('id', 0, 'intval');
     $title = $aId ? "编辑" : "新增";
     if (IS_POST) {
         $aId && ($data['id'] = $aId);
         $data['uid'] = I('post.uid', get_uid(), 'intval');
         $data['title'] = I('post.title', '', 'text');
         $data['content'] = I('post.content', '', 'html');
         $data['category'] = I('post.category', 0, 'intval');
         $data['sort'] = I('post.sort', 0, 'intval');
         $data['status'] = I('post.status', 1, 'intval');
         if (!mb_strlen($data['title'], 'utf-8')) {
             $this->error('标题不能为空!');
         }
         $result = $this->paperModel->editData($data);
         if ($result) {
             $aId = $aId ? $aId : $result;
             $this->success($title . '成功!', U('Paper/editPaper', array('id' => $aId)));
         } else {
             $this->error($title . '失败!', $this->paperModel->getError());
         }
     } else {
         if ($aId) {
             $data = $this->paperModel->find($aId);
         }
         $category = $this->paperCategoryModel->getCategoryList(array('status' => array('egt', -1)));
         $options = array(0 => '无分类');
         foreach ($category as $val) {
             $options[$val['id']] = $val['title'];
         }
         $builder = new AdminConfigBuilder();
         $builder->title($title . '资讯')->data($data)->keyId()->keyReadOnly('uid', '发布者')->keyDefault('uid', get_uid())->keyText('title', '标题')->keyEditor('content', '内容', '', 'all', array('width' => '850px', 'height' => '600px'))->keySelect('category', '分类', '', $options)->keyInteger('sort', '排序')->keyDefault('sort', 0)->keyStatus()->keyDefault('status', 1)->buttonSubmit()->buttonBack()->display();
     }
 }