예제 #1
0
 /**
  * 单页配置
  * @author 郑钟良<*****@*****.**>\
  */
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('文章基础设置')->data($data);
     $builder->keyText('PAPER_CATEGORY_TITLE', '文章顶部标题')->keyDefault('PAPER_CATEGORY_TITLE', '介绍')->buttonSubmit()->buttonBack()->display();
 }
예제 #2
0
 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 config()
 {
     $admin_config = new AdminConfigBuilder();
     $data = $admin_config->handleConfig();
     $data['NEED_VERIFY'] = $data['NEED_VERIFY'] ? $data['NEED_VERIFY'] : 0;
     $data['DISPLAY_TYPE'] = $data['DISPLAY_TYPE'] ? $data['DISPLAY_TYPE'] : 'list';
     $data['ISSUE_SHOW_TITLE'] = $data['ISSUE_SHOW_TITLE'] ? $data['ISSUE_SHOW_TITLE'] : '最热专辑';
     $data['ISSUE_SHOW_COUNT'] = $data['ISSUE_SHOW_COUNT'] ? $data['ISSUE_SHOW_COUNT'] : 4;
     $data['ISSUE_SHOW_ORDER_FIELD'] = $data['ISSUE_SHOW_ORDER_FIELD'] ? $data['ISSUE_SHOW_ORDER_FIELD'] : 'view_count';
     $data['ISSUE_SHOW_ORDER_TYPE'] = $data['ISSUE_SHOW_ORDER_TYPE'] ? $data['ISSUE_SHOW_ORDER_TYPE'] : 'desc';
     $data['ISSUE_SHOW_CACHE_TIME'] = $data['ISSUE_SHOW_CACHE_TIME'] ? $data['ISSUE_SHOW_CACHE_TIME'] : '600';
     $admin_config->title('专辑基本设置')->keyBool('NEED_VERIFY', '投稿是否需要审核', '默认无需审核')->keyRadio('DISPLAY_TYPE', '默认展示形式', '前台列表默认以该形式展示', array('list' => '列表', 'masonry' => '瀑布流'))->buttonSubmit('', '保存')->data($data);
     $admin_config->keyText('ISSUE_SHOW_TITLE', '标题名称', '在首页展示块的标题');
     $admin_config->keyText('ISSUE_SHOW_COUNT', '显示专辑的个数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $admin_config->keyRadio('ISSUE_SHOW_ORDER_FIELD', '排序值', '展示模块的数据排序方式', array('view_count' => '阅读数', 'reply_count' => '回复数', 'create_time' => '发表时间', 'update_time' => '更新时间'));
     $admin_config->keyRadio('ISSUE_SHOW_ORDER_TYPE', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $admin_config->keyText('ISSUE_SHOW_CACHE_TIME', '缓存时间', '默认600秒,以秒为单位');
     $admin_config->group('基本配置', 'NEED_VERIFY,DISPLAY_TYPE')->group('首页展示配置', 'ISSUE_SHOW_COUNT,ISSUE_SHOW_TITLE,ISSUE_SHOW_ORDER_TYPE,ISSUE_SHOW_ORDER_FIELD,ISSUE_SHOW_CACHE_TIME');
     $admin_config->groupLocalComment('本地评论配置', 'issueContent');
     $admin_config->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();
 }
예제 #5
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();
 }
예제 #6
0
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->callback('configCallback')->handleConfig();
     $data['SHOW_TITLE'] = $data['SHOW_TITLE'] == null ? 1 : $data['SHOW_TITLE'];
     $data['HIGH_LIGHT_AT'] = $data['HIGH_LIGHT_AT'] == null ? 1 : $data['HIGH_LIGHT_AT'];
     $data['HIGH_LIGHT_TOPIC'] = $data['HIGH_LIGHT_TOPIC'] == null ? 1 : $data['HIGH_LIGHT_TOPIC'];
     $data['CAN_IMAGE'] = $data['CAN_IMAGE'] == null ? 1 : $data['CAN_IMAGE'];
     $data['CAN_TOPIC'] = $data['CAN_TOPIC'] == null ? 1 : $data['CAN_TOPIC'];
     $data['WEIBO_INFO'] = $data['WEIBO_INFO'] ? $data['WEIBO_INFO'] : '有什么新鲜事想告诉大家?';
     $data['WEIBO_NUM'] = $data['WEIBO_NUM'] ? $data['WEIBO_NUM'] : 140;
     $data['SHOW_COMMENT'] = $data['SHOW_COMMENT'] == null ? 1 : $data['SHOW_COMMENT'];
     $data['ACTIVE_USER'] = $data['ACTIVE_USER'] == null ? 1 : $data['ACTIVE_USER'];
     $data['ACTIVE_USER_COUNT'] = $data['ACTIVE_USER_COUNT'] ? $data['ACTIVE_USER_COUNT'] : 6;
     $data['NEWEST_USER'] = $data['NEWEST_USER'] == null ? 1 : $data['NEWEST_USER'];
     $data['NEWEST_USER_COUNT'] = $data['NEWEST_USER_COUNT'] ? $data['NEWEST_USER_COUNT'] : 6;
     $tab = array(array('data-id' => 'all', 'title' => '全站动态'), array('data-id' => 'concerned', 'title' => '我的关注'), array('data-id' => 'hot', 'title' => '热门微博'));
     $default = array(array('data-id' => 'enable', 'title' => '启用', 'items' => $tab), array('data-id' => 'disable', 'title' => '禁用', 'items' => array()));
     $data['WEIBO_DEFAULT_TAB'] = $builder->parseKanbanArray($data['WEIBO_DEFAULT_TAB'], $tab, $default);
     $scoreTypes = D('Ucenter/Score')->getTypeList(array('status' => 1));
     foreach ($scoreTypes as $val) {
         $types[$val['id']] = $val['title'];
     }
     $data['WEIBO_SHOW_TITLE1'] = $data['WEIBO_SHOW_TITLE1'] ? $data['WEIBO_SHOW_TITLE1'] : '最新微博';
     $data['WEIBO_SHOW_COUNT1'] = $data['WEIBO_SHOW_COUNT1'] ? $data['WEIBO_SHOW_COUNT1'] : 5;
     $data['WEIBO_SHOW_ORDER_FIELD1'] = $data['WEIBO_SHOW_ORDER_FIELD1'] ? $data['WEIBO_SHOW_ORDER_FIELD1'] : 'create_time';
     $data['WEIBO_SHOW_ORDER_TYPE1'] = $data['WEIBO_SHOW_ORDER_TYPE1'] ? $data['WEIBO_SHOW_ORDER_TYPE1'] : 'desc';
     $data['WEIBO_SHOW_CACHE_TIME1'] = $data['WEIBO_SHOW_CACHE_TIME1'] ? $data['WEIBO_SHOW_CACHE_TIME1'] : '600';
     $data['WEIBO_SHOW_TITLE2'] = $data['WEIBO_SHOW_TITLE2'] ? $data['WEIBO_SHOW_TITLE2'] : '热门微博';
     $data['WEIBO_SHOW_COUNT2'] = $data['WEIBO_SHOW_COUNT2'] ? $data['WEIBO_SHOW_COUNT2'] : 5;
     $data['WEIBO_SHOW_ORDER_FIELD2'] = $data['WEIBO_SHOW_ORDER_FIELD2'] ? $data['WEIBO_SHOW_ORDER_FIELD2'] : 'comment_count';
     $data['WEIBO_SHOW_ORDER_TYPE2'] = $data['WEIBO_SHOW_ORDER_TYPE2'] ? $data['WEIBO_SHOW_ORDER_TYPE2'] : 'desc';
     $data['WEIBO_SHOW_CACHE_TIME2'] = $data['WEIBO_SHOW_CACHE_TIME2'] ? $data['WEIBO_SHOW_CACHE_TIME2'] : '600';
     $order = array('create_time' => '发布时间', 'comment_count' => '评论数');
     $builder->keyText('WEIBO_SHOW_TITLE1', '标题名称', '在首页展示块的标题');
     $builder->keyText('WEIBO_SHOW_COUNT1', '显示微博数', '');
     $builder->keyRadio('WEIBO_SHOW_ORDER_FIELD1', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('WEIBO_SHOW_ORDER_TYPE1', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('WEIBO_SHOW_CACHE_TIME1', '缓存时间', '默认600秒,以秒为单位');
     $builder->keyText('WEIBO_SHOW_TITLE2', '标题名称', '在首页展示块的标题');
     $builder->keyText('WEIBO_SHOW_COUNT2', '显示微博数', '');
     $builder->keyRadio('WEIBO_SHOW_ORDER_FIELD2', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('WEIBO_SHOW_ORDER_TYPE2', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('WEIBO_SHOW_CACHE_TIME2', '缓存时间', '默认600秒,以秒为单位');
     $builder->title('微博基本设置')->data($data)->keySwitch('SHOW_TITLE', '是否在微博左侧显示等级')->keySwitch('HIGH_LIGHT_AT', '高亮AT某人')->keySwitch('HIGH_LIGHT_TOPIC', '高亮微博话题')->keyText('WEIBO_INFO', '微博发布框左上内容')->keyText('WEIBO_NUM', '微博字数限制')->keyText('HOT_LEFT', '热门微博取多少天以内的,以那天零点之后为准')->keyDefault('HOT_LEFT', 3)->keySwitch('CAN_IMAGE', '是否开启插入图片类型')->keySwitch('CAN_TOPIC', '是否开启插入话题类型')->keyRadio('COMMENT_ORDER', '微博评论列表顺序', '', array(0 => '时间倒序', 1 => '时间正序'))->keyRadio('SHOW_COMMENT', '微博评论列表默认显示或隐藏', '', array(0 => '隐藏', 1 => '显示'))->keyKanban('WEIBO_DEFAULT_TAB', '微博默认显示标签')->keySwitch('ACTIVE_USER', '活跃用户开关')->keySelect('ACTIVE_USER_ORDER', '活跃用户排序', '', $types)->keyText('ACTIVE_USER_COUNT', '活跃用户显示数量', '')->keyText('USE_TOPIC', '常用话题', '显示在微博发布按钮左边,用‘,’分隔')->keySwitch('NEWEST_USER', '最新用户开关')->keyText('NEWEST_USER_COUNT', '最新用户显示数量', '')->group('基本设置', 'SHOW_TITLE,WEIBO_NUM,WEIBO_DEFAULT_TAB,HIGH_LIGHT_AT,HIGH_LIGHT_TOPIC,WEIBO_INFO,HOT_LEFT')->group('微博类型设置', 'CAN_IMAGE,CAN_TOPIC')->group('微博评论设置', 'COMMENT_ORDER,SHOW_COMMENT')->group('微博右侧设置', 'ACTIVE_USER,ACTIVE_USER_ORDER,ACTIVE_USER_COUNT,NEWEST_USER,NEWEST_USER_COUNT')->group('话题设置', 'USE_TOPIC')->group('首页展示左侧栏', 'WEIBO_SHOW_TITLE1,WEIBO_SHOW_COUNT1,WEIBO_SHOW_ORDER_FIELD1,WEIBO_SHOW_ORDER_TYPE1,WEIBO_SHOW_CACHE_TIME1')->group('首页展示右侧栏', 'WEIBO_SHOW_TITLE2,WEIBO_SHOW_COUNT2,WEIBO_SHOW_ORDER_FIELD2,WEIBO_SHOW_ORDER_TYPE2,WEIBO_SHOW_CACHE_TIME2')->buttonSubmit('', '保存');
     $builder->display();
 }
예제 #7
0
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->callback('configCallback')->handleConfig();
     $data['SHOW_TITLE'] = $data['SHOW_TITLE'] == null ? 1 : $data['SHOW_TITLE'];
     $data['HIGH_LIGHT_AT'] = $data['HIGH_LIGHT_AT'] == null ? 1 : $data['HIGH_LIGHT_AT'];
     $data['HIGH_LIGHT_TOPIC'] = $data['HIGH_LIGHT_TOPIC'] == null ? 1 : $data['HIGH_LIGHT_TOPIC'];
     $data['CAN_IMAGE'] = $data['CAN_IMAGE'] == null ? 1 : $data['CAN_IMAGE'];
     $data['CAN_TOPIC'] = $data['CAN_TOPIC'] == null ? 1 : $data['CAN_TOPIC'];
     $data['WEIBO_INFO'] = $data['WEIBO_INFO'] ? $data['WEIBO_INFO'] : L('_TIP_WEIBO_INFO_') . L('_QUESTION_');
     $data['WEIBO_NUM'] = $data['WEIBO_NUM'] ? $data['WEIBO_NUM'] : 140;
     $data['SHOW_COMMENT'] = $data['SHOW_COMMENT'] == null ? 1 : $data['SHOW_COMMENT'];
     $data['ACTIVE_USER'] = $data['ACTIVE_USER'] == null ? 1 : $data['ACTIVE_USER'];
     $data['ACTIVE_USER_COUNT'] = $data['ACTIVE_USER_COUNT'] ? $data['ACTIVE_USER_COUNT'] : 6;
     $data['NEWEST_USER'] = $data['NEWEST_USER'] == null ? 1 : $data['NEWEST_USER'];
     $data['NEWEST_USER_COUNT'] = $data['NEWEST_USER_COUNT'] ? $data['NEWEST_USER_COUNT'] : 6;
     $tab = array(array('data-id' => 'all', 'title' => L('_ALL_WEBSITE_FOLLOW_')), array('data-id' => 'concerned', 'title' => L('_MY_FOLLOW_')), array('data-id' => 'hot', 'title' => L('_HOT_WEIBO_')));
     $default = array(array('data-id' => 'enable', 'title' => L('_ENABLE_'), 'items' => $tab), array('data-id' => 'disable', 'title' => L('_DISABLE_'), 'items' => array()));
     $data['WEIBO_DEFAULT_TAB'] = $builder->parseKanbanArray($data['WEIBO_DEFAULT_TAB'], $tab, $default);
     $scoreTypes = D('Ucenter/Score')->getTypeList(array('status' => 1));
     foreach ($scoreTypes as $val) {
         $types[$val['id']] = $val['title'];
     }
     $data['WEIBO_SHOW_TITLE1'] = $data['WEIBO_SHOW_TITLE1'] ? $data['WEIBO_SHOW_TITLE1'] : L('_NEWEST_WEIBO_');
     $data['WEIBO_SHOW_COUNT1'] = $data['WEIBO_SHOW_COUNT1'] ? $data['WEIBO_SHOW_COUNT1'] : 5;
     $data['WEIBO_SHOW_ORDER_FIELD1'] = $data['WEIBO_SHOW_ORDER_FIELD1'] ? $data['WEIBO_SHOW_ORDER_FIELD1'] : 'create_time';
     $data['WEIBO_SHOW_ORDER_TYPE1'] = $data['WEIBO_SHOW_ORDER_TYPE1'] ? $data['WEIBO_SHOW_ORDER_TYPE1'] : 'desc';
     $data['WEIBO_SHOW_CACHE_TIME1'] = $data['WEIBO_SHOW_CACHE_TIME1'] ? $data['WEIBO_SHOW_CACHE_TIME1'] : '600';
     $data['WEIBO_SHOW_TITLE2'] = $data['WEIBO_SHOW_TITLE2'] ? $data['WEIBO_SHOW_TITLE2'] : L('_HOT_WEIBO_');
     $data['WEIBO_SHOW_COUNT2'] = $data['WEIBO_SHOW_COUNT2'] ? $data['WEIBO_SHOW_COUNT2'] : 5;
     $data['WEIBO_SHOW_ORDER_FIELD2'] = $data['WEIBO_SHOW_ORDER_FIELD2'] ? $data['WEIBO_SHOW_ORDER_FIELD2'] : 'comment_count';
     $data['WEIBO_SHOW_ORDER_TYPE2'] = $data['WEIBO_SHOW_ORDER_TYPE2'] ? $data['WEIBO_SHOW_ORDER_TYPE2'] : 'desc';
     $data['WEIBO_SHOW_CACHE_TIME2'] = $data['WEIBO_SHOW_CACHE_TIME2'] ? $data['WEIBO_SHOW_CACHE_TIME2'] : '600';
     $order = array('create_time' => L('_DELIVER_TIME_'), 'comment_count' => L('_COMMENT_COUNT_'));
     $builder->keyText('WEIBO_SHOW_TITLE1', L('_TITLE_NAME_'), L('_HOME_BLOCK_TITLE_'));
     $builder->keyText('WEIBO_SHOW_COUNT1', L('_WEIBO_COUNT_SHOW_'), '');
     $builder->keyRadio('WEIBO_SHOW_ORDER_FIELD1', L('_SORT_VALUE_'), L('_TIP_SORT_TYPE_'), $order);
     $builder->keyRadio('WEIBO_SHOW_ORDER_TYPE1', L('_SORT_TYPE_'), L('_TIP_SORT_TYPE_'), array('desc' => L('_COUNTER_'), 'asc' => L('_DIRECT_')));
     $builder->keyText('WEIBO_SHOW_CACHE_TIME1', L('_CACHE_TIME_'), L('_TIP_CACHE_TIME_'));
     $builder->keyText('WEIBO_SHOW_TITLE2', L('_TITLE_NAME_'), L('_HOME_BLOCK_TITLE_'));
     $builder->keyText('WEIBO_SHOW_COUNT2', L('_WEIBO_COUNT_SHOW_'), '');
     $builder->keyRadio('WEIBO_SHOW_ORDER_FIELD2', L('_SORT_VALUE_'), L('_TIP_SORT_TYPE_'), $order);
     $builder->keyRadio('WEIBO_SHOW_ORDER_TYPE2', L('_SORT_TYPE_'), L('_TIP_SORT_TYPE_'), array('desc' => L('_COUNTER_'), 'asc' => L('_DIRECT_')));
     $builder->keyText('WEIBO_SHOW_CACHE_TIME2', L('_CACHE_TIME_'), L('_TIP_CACHE_TIME_'));
     $builder->title(L('_WEIBO_BASIC_SETTINGS_'))->data($data)->keySwitch('SHOW_TITLE', L('_RANK_SHOW_IN_LEFT_'))->keyBool('WEIBO_BR', L('_CONTENT_TYPE_OPEN_'), L('_SUPPORT_ENTER_SPACE_'))->keySwitch('HIGH_LIGHT_AT', L('_HIGHLIGHT_AT_SOMEBODY_'))->keySwitch('HIGH_LIGHT_TOPIC', L('_HIGHLIGHT_WEIBO_TOPIC_'))->keyText('WEIBO_INFO', L('_WEIBO_POST_BOX_UP_LEFT_CONTENT_'))->keyText('WEIBO_NUM', L('_WEIBO_WORDS_LIMIT_'))->keyText('HOT_LEFT', L('_HOT_WEIBO_RULE_'))->keyDefault('HOT_LEFT', 3)->keySwitch('CAN_IMAGE', L('_INSERT_PICTURE_TYPE_OPEN_CLOSE_'))->keySwitch('CAN_TOPIC', L('_INSERT_TOPIC_TYPE_OPEN_CLOSE_'))->keyRadio('COMMENT_ORDER', L('_WEIBO_COMMENTS_LIST_ORDER_'), '', array(0 => L('_TIME_COUNTER_'), 1 => L('_TIME_DIRECT_')))->keyRadio('SHOW_COMMENT', L('_WEIBO_COMMENTS_LIST_DEFAULT_SHOW_HIDE_'), '', array(0 => L('_HIDE_'), 1 => L('_SHOW_')))->keyKanban('WEIBO_DEFAULT_TAB', L('_WEIBO_SIGN_DEFAULT_'))->keySwitch('ACTIVE_USER', L('_ACTIVE_USER_SWITCH_'))->keySelect('ACTIVE_USER_ORDER', L('_ACTIVE_USER_SORT_'), '', $types)->keyText('ACTIVE_USER_COUNT', L('_ACTIVE_USER_SHOW_NUMBER_'), '')->keyText('USE_TOPIC', L('_TOPIC_USUAL_'), L('_SHOW_IN_BUTTON_LEFT_'))->keySwitch('NEWEST_USER', L('_USER_SWITCH_NEWEST_'))->keyText('NEWEST_USER_COUNT', L('_USER_SHOW_NUMBER_NEWEST_'), '')->keyDefault('WEIBO_BR', 0)->group(L('_BASIC_SETTINGS_'), 'SHOW_TITLE,WEIBO_NUM,WEIBO_BR,WEIBO_DEFAULT_TAB,HIGH_LIGHT_AT,HIGH_LIGHT_TOPIC,WEIBO_INFO,HOT_LEFT')->group(L('_SETTINGS_TYPE_'), 'CAN_IMAGE,CAN_TOPIC')->group(L('_SETTINGS_COMMENTS_'), 'COMMENT_ORDER,SHOW_COMMENT')->group(L('_SETTINGS_RIGHT_SIDE_'), 'ACTIVE_USER,ACTIVE_USER_ORDER,ACTIVE_USER_COUNT,NEWEST_USER,NEWEST_USER_COUNT')->group(L('_SETTINGS_TOPIC_'), 'USE_TOPIC')->group(L('_HOME_BLOCK_LEFT_'), 'WEIBO_SHOW_TITLE1,WEIBO_SHOW_COUNT1,WEIBO_SHOW_ORDER_FIELD1,WEIBO_SHOW_ORDER_TYPE1,WEIBO_SHOW_CACHE_TIME1')->group(L('_HOME_BLOCK_RIGHT_'), 'WEIBO_SHOW_TITLE2,WEIBO_SHOW_COUNT2,WEIBO_SHOW_ORDER_FIELD2,WEIBO_SHOW_ORDER_TYPE2,WEIBO_SHOW_CACHE_TIME2')->buttonSubmit('', L('_SAVE_'));
     $builder->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();
 }
예제 #9
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();
 }
예제 #10
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();
 }
예제 #11
0
 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 editAdv()
 {
     $advModel = D('Common/Adv');
     $aId = I('id', 0, 'intval');
     if ($aId != 0) {
         $adv = $advModel->find($aId);
         $aPosId = $adv['pos_id'];
     } else {
         $aPosId = I('get.pos_id', 0, 'intval');
     }
     $advPosModel = D('Common/AdvPos');
     $pos = $advPosModel->find($aPosId);
     if (IS_POST) {
         $adv['title'] = I('title', '', 'text');
         $adv['pos_id'] = $aPosId;
         $adv['url'] = I('url', '', 'text');
         $adv['sort'] = I('sort', 1, 'intval');
         $adv['status'] = I('status', 1, 'intval');
         $adv['create_time'] = I('create_time', '', 'intval');
         $adv['start_time'] = I('start_time', '', 'intval');
         $adv['end_time'] = I('end_time', '', 'intval');
         $adv['target'] = I('target', '', 'text');
         S('adv_list_' . $pos['name'] . $pos['path'], null);
         if ($pos['type'] == 2) {
             //todo 多图
             $aTitles = I('title', '', 'text');
             $aUrl = I('url', '', 'text');
             $aSort = I('sort', '', 'intval');
             $aStartTime = I('start_time', '', 'intval');
             $aEndTime = I('end_time', '', 'intval');
             $aTarget = I('target', '', 'text');
             $added = 0;
             $advModel->where(array('pos_id' => $aPosId))->delete();
             foreach (I('pic', 0, 'intval') as $key => $v) {
                 $data['pic'] = $v;
                 $data['target'] = $aTarget[$key];
                 $adv_temp['title'] = $aTitles[$key];
                 $adv_temp['pos_id'] = $adv['pos_id'];
                 $adv_temp['url'] = $aUrl[$key];
                 $adv_temp['sort'] = $aSort[$key];
                 $adv_temp['status'] = 1;
                 $adv_temp['create_time'] = time();
                 $adv_temp['start_time'] = $aStartTime[$key];
                 $adv_temp['end_time'] = $aEndTime[$key];
                 $adv_temp['target'] = $aTarget[$key];
                 $adv_temp['data'] = json_encode($data);
                 $result = $advModel->add($adv_temp);
                 if ($result !== false) {
                     $added++;
                 }
                 //todo添加
             }
             $this->success('成功改动' . $added . '个广告。');
         } else {
             switch ($pos['type']) {
                 case 1:
                     //todo 单图
                     $data['pic'] = I('pic', 0, 'intval');
                     $data['target'] = I('target', 0, 'text');
                     break;
                 case 3:
                     $data['text'] = I('text', '', 'text');
                     $data['text_color'] = I('text_color', '', 'text');
                     $data['text_font_size'] = I('text_font_size', '', 'text');
                     $data['target'] = I('target', 0, 'text');
                     //todo 文字
                     break;
                 case 4:
                     //todo 代码
                     $data['code'] = I('code', '', '');
                     break;
             }
             $adv['data'] = json_encode($data);
             if ($aId == 0) {
                 $result = $advModel->add($adv);
             } else {
                 $adv['id'] = $aId;
                 $result = $advModel->save($adv);
             }
             if ($result === false) {
                 $this->error('保存失败。');
             } else {
                 $this->success('保存成功。');
             }
         }
     } else {
         //快速添加广告位逻辑
         //todo 快速添加
         $builder = new AdminConfigBuilder();
         $adv['pos'] = $pos['title'] . '——' . $pos['name'] . '——' . $pos['path'];
         $adv['pos_id'] = $aPosId;
         $builder->keyReadOnly('pos', '所属广告位');
         $builder->keyReadOnly('pos_id', '广告位ID');
         $builder->keyId()->keyTitle('title', '广告说明');
         $builder->title($pos['title'] . '设置——' . $advPosModel->switchType($pos['type']));
         $builder->keyTime('start_time', '开始生效时间', '不设置则立即生效')->keyTime('end_time', '失效时间', '不设置则一直有效')->keyText('sort', '排序')->keyCreateTime()->keyStatus();
         $builder->buttonSubmit();
         $data = json_decode($adv['data'], true);
         if (!empty($data)) {
             $adv = array_merge($adv, $data);
         }
         if ($aId) {
             $builder->data($adv);
         } else {
             $builder->data(array('pos' => $adv['pos'], 'pos_id' => $aPosId));
         }
         switch ($pos['type']) {
             case 1:
                 //todo 单图
                 $builder->keySingleImage('pic', '图片', '选图上传,建议尺寸' . $pos['width'] . '*' . $pos['height']);
                 $builder->keyText('url', '链接地址');
                 $builder->keySelect('target', '打开方式', null, array('_blank' => '新窗口:_blank', '_self' => '当前层:_self', '_parent' => '父框架:_parent', '_top' => '整个框架:_top'));
                 break;
             case 2:
                 //todo 多图
                 break;
             case 3:
                 $builder->keyText('text', '文字内容', '广告展示文字');
                 $builder->keyText('url', '链接地址');
                 $builder->keyColor('text_color', '文字颜色', '文字颜色')->keyDefault('data[text_color]', '#000000');
                 $builder->keyText('text_font_size', '文字大小,需带单位,例如:14px')->keyDefault('data[text_font_size]', '12px');
                 $builder->keySelect('target', '打开方式', null, array('_blank' => '新窗口:_blank', '_self' => '当前层:_self', '_parent' => '父框架:_parent', '_top' => '整个框架:_top'));
                 //todo 文字
                 break;
             case 4:
                 //todo 代码
                 $builder->keyTextArea('code', '代码内容', '不对此字段进行过滤,可填写js、html');
                 break;
         }
         $builder->keyDefault('status', 1)->keyDefault('sort', 1);
         $builder->keyDefault('title', $pos['title'] . '的广告 ' . date('m月d日', time()) . ' 添加')->keyDefault('end_time', time() + 60 * 60 * 24 * 7);
         if ($pos['type'] == 2) {
             $this->_meta_title = $pos['title'] . '设置——' . $advPosModel->switchType($pos['type']);
             $adv['start_time'] = isset($adv['start_time']) ? $adv['start_time'] : time();
             $adv['end_time'] = isset($adv['end_time']) ? $adv['end_time'] : time() + 60 * 60 * 24 * 7;
             $adv['create_time'] = isset($adv['create_time']) ? $adv['create_time'] : time();
             $adv['sort'] = isset($adv['sort']) ? $adv['sort'] : 1;
             $adv['status'] = isset($adv['status']) ? $adv['status'] : 1;
             $advs = D('Adv')->where(array('pos_id' => $aPosId))->select();
             foreach ($advs as &$v) {
                 $data = json_decode($v['data'], true);
                 if (!empty($data)) {
                     $v = array_merge($v, $data);
                 }
             }
             unset($v);
             $this->assign('list', $advs);
             $this->assign('pos', $pos);
             $this->display('editslider');
         } else {
             $builder->display();
         }
     }
 }
 public function expandinfo_details($uid = 0)
 {
     if (IS_POST) {
         /* 修改积分 xjw129xjt(肖骏涛)*/
         $data = I('post.');
         foreach ($data as $key => $val) {
             if (substr($key, 0, 5) == 'score') {
                 $data_score[$key] = $val;
             }
         }
         unset($key, $val);
         $res = D('Member')->where(array('uid' => $data['id']))->save($data_score);
         foreach ($data_score as $key => $val) {
             $value = query_user(array($key), $data['id']);
             if ($val == $value[$key]) {
                 continue;
             }
             D('Ucenter/Score')->addScoreLog($data['id'], cut_str('score', $key, 'l'), 'to', $val, '', 0, get_nickname(is_login()) . L('_BACKGROUND_ADJUSTMENT_'));
             D('Ucenter/Score')->cleanUserCache($data['id'], cut_str('score', $key, 'l'));
         }
         unset($key, $val);
         /* 修改积分 end*/
         /*身份设置 zzl(郑钟良)*/
         $data_role = array();
         foreach ($data as $key => $val) {
             if ($key == 'role') {
                 $data_role = explode(',', $val);
             } else {
                 if (substr($key, 0, 4) == 'role') {
                     $data_role[] = $val;
                 }
             }
         }
         unset($key, $val);
         $this->_resetUserRole($uid, $data_role);
         $this->success(L('_SUCCESS_OPERATE_') . L('_EXCLAMATION_'));
         /*身份设置 end*/
     } else {
         $map['uid'] = $uid;
         $map['status'] = array('egt', 0);
         $member = M('Member')->where($map)->find();
         $member['id'] = $member['uid'];
         $member['username'] = query_user('username', $uid);
         //扩展信息查询
         $map_profile['status'] = 1;
         $field_group = D('field_group')->where($map_profile)->select();
         $field_group_ids = array_column($field_group, 'id');
         $map_profile['profile_group_id'] = array('in', $field_group_ids);
         $fields_list = D('field_setting')->where($map_profile)->getField('id,field_name,form_type');
         $fields_list = array_combine(array_column($fields_list, 'field_name'), $fields_list);
         $map_field['uid'] = $member['uid'];
         foreach ($fields_list as $key => $val) {
             $map_field['field_id'] = $val['id'];
             $field_data = D('field')->where($map_field)->getField('field_data');
             if ($field_data == null || $field_data == '') {
                 $member[$key] = '';
             } else {
                 $member[$key] = $field_data;
             }
             $member[$key] = $field_data;
         }
         $builder = new AdminConfigBuilder();
         $builder->title(L('_USER_EXPAND_INFO_DETAIL_'));
         $builder->meta_title = L('_USER_EXPAND_INFO_DETAIL_');
         $builder->keyId()->keyReadOnly('username', L('_USER_NAME_'))->keyReadOnly('nickname', L('_NICKNAME_'));
         $field_key = array('id', 'username', 'nickname');
         foreach ($fields_list as $vt) {
             $field_key[] = $vt['field_name'];
             $builder->keyReadOnly($vt['field_name'], $vt['field_name']);
         }
         /* 积分设置 xjw129xjt(肖骏涛)*/
         $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
         $score_key = array();
         foreach ($field as $vf) {
             $score_key[] = 'score' . $vf['id'];
             $builder->keyText('score' . $vf['id'], $vf['title']);
         }
         $score_data = D('Member')->where(array('uid' => $uid))->field(implode(',', $score_key))->find();
         $member = array_merge($member, $score_data);
         /*积分设置end*/
         $builder->data($member);
         /*身份设置 zzl(郑钟良)*/
         $already_role = D('UserRole')->where(array('uid' => $uid, 'status' => 1))->field('role_id')->select();
         if (count($already_role)) {
             $already_role = array_column($already_role, 'role_id');
         }
         $roleModel = D('Role');
         $role_key = array();
         $no_group_role = $roleModel->where(array('group_id' => 0, 'status' => 1))->select();
         if (count($no_group_role)) {
             $role_key[] = 'role';
             $no_group_role_options = $already_no_group_role = array();
             foreach ($no_group_role as $val) {
                 if (in_array($val['id'], $already_role)) {
                     $already_no_group_role[] = $val['id'];
                 }
                 $no_group_role_options[$val['id']] = $val['title'];
             }
             $builder->keyCheckBox('role', L('_ROLE_GROUP_NONE_'), L('_MULTI_OPTIONS_'), $no_group_role_options)->keyDefault('role', implode(',', $already_no_group_role));
         }
         $role_group = D('RoleGroup')->select();
         foreach ($role_group as $group) {
             $group_role = $roleModel->where(array('group_id' => $group['id'], 'status' => 1))->select();
             if (count($group_role)) {
                 $role_key[] = 'role' . $group['id'];
                 $group_role_options = $already_group_role = array();
                 foreach ($group_role as $val) {
                     if (in_array($val['id'], $already_role)) {
                         $already_group_role = $val['id'];
                     }
                     $group_role_options[$val['id']] = $val['title'];
                 }
                 $myJs = "\$('.group_list').last().children().last().append('<a class=\"btn btn-default\" id=\"checkFalse\">" . L('_SELECTION_CANCEL_') . "</a>');";
                 $myJs = $myJs . "\$('#checkFalse').click(";
                 $myJs = $myJs . "function(){ \$('input[type=\"radio\"]').attr(\"checked\",false)}";
                 $myJs = $myJs . ");";
                 $builder->keyRadio('role' . $group['id'], L('_ROLE_GROUP_', array('title' => $group['title'])), L('_ROLE_GROUP_VICE_'), $group_role_options)->keyDefault('role' . $group['id'], $already_group_role)->addCustomJs($myJs);
             }
         }
         /*身份设置 end*/
         $builder->group(L('_BASIC_SETTINGS_'), implode(',', $field_key));
         $builder->group(L('_SETTINGS_SCORE_'), implode(',', $score_key));
         $builder->group(L('_SETTINGS_ROLE_'), implode(',', $role_key));
         $builder->buttonSubmit('', L('_SAVE_'));
         $builder->buttonBack();
         $builder->display();
     }
 }
예제 #14
0
    /**
     * 创建新模块
     * @return void
     * @author swh <*****@*****.**>
     */
    public function create()
    {
        $module = array('name' => 'Example', 'alias' => '示例模块', 'version' => '1.0.0', 'icon' => 'code', 'summary' => '示例模块', 'developer' => 'admpub.com', 'website' => 'http://www.admpub.com', 'entry' => 'example/index/index', 'admin_entry' => 'admin/example/index', 'show_nav' => true, 'is_com' => false);
        if (IS_POST) {
            foreach ($module as $key => &$value) {
                $value = I('post.' . $key, '', 'text');
            }
            if (!preg_match('/^[a-z][\\w]*$/i', $module['name'])) {
                $this->error('模块英文名必须以字母开头,并且不能包含除了字母、数字、下划线以外的字符');
            }
            $module['show_nav'] = $module['show_nav'] ? 1 : 0;
            $module['is_com'] = $module['is_com'] ? 1 : 0;
            $name = ucfirst($module['name']);
            $modulePath = APP_PATH . $name . '/';
            if (is_dir($modulePath)) {
                $this->error('已经存在英文名为“' . $module['name'] . '”的模块。');
            }
            $dirs = array('Conf', 'Controller', 'Info', 'Model', 'Static/js', 'Static/css', 'View/default/Index');
            foreach ($dirs as $value) {
                if (!is_dir($modulePath . $value)) {
                    mkdir($modulePath . $value, TRUE, 0777);
                }
            }
            file_put_contents($modulePath . 'Conf/config.php', '<?php ' . PHP_EOL . "return array(\n    // 预先加载的标签库\n    'TAGLIB_PRE_LOAD' => 'OT\\TagLib\\Article,OT\\TagLib\\Think',\n\n    /* 主题设置 */\n    'DEFAULT_THEME' => 'default', // 默认模板主题名称\n\n    /* 模板相关配置 */\n    'TMPL_PARSE_STRING' => array(\n        '__STATIC__' => __ROOT__ . '/Public/static',\n        '__ADDONS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/Addons',\n        '__IMG__' => __ROOT__ . '/Application/'.MODULE_NAME   . '/Static/images',\n        '__CSS__' => __ROOT__ . '/Application/'.MODULE_NAME .'/Static/css',\n        '__JS__' => __ROOT__ . '/Application/'.MODULE_NAME. '/Static/js',\n        '__ZUI__' => __ROOT__ . '/Public/zui'\n    ),\n\n    'NEED_VERIFY'=>true,//此处控制默认是否需要审核,该配置项为了便于部署起见,暂时通过在此修改来设定。\n);");
            file_put_contents($modulePath . 'Controller/IndexController.class.php', '<?php
/**
 * 前台首页控制器
 * @author ' . $module['developer'] . '
 * generated by ' . date('Y-m-d H:i:s') . '
 */
namespace ' . $name . '\\Controller;
use Common\\Controller\\Base;

class IndexController extends Base {
	protected function _initialize() {
		parent::_initialize();
	}

	/**
	 * [index description]
	 * @return void
	 * @author ' . $module['developer'] . '
	 */
	public function index(){

		//your code at here.

		$this->display();
	}
}
');
            file_put_contents($modulePath . 'Controller/' . $name . 'Controller.class.php', '<?php
/**
 * 后台管理控制器
 * @author ' . $module['developer'] . '
 * generated by ' . date('Y-m-d H:i:s') . '
 */
namespace Admin\\Controller;

use Admin\\Builder\\AdminConfigBuilder;
use Admin\\Builder\\AdminListBuilder;
use Admin\\Builder\\AdminTreeListBuilder;

class ' . $name . 'Controller extends AdminController {
	protected function _initialize() {
		parent::_initialize();
	}

	/**
	 * 后台' . $module['alias'] . '首页
	 * @param integer $page 页码
	 * @param integer $rows 每页行数
	 * @return void
	 * @author ' . $module['developer'] . '
	 */
	public function index($page = 1, $rows = 10){
		$list = $map = array();
		$totalCount = 0;

		//因为此类继承于AdminController,所以用D函数时要使用“模块英文名/模型英文名”的格式调用该模块的模型实例,
		//否则它将会试图调用Admin模块下的模型实例,这点要特别注意。
		//$model = D(\'' . $name . '/' . $name . '\');
		//$list = $model->where($map)->page($page, $rows)->select();
		//$totalCount = $model->where($map)->count();

		//显示页面
		$builder = new AdminListBuilder();
		$attr[\'class\'] = \'btn ajax-post\';
		$attr[\'target-form\'] = \'ids\';

		$builder->title(\'' . $module['alias'] . '管理\')
			->setStatusUrl(U(\'setStatus\'))->buttonDisable(\'\', \'审核不通过\')->buttonDelete()
			->keyId()->keyLink(\'title\', \'标题\', \'' . $name . '/Index/detail?id=###\')
			->keyUid()->keyCreateTime()->keyStatus()
			->data($list)
			->pagination($totalCount, $rows)
			->display();
	}

	/**
	 * ' . $module['alias'] . '设置
	 * @return void
	 * @author ' . $module['developer'] . '
	 */
	public function config() {
		$builder = new AdminConfigBuilder();
		$data = $builder->handleConfig();

		$builder->title(\'' . $module['alias'] . '基本设置\')
			->keyBool(\'NEED_VERIFY\', \'投稿是否需要审核\', \'默认无需审核\')
			->buttonSubmit(\'\', \'保存\')->data($data);
		$builder->display();
	}

	/**
	 * 添加' . $module['alias'] . '
	 * @return void
	 * @author ' . $module['developer'] . '
	 */
	public function add($id = 0) {
		$id = intval($id);
		if (IS_POST) {
			if (false) {
				$this->error(\'添加失败\');
			}
			$this->success(\'添加成功\');
		} else {
			$builder = new AdminConfigBuilder();
			$opt = array();
			$data = array();
			$builder->title(\'新增' . $module['alias'] . '\')->keyId()->keyText(\'title\', \'标题\')
				->keySelect(\'pid\', \'父分类\', \'选择父级分类\', array(\'0\' => \'顶级分类\') + $opt)
				->keyStatus()->keyCreateTime()->keyUpdateTime()
				->data($data)
				->buttonSubmit(U(\'' . $name . '/add\'))->buttonBack()->display();
		}
	}


	/**
	 * 删除' . $module['alias'] . '
	 * @return void
	 * @author ' . $module['developer'] . '
	 */
	public function del($id = 0) {
		$id = intval($id);
		if (false) {
			$this->error(\'删除失败\');
		}
		$this->success(\'删除成功\');
	}
}
');
            file_put_contents($modulePath . 'Model/' . $name . 'Model.class.php', '<?php
/**
 * ' . $module['alias'] . '模型
 * @author ' . $module['developer'] . '
 * generated by ' . date('Y-m-d H:i:s') . '
 */
namespace ' . $name . '\\Model;
use Common\\Model\\Base;

class ' . $name . 'Model extends Base {

	//设置自动验证
    protected $_validate = array(
        //array(\'url\',\'require\',\'url必须填写\'),
    );

	//设置指定填值
    protected $_auto = array(
        //array(\'create_time\', NOW_TIME, self::MODEL_INSERT),
    );

	protected function _initialize() {
		parent::_initialize();
	}
}
');
            $module['can_uninstall'] = 1;
            $dumped = var_export($module, TRUE);
            file_put_contents($modulePath . 'Info/info.php', '<?php ' . PHP_EOL . 'return ' . $dumped . ';');
            file_put_contents($modulePath . 'Info/install.sql', '-- 安装模块sql' . PHP_EOL . PHP_EOL . PHP_EOL);
            file_put_contents($modulePath . 'Info/uninstall.sql', '-- 卸载模块sql' . PHP_EOL . PHP_EOL . PHP_EOL);
            file_put_contents($modulePath . 'View/default/Index/index.html', '<extend name="Base/common"/>
<block name="style">
    <link href="__CSS__/' . $module['name'] . '.css" rel="stylesheet" type="text/css"/>
</block>
<block name="body">
是的,你没有看错,本模块就是你创建的!:)
</block>
');
            file_put_contents($modulePath . 'Static/css/' . $module['name'] . '.css', '');
            $this->moduleModel->cleanModulesCache();
            $this->success('创建成功', U('lists'));
            return;
        }
        $builder = new AdminConfigBuilder();
        $builder->title('创建模块');
        $builder->keyText('name', L('模块英文名'), L('必须以字母开头,且整个名称只能由字母、数字、下划线构成'))->keyText('alias', L('模块中文名'))->keyText('version', L('版本号'))->keyText('icon', L('图标'))->keyTextArea('summary', L('模块简述'))->keyText('developer', L('开发者'))->keyText('website', L('官方网站'))->keyText('entry', L('前台入口'), L('支持U函数的网址'))->keyText('admin_entry', L('后台入口'), L('支持U函数的网址'))->keyBool('show_nav', L('显示在导航菜单中'))->keyBool('is_com', L('是否商业模块'));
        $module = array('name' => 'Example', 'alias' => '示例模块', 'version' => '1.0.0', 'icon' => 'code', 'summary' => '示例模块', 'developer' => 'admpub.com', 'website' => 'http://www.admpub.com', 'entry' => 'example/index/index', 'admin_entry' => 'admin/example/index', 'show_nav' => true, 'is_com' => false);
        $builder->data($module);
        $builder->buttonSubmit()->buttonBack()->display();
    }
예제 #15
0
 public function expandinfo_details($uid = 0)
 {
     if (IS_POST) {
         /* 修改积分 xjw129xjt(肖骏涛)*/
         $data = I('post.');
         foreach ($data as $key => $val) {
             if (substr($key, 0, 5) == 'score') {
                 $data_score[$key] = $val;
             }
         }
         unset($key, $val);
         $res = D('Member')->where(array('uid' => $data['id']))->save($data_score);
         foreach ($data_score as $key => $val) {
             $value = query_user(array($key), $data['id']);
             if ($val == $value[$key]) {
                 continue;
             }
             D('Ucenter/Score')->addScoreLog($data['id'], cut_str('score', $key, 'l'), 'to', $val, '', 0, get_nickname(is_login()) . '后台调整');
             D('Ucenter/Score')->cleanUserCache($data['id'], cut_str('score', $key, 'l'));
         }
         unset($key, $val);
         /* 修改积分 end*/
         /*身份设置 zzl(郑钟良)*/
         $data_role = array();
         foreach ($data as $key => $val) {
             if ($key == 'role') {
                 $data_role = explode(',', $val);
             } else {
                 if (substr($key, 0, 4) == 'role') {
                     $data_role[] = $val;
                 }
             }
         }
         unset($key, $val);
         $this->_resetUserRole($uid, $data_role);
         $this->success('操作成功!');
         /*身份设置 end*/
     } else {
         $map['uid'] = $uid;
         $map['status'] = array('egt', 0);
         $member = M('Member')->where($map)->find();
         $member['id'] = $member['uid'];
         $member['username'] = query_user('username', $uid);
         //扩展信息查询
         $map_profile['status'] = 1;
         $field_group = D('field_group')->where($map_profile)->select();
         $field_group_ids = array_column($field_group, 'id');
         $map_profile['profile_group_id'] = array('in', $field_group_ids);
         $fields_list = D('field_setting')->where($map_profile)->getField('id,field_name,form_type');
         $fields_list = array_combine(array_column($fields_list, 'field_name'), $fields_list);
         $map_field['uid'] = $member['uid'];
         foreach ($fields_list as $key => $val) {
             $map_field['field_id'] = $val['id'];
             $field_data = D('field')->where($map_field)->getField('field_data');
             if ($field_data == null || $field_data == '') {
                 $member[$key] = '';
             } else {
                 $member[$key] = $field_data;
             }
             $member[$key] = $field_data;
         }
         $builder = new AdminConfigBuilder();
         $builder->title("用户扩展资料详情");
         $builder->meta_title = '用户扩展资料详情';
         $builder->keyId()->keyReadOnly('username', "用户名称")->keyReadOnly('nickname', '昵称');
         $field_key = array('id', 'username', 'nickname');
         foreach ($fields_list as $vt) {
             $field_key[] = $vt['field_name'];
             $builder->keyReadOnly($vt['field_name'], $vt['field_name']);
         }
         /* 积分设置 xjw129xjt(肖骏涛)*/
         $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
         $score_key = array();
         foreach ($field as $vf) {
             $score_key[] = 'score' . $vf['id'];
             $builder->keyText('score' . $vf['id'], $vf['title']);
         }
         $score_data = D('Member')->where(array('uid' => $uid))->field(implode(',', $score_key))->find();
         $member = array_merge($member, $score_data);
         /*积分设置end*/
         $builder->data($member);
         /*身份设置 zzl(郑钟良)*/
         $already_role = D('UserRole')->where(array('uid' => $uid, 'status' => 1))->field('role_id')->select();
         if (count($already_role)) {
             $already_role = array_column($already_role, 'role_id');
         }
         $roleModel = D('Role');
         $role_key = array();
         $no_group_role = $roleModel->where(array('group_id' => 0, 'status' => 1))->select();
         if (count($no_group_role)) {
             $role_key[] = 'role';
             $no_group_role_options = $already_no_group_role = array();
             foreach ($no_group_role as $val) {
                 if (in_array($val['id'], $already_role)) {
                     $already_no_group_role[] = $val['id'];
                 }
                 $no_group_role_options[$val['id']] = $val['title'];
             }
             $builder->keyCheckBox('role', '无分组身份', '可以多选', $no_group_role_options)->keyDefault('role', implode(',', $already_no_group_role));
         }
         $role_group = D('RoleGroup')->select();
         foreach ($role_group as $group) {
             $group_role = $roleModel->where(array('group_id' => $group['id'], 'status' => 1))->select();
             if (count($group_role)) {
                 $role_key[] = 'role' . $group['id'];
                 $group_role_options = $already_group_role = array();
                 foreach ($group_role as $val) {
                     if (in_array($val['id'], $already_role)) {
                         $already_group_role = $val['id'];
                     }
                     $group_role_options[$val['id']] = $val['title'];
                 }
                 $builder->keyRadio('role' . $group['id'], '分组[' . $group['title'] . ']身份', '同一分组下用户最多只能拥有其中一个身份', $group_role_options)->keyDefault('role' . $group['id'], $already_group_role);
             }
         }
         /*身份设置 end*/
         $builder->group('基本设置', implode(',', $field_key));
         $builder->group('积分设置', implode(',', $score_key));
         $builder->group('身份设置', implode(',', $role_key));
         $builder->buttonSubmit('', '保存');
         $builder->buttonBack();
         $builder->display();
     }
 }
예제 #16
0
 public function website()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('网站信息')->suggest('此处配置网站的一般信息。');
     $builder->keyText('WEB_SITE_NAME', '网站名', '用于邮件,短信,站内信显示');
     $builder->keyText('ICP', '网站备案号', '设置在网站底部显示的备案号,如“沪ICP备12007941号-2');
     $builder->keySingleImage('LOGO', '网站Logo', '网站的logo设置,建议尺寸156*50');
     $builder->keySingleImage('QRCODE', '微信二维码', '悬浮微信二维码');
     $builder->keySingleImage('JUMP_BACKGROUND', '跳转页背景图片', '跳转页背景图片');
     $builder->keyText('SUCCESS_WAIT_TIME', '成功等待时间', '设置成功时页面等待页面');
     $builder->keyText('ERROR_WAIT_TIME', '失败等待时间', '设置失败时页面等待页面');
     $builder->keyEditor('ABOUT_US', '关于我们内容', '页脚关于我们介绍');
     $builder->keyEditor('SUBSCRIB_US', '关注我们', '页脚关注我们内容');
     $builder->keyEditor('COPY_RIGHT', '版权信息', '页脚版权信息');
     $builder->group('基本信息', array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE'));
     $builder->group('页脚信息', array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
     $builder->group('跳转页面', array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
     $builder->data($data);
     $builder->keyDefault('SUCCESS_WAIT_TIME', 2);
     $builder->keyDefault('ERROR_WAIT_TIME', 5);
     $builder->buttonSubmit();
     $builder->display();
 }
예제 #17
0
 public function website()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('网站信息')->suggest('此处配置网站的一般信息。');
     $builder->keyText('WEB_SITE_NAME', '网站名', '用于邮件,短信,站内信显示');
     $builder->keyText('ICP', '网站备案号', '设置在网站底部显示的备案号,如“沪ICP备12007941号-2');
     $builder->keySingleImage('LOGO', '网站Logo', '网站的logo设置,建议尺寸156*50');
     $builder->keySingleImage('QRCODE', '微信二维码', '悬浮微信二维码');
     $builder->keySingleImage('JUMP_BACKGROUND', '跳转页背景图片', '跳转页背景图片');
     $builder->keyText('SUCCESS_WAIT_TIME', '成功等待时间', '设置成功时页面等待页面');
     $builder->keyText('ERROR_WAIT_TIME', '失败等待时间', '设置失败时页面等待页面');
     $builder->keyEditor('ABOUT_US', '关于我们内容', '页脚关于我们介绍');
     $builder->keyEditor('SUBSCRIB_US', '关注我们', '页脚关注我们内容');
     $builder->keyEditor('COPY_RIGHT', '版权信息', '页脚版权信息');
     $addons = \Think\Hook::get('uploadDriver');
     $opt = array('local' => '本地');
     foreach ($addons as $name) {
         if (class_exists($name)) {
             $class = new $name();
             $config = $class->getConfig();
             if ($config['switch']) {
                 $opt[$class->info['name']] = $class->info['title'];
             }
         }
     }
     $builder->keySelect('PICTURE_UPLOAD_DRIVER', '图片上传驱动', '图片上传驱动', $opt);
     $builder->keySelect('DOWNLOAD_UPLOAD_DRIVER', '附件上传驱动', '附件上传驱动', $opt);
     $builder->group('基本信息', array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE'));
     $builder->group('页脚信息', array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
     $builder->group('跳转页面', array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
     $builder->group('上传配置', array('PICTURE_UPLOAD_DRIVER', 'DOWNLOAD_UPLOAD_DRIVER'));
     $builder->data($data);
     $builder->keyDefault('SUCCESS_WAIT_TIME', 2);
     $builder->keyDefault('ERROR_WAIT_TIME', 5);
     $builder->buttonSubmit();
     $builder->display();
 }
 public function website()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title(L('_SITE_INFO_'))->suggest(L('_SITE_INFO_VICE_'));
     /*        $builder->keySelect('LANG', L('_WEBSITE_LANGUAGE_'), L('_SELECT_THE_DEFAULT_LANGUAGE_'), array('zh-cn' => L('_SIMPLIFIED_CHINESE_'), 'en-us' => L('_ENGLISH_')));*/
     $builder->keyText('WEB_SITE_NAME', L('_SITE_NAME_'), L('_SITE_NAME_VICE_'));
     $builder->keyText('ICP', L('_LICENSE_NO_'), L('_LICENSE_NO_VICE_'));
     $builder->keySingleImage('LOGO', L('_SITE_LOGO_'), L('_SITE_LOGO_VICE_'));
     $builder->keySingleImage('QRCODE', L('_QR_WEIXIN_'), L('_QR_WEIXIN_VICE_'));
     $builder->keySingleImage('JUMP_BACKGROUND', L('_IMG_BG_REDIRECTED_'), L('_IMG_BG_REDIRECTED_'));
     $builder->keyText('SUCCESS_WAIT_TIME', L(''), L(''));
     $builder->keyText('ERROR_WAIT_TIME', L(''), L(''));
     $builder->keyEditor('ABOUT_US', L(''), L(''));
     $builder->keyEditor('SUBSCRIB_US', L(''), L(''));
     $builder->keyEditor('COPY_RIGHT', L(''), L(''));
     $addons = \Think\Hook::get('uploadDriver');
     $opt = array('local' => L('_LOCAL_'));
     foreach ($addons as $name) {
         if (class_exists($name)) {
             $class = new $name();
             $config = $class->getConfig();
             if ($config['switch']) {
                 $opt[$class->info['name']] = $class->info['title'];
             }
         }
     }
     $builder->keySelect('PICTURE_UPLOAD_DRIVER', L('_PICTURE_UPLOAD_DRIVER_'), L('_PICTURE_UPLOAD_DRIVER_'), $opt);
     $builder->keySelect('DOWNLOAD_UPLOAD_DRIVER', L('_ATTACHMENT_UPLOAD_DRIVER_'), L('_ATTACHMENT_UPLOAD_DRIVER_'), $opt);
     $builder->group(L('_BASIC_INFORMATION_'), array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE', 'LANG'));
     $builder->group(L('_THE_FOOTER_INFORMATION_'), array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
     $builder->group(L('_JUMP_PAGE_'), array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
     $builder->keyBool('GET_INFORMATION', L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_'), L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_VICE_'));
     $builder->keyText('GET_INFORMATION_INTERNAL', L('_MESSAGE_POLLING_INTERVAL_'), L('_MESSAGE_POLLING_INTERVAL_VICE_'));
     $builder->group(L('_PERFORMANCE_SETTINGS_'), array('GET_INFORMATION', 'GET_INFORMATION_INTERNAL'));
     $builder->group(L('_UPLOAD_CONFIGURATION_'), array('PICTURE_UPLOAD_DRIVER', 'DOWNLOAD_UPLOAD_DRIVER'));
     $builder->data($data);
     $builder->keyDefault('SUCCESS_WAIT_TIME', 2);
     $builder->keyDefault('ERROR_WAIT_TIME', 5);
     $builder->keyDefault('LANG', 'zh-cn');
     $builder->keyDefault('GET_INFORMATION', 1);
     $builder->keyDefault('GET_INFORMATION_INTERNAL', 10);
     $builder->buttonSubmit();
     $builder->display();
 }
예제 #19
0
 /**
  * 用户扩展资料详情
  * @param string $uid
  * @author 郑钟良<*****@*****.**>
  */
 public function expandinfo_details($uid = 0)
 {
     if (IS_POST) {
         /* 修改积分 xjw129xjt(肖骏涛)*/
         $data = I('post.');
         foreach ($data as $key => $val) {
             if (substr($key, 0, 5) == 'score') {
                 $data_score[$key] = $val;
             }
         }
         $res = D('Member')->where(array('uid' => $data['id']))->save($data_score);
         if ($res) {
             $this->success('设置成功');
         } else {
             $this->error('设置失败');
         }
         /* 修改积分 end*/
     } else {
         $map['uid'] = $uid;
         $map['status'] = array('egt', 0);
         $member = M('Member')->where($map)->find();
         $member['id'] = $member['uid'];
         $member['username'] = query_user('username', $uid);
         //扩展信息查询
         $map_profile['status'] = 1;
         $field_group = D('field_group')->where($map_profile)->select();
         $field_group_ids = array_column($field_group, 'id');
         $map_profile['profile_group_id'] = array('in', $field_group_ids);
         $fields_list = D('field_setting')->where($map_profile)->getField('id,field_name,form_type');
         $fields_list = array_combine(array_column($fields_list, 'field_name'), $fields_list);
         $map_field['uid'] = $member['uid'];
         foreach ($fields_list as $key => $val) {
             $map_field['field_id'] = $val['id'];
             $field_data = D('field')->where($map_field)->getField('field_data');
             if ($field_data == null || $field_data == '') {
                 $member[$key] = '';
             } else {
                 $member[$key] = $field_data;
             }
             $member[$key] = $field_data;
         }
         $builder = new AdminConfigBuilder();
         $builder->title('用户扩展资料详情');
         $builder->meta_title = '用户扩展资料详情';
         $builder->keyId()->keyReadOnly('username', '用户名称')->keyReadOnly('nickname', '昵称');
         $field_key = array('id', 'username', 'nickname');
         foreach ($fields_list as $vt) {
             $field_key[] = $vt['field_name'];
             $builder->keyReadOnly($vt['field_name'], $vt['field_name']);
         }
         /* 积分设置 xjw129xjt(肖骏涛)*/
         $field = D('Ucenter/Score')->getTypeList(array('status' => 1));
         $score_key = array();
         foreach ($field as $vf) {
             $score_key[] = 'score' . $vf['id'];
             $builder->keyText('score' . $vf['id'], $vf['title']);
         }
         $score_data = D('Member')->where(array('uid' => $uid))->field(implode(',', $score_key))->find();
         $member = array_merge($member, $score_data);
         /*积分设置end*/
         $builder->group('基本设置', implode(',', $field_key));
         $builder->group('积分设置', implode(',', $score_key));
         $builder->data($member);
         $builder->buttonSubmit('', '保存');
         $builder->buttonBack();
         $builder->display();
     }
 }