本文整理汇总了PHP中Admin\Builder\AdminConfigBuilder::keyRadio方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminConfigBuilder::keyRadio方法的具体用法?PHP AdminConfigBuilder::keyRadio怎么用?PHP AdminConfigBuilder::keyRadio使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Builder\AdminConfigBuilder
的用法示例。
在下文中一共展示了AdminConfigBuilder::keyRadio方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: config
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();
}
示例2: config
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();
}
示例3: config
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();
}
示例4: config
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();
}
示例5: config
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();
}
示例6: config
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();
}
示例7: config
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();
}
示例8: config
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();
}
示例9: expandinfo_details
//.........这里部分代码省略.........
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();
}
}
示例10: install
public function install()
{
$aName = I('get.name', '', 'text');
$aNav = I('add_nav', 0, 'intval');
$module = $this->moduleModel->getModule($aName);
if (IS_POST) {
//执行guide中的内容
$res = $this->moduleModel->install($module['id']);
if ($res === true) {
if ($aNav) {
$channel['title'] = $module['alias'];
$channel['url'] = $module['entry'];
$channel['sort'] = 100;
$channel['status'] = 1;
$channel['icon'] = $module['icon'];
M('Channel')->add($channel);
S('common_nav', null);
}
$this->success(L('_INSTALLATION_MODULE_SUCCESS_'), U('lists'));
} else {
$this->error(L('_SETUP_MODULE_FAILED_') . $this->moduleModel->getError());
}
} else {
$builder = new AdminConfigBuilder();
$builder->title($module['alias'] . L('_DASH_') . L('_GUIDE_MODULE_INSTALL_'));
$builder->keyId()->keyReadOnly('name', L('_MODULE_NAME_'))->keyText('alias', L('_MODULE_CHINESE_NAME_'))->keyReadOnly('version', L('_VERSION_'))->keyText('icon', L('_ICON_'))->keyTextArea('summary', L('_MODULE_INTRODUCTION_'))->keyReadOnly('developer', L('_DEVELOPER_'))->keyText('entry', L('_FRONT_ENTRANCE_'))->keyText('admin_entry', L('_BACKGROUND_ENTRY_'));
//, 'repair' => L('_FIX_MODE_')修复模式不会导入模块专用数据表,只导入菜单、权限、行为、行为限制
$builder->keyRadio('mode', L('_INSTALLATION_MODE_'), '', array('install' => L('_COVER_INSTALLATION_MODE_')));
if ($module['entry']) {
$builder->keyBool('add_nav', L('_ADD_NAVIGATION_'), L('_INSTALL_AUTO_ADD_MENU_', array('link' => U('channel/index'))));
}
/* $builder->keyRadio('add_nav',L('_ADD_NAVIGATION_MENU_'),L('_DEFAULT_WILL_NOT_ADD_NAVIGATION_'),array(1=>L('_DO_NOT_ADD_'),2=>L('_ADD_')));*/
$builder->group(L('_INSTALL_OPTION_'), 'mode,add_nav');
/* $builder->group(L('_MODULE_INFORMATION_'), 'id,name,alias,version,icon,summary,developer,entry,admin_entry');*/
$module['mode'] = 'install';
$module['add_nav'] = '1';
$builder->data($module);
$builder->buttonSubmit();
$builder->buttonBack();
$builder->display();
}
/* */
}
示例11: expandinfo_details
//.........这里部分代码省略.........
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();
}
}
示例12: addType
public function addType()
{
if (IS_POST) {
$aId = I('post.id', 0, 'intval');
$aTitle = I('title', '', 'text');
$aEntity = I('entity', 1, 'intval');
$aSort = I('sort', 0, 'intval');
$aTitle = $aTitle == '' ? $this->error('分类名称必填') : $aTitle;
$data['title'] = $aTitle;
$data['sort'] = $aSort;
$data['entity'] = $aEntity;
$data['status'] = 1;
if ($aId != 0) {
//存储
$data['id'] = $aId;
$rs = M('AppstoreType')->save($data);
} else {
$rs = M('AppstoreType')->add($data);
}
if ($rs === false) {
$this->error('保存失败。');
} else {
$this->success('保存成功。');
}
} else {
$id = I('id', 0, 'intval');
if ($id != 0) {
$data = M('AppstoreType')->find($id);
} else {
$entity = I('entity', 1, 'intval');
if ($entity == 0) {
$entity = 1;
}
$data['entity'] = $entity;
$data['status'] = 1;
$data['sort'] = 0;
}
$builder = new AdminConfigBuilder();
$builder->title('新增分类');
$builder->keyId();
$builder->keyTitle();
$builder->keyRadio('entity', '分类所属', '', array('1' => '插件', 2 => '模块', '3' => '主题', 4 => '服务'))->keyInteger('sort', '排序')->keyStatus();
$builder->data($data)->buttonSubmit();
$builder->display();
}
}
示例13: editPos
public function editPos()
{
$aId = I('id', 0, 'intval');
$aCopy = I('copy', 0, 'intval');
$advPosModel = D('Common/AdvPos');
if (IS_POST) {
//是提交
$pos['name'] = I('name', '', 'text');
$pos['title'] = I('title', '', 'text');
$pos['path'] = I('path', '', 'text');
$pos['type'] = I('type', 1, 'intval');
$pos['status'] = I('status', 1, 'intval');
$pos['width'] = I('width', '', 'text');
$pos['height'] = I('height', '', 'text');
$pos['margin'] = I('margin', '', 'text');
$pos['padding'] = I('padding', '', 'text');
$pos['theme'] = I('theme', 'all', 'text');
switch ($pos['type']) {
case 2:
//todo 多图
$pos['data'] = json_encode(array('style' => I('style', 1, 'intval')));
}
if ($aId == 0) {
$result = $advPosModel->add($pos);
} else {
$pos['id'] = $aId;
$result = $advPosModel->save($pos);
}
if ($result === false) {
$this->error('保存失败。');
} else {
S('adv_pos_by_pos_' . $pos['path'] . $pos['name'], null);
$this->success('保存成功。');
}
} else {
$builder = new AdminConfigBuilder();
if ($aCopy != 0) {
$pos = $advPosModel->find($aCopy);
unset($pos['id']);
$pos['name'] .= ' 请重新设置!';
$pos['title'] .= ' 请重新设置!';
} else {
$pos = $advPosModel->find($aId);
}
if ($aId == 0) {
if ($aCopy != 0) {
$builder->title('复制广告位——' . $pos['title']);
} else {
$builder->title('新增广告位');
}
} else {
$builder->title($pos['title'] . '【' . $pos['name'] . '】' . ' 设置——' . $advPosModel->switchType($pos['type']));
}
$themes = D('Common/Theme')->getThemeList();
$themes_array['all'] = '<span class="text-success">全部主题</span>';
foreach ($themes as $v) {
$themes_array[$v['name']] = $v['title'];
}
$builder->keyId()->keyTitle()->keyText('name', '广告位英文名', '标识,同一个页面上不要出现两个同名的')->keyText('path', '路径', '模块名/控制器名/方法名,例如:Weibo/Index/detail')->keyRadio('type', '广告类型', '', array(1 => '单图广告', 2 => '多图轮播', 3 => '文字链接', 4 => '代码'))->keyStatus()->keyText('width', '宽度', '支持各类长度单位,如px,em,%')->keyText('height', '高度', '支持各类长度单位,如px,em,%')->keyText('margin', '边缘留白', '支持各类长度单位,如px,em,%;依次为:上 右 下 左,如 5px 2px 0 3px')->keyText('padding', '内部留白', '支持各类长度单位,如px,em,%;依次为:上 右 下 左,如 5px 2px 0 3px')->keyCheckBox('theme', '适用主题', '', $themes_array);
$data = json_decode($pos['data'], true);
if (!empty($data)) {
$pos = array_merge($pos, $data);
}
if ($pos['type'] == 2) {
$builder->keyRadio('style', '轮播_风格', '', array(1 => 'TouchSlider 风格', 2 => 'KinmaxShow 风格'))->keyDefault('style', 1);
}
$builder->keyDefault('type', 1)->keyDefault('status', 1);
$builder->data($pos);
$builder->buttonSubmit()->buttonBack();
$builder->display();
}
}
示例14: install
public function install()
{
$aName = I('get.name', '', 'text');
$aNav = I('add_nav', 0, 'intval');
$module = $this->moduleModel->getModule($aName);
if (IS_POST) {
//执行guide中的内容
$res = $this->moduleModel->install($module['id']);
if ($res === true) {
if ($aNav) {
$channel['title'] = $module['alias'];
$channel['url'] = $module['entry'];
$channel['sort'] = 100;
$channel['status'] = 1;
$channel['icon'] = $module['icon'];
M('Channel')->add($channel);
S('common_nav', null);
}
$this->success('安装模块成功。', U('lists'));
} else {
$this->error('安装模块失败。' . $this->moduleModel->getError());
}
} else {
$builder = new AdminConfigBuilder();
$builder->title($module['alias'] . '——模块安装向导');
$builder->keyId()->keyReadOnly('name', '模块名')->keyText('alias', '模块中文名')->keyReadOnly('version', '版本')->keyText('icon', '图标')->keyTextArea('summary', '模块介绍')->keyReadOnly('developer', '开发者')->keyText('entry', '前台入口')->keyText('admin_entry', '后台入口');
//, 'repair' => '修复模式'修复模式不会导入模块专用数据表,只导入菜单、权限、行为、行为限制
$builder->keyRadio('mode', '安装模式', '', array('install' => '覆盖安装模式'));
if ($module['entry']) {
$builder->keyBool('add_nav', '添加导航', '安装后自动在导航栏中加入菜单,或者<a target="_blank" href="' . U('channel/index') . '">手动设置</a>');
}
/* $builder->keyRadio('add_nav','添加导航菜单','默认不会添加导航',array(1=>'不添加',2=>'添加'));*/
$builder->group('安装选项', 'mode,add_nav');
/* $builder->group('模块信息', 'id,name,alias,version,icon,summary,developer,entry,admin_entry');*/
$module['mode'] = 'install';
$module['add_nav'] = '1';
$builder->data($module);
$builder->buttonSubmit();
$builder->buttonBack();
$builder->display();
}
/* */
}
示例15: editSection
public function editSection()
{
$aSectionId = I('id', 0, 'intval');
$oldSection = $this->bookSectionModel->getData($aSectionId);
$title = $oldSection['type'] ? '编辑文章: ' . $oldSection['title'] : '编辑章节: ' . $oldSection['title'];
if (!$oldSection) {
$this->error(L('_THIS_CHAPTER_DOES_NOT_EXIST_AND_CANNOT_BE_EDITED_WITH_EXCLAMATION_'));
}
if (IS_POST) {
$data['id'] = $aSectionId;
$data['uid'] = I('post.uid', get_uid(), 'intval');
$data['title'] = I('post.title', '', 'text');
$data['pid'] = I('post.pid', 0, 'intval');
$data['keywords'] = I('post.keywords', '', 'text');
$data['summary'] = I('post.summary', '', 'text');
$data['is_show'] = I('post.is_show', 1, 'intval');
$data['sort'] = I('post.sort', 0, 'intval');
$data['create_time'] = I('post.create_time', time(), 'intval');
$data['status'] = I('post.status', 1, 'intval');
$data['book_id'] = $oldSection['book_id'];
$data['color'] = I('post.color', '', 'text');
if (!$oldSection['type']) {
$data['open_child'] = I('post.open_child', 1, 'intval');
}
if (mb_strlen($data['title'], 'utf-8') <= 0) {
$this->error(L('_TITLE_CAN_NOT_BE_EMPTY_WITH_EXCLAMATION_'));
}
$res_section = $this->bookSectionModel->editData($data);
if ($oldSection['type']) {
$detail['section_id'] = $aSectionId;
$detailModel = D('BookDetail');
$exist = $detailModel->where($detail)->find();
$detail['content'] = $_POST['content'];
if ($exist) {
$detail['id'] = $exist['id'];
$res_detail = $detailModel->save($detail);
} else {
$res_detail = $detailModel->add($detail);
}
}
if ($res_section || $res_detail) {
$this->success(L('_OPERATION_SUCCESS_WITH_EXCLAMATION_'));
} else {
if ($oldSection['type']) {
$this->error('编辑失败!操作章节表时报 ' . $this->bookSectionModel->getError() . L('_WRONG;_THE_OPERATION_OF_THE_ARTICLE_FOR_DETAILS_OF_THE_TIMES_') . $detailModel->getError() . L('_WRONG_WITH_PERIOD_'));
} else {
$this->error(L('_EDIT_FAILED_WITH_EXCLAMATION_') . $this->bookSectionModel->getError());
}
}
} else {
$options = $this->bookSectionModel->getSectionOptions($oldSection['book_id'], $aSectionId);
$builder = new AdminConfigBuilder();
$builder->title($title);
$builder->data($oldSection)->keyId()->keyUid('uid', L('_AUTHOR_UID_'))->keyTitle('title', L('_TITLE_'))->keySelect('pid', L('_FATHER_CLASS_'), '', $options)->keyText('keywords', L('_KEY_WORDS_'))->keyTextArea('summary', L('_INTRODUCTION_'));
if ($oldSection['type']) {
$builder->keyEditor('content', L('_CONTENT_'), '', 'all', array('width' => '850px', 'height' => '400px'));
} else {
$builder->keyBool('open_child', L('_START_SUB_CHAPTER_'));
}
$builder->keyRadio('is_show', L('_RELEASE_STATUS_'), '', array('0' => L('_DRAFT_'), '1' => L('_NORMAL_')))->keyInteger('sort', L('_SORT_'))->keyColor('color', L('_TEXT_COLOR_'))->keyCreateTime()->keyStatus()->buttonSubmit()->buttonBack()->display();
}
}