本文整理汇总了PHP中Admin\Builder\AdminConfigBuilder::buttonSubmit方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminConfigBuilder::buttonSubmit方法的具体用法?PHP AdminConfigBuilder::buttonSubmit怎么用?PHP AdminConfigBuilder::buttonSubmit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Builder\AdminConfigBuilder
的用法示例。
在下文中一共展示了AdminConfigBuilder::buttonSubmit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* 编辑公告
* @author 郑钟良<zzl@ourstu.com>
*/
public function edit()
{
$aId = I('id', 0, 'intval');
$title = $aId ? "编辑" : "新增";
if (IS_POST) {
$aId && ($data['id'] = $aId);
$data['title'] = I('post.title', '', 'op_t');
$data['icon'] = I('post.icon', 'icon-star', 'op_t');
$data['link'] = I('post.link');
if (mb_strlen($data['link'], 'utf-8') && !in_array(strtolower(substr($data['link'], 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) {
$data['link'] = 'http://' . $data['link'];
}
$data['content'] = I('post.content', '', 'op_t');
$data['end_time'] = intval(I('post.end_time'));
$result = $this->announcementModel->editData($data);
if ($result) {
S('Announcement_list', null);
//清空缓存
$this->success($title . '公告成功!', addons_url('Announcement://admin/buildList'));
} else {
$this->error($title . '公告失败!' . $this->announcementModel->getError());
}
} else {
if ($aId) {
$data = $this->announcementModel->where(array('id' => $aId))->find();
}
$builder = new AdminConfigBuilder();
$builder->title($title . '公告')->data($data);
$builder->keyId()->keyText('title', '标题')->keyIcon('icon', '图标')->keyText('link', '链接')->keyTextArea('content', '内容')->keyTime('end_time', '有效期')->keyDefault('end_time', time() + 604800);
$builder->buttonSubmit()->buttonBack()->display();
}
}
示例2: config
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();
}
示例3: 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();
}
示例4: 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();
}
示例5: config
public function config()
{
$admin_config = new AdminConfigBuilder();
if (IS_POST) {
S('forum_recommand_forum', null);
S('forum_hot_forum', null);
S('forum_suggestion_posts', null);
}
$data = $admin_config->handleConfig();
if (!$data) {
$data['LIMIT_IMAGE'] = 10;
$data['FORUM_BLOCK_SIZE'] = 4;
$data['CACHE_TIME'] = 300;
}
$admin_config->title('论坛设置')->data($data)->keyInteger('LIMIT_IMAGE', '帖子图片解析数量限制', '超过数量限制就不会被解析出来,不填则默认为10张')->keyInteger('CACHE_TIME', '板块数据缓存时间', '默认300秒')->keyText('SUGGESTION_POSTS', '首页推荐帖子,竖线|分割,填帖子ID,最多填5个,如1|2|3|4|5,第一个为大图')->keyText('HOT_FORUM', '热门版块', '逗号,分隔')->keyDefault('HOT_FORUM', '1,2,3')->keyText('RECOMMAND_FORUM', '推荐版块', '逗号,分隔')->keyDefault('RECOMMAND_FORUM', '1,2,3')->keyInteger('FORM_POST_SHOW_NUM_INDEX', '论坛首页每页展示贴子数量', '')->keyDefault('FORM_POST_SHOW_NUM_INDEX', '5')->keyInteger('FORM_POST_SHOW_NUM_PAGE', '每页展示贴子数量', '对前台除了首页以外的贴子列表有效,')->keyDefault('FORM_POST_SHOW_NUM_PAGE', '10')->keyText('FORUM_SHOW_TITLE', '标题名称', '在首页展示块的标题')->keyDefault('FORUM_SHOW_TITLE', '论坛板块')->keyText('FORUM_SHOW', '显示板块', '竖线|分割,填板块ID,如1|2|3|4|5')->keyText('FORUM_SHOW_CACHE_TIME', '缓存时间', '默认600秒,以秒为单位')->keyDefault('FORUM_SHOW_CACHE_TIME', '600')->keyText('FORUM_POST_SHOW_TITLE', '标题名称', '在首页展示块的标题')->keyDefault('FORUM_POST_SHOW_TITLE', '热门贴子')->keyText('FORUM_POST_SHOW_NUM', '贴子显示数量')->keyDefault('FORUM_POST_SHOW_NUM', 5)->keyRadio('FORUM_POST_ORDER', '贴子排序字段', '', array('update_time' => '更新时间', 'last_reply_time' => '最后回复时间', 'view_count' => '阅读量', 'reply_count' => '回复数'))->keyDefault('FORUM_POST_ORDER', 'last_reply_time')->keyRadio('FORUM_POST_TYPE', '贴子排序方式', '', array('asc' => '升序', 'desc' => '降序'))->keyDefault('FORUM_POST_TYPE', 'desc')->keyText('FORUM_POST_CACHE_TIME', '缓存时间', '默认600秒,以秒为单位')->keyDefault('FORUM_POST_CACHE_TIME', '600')->group('基础设置', 'LIMIT_IMAGE,FORUM_BLOCK_SIZE,CACHE_TIME,SUGGESTION_POSTS,HOT_FORUM,RECOMMAND_FORUM,FORM_POST_SHOW_NUM_INDEX,FORM_POST_SHOW_NUM_PAGE')->group('首页展示板块设置', 'FORUM_SHOW_TITLE,FORUM_SHOW,FORUM_SHOW_CACHE_TIME')->group('首页展示贴子设置', 'FORUM_POST_SHOW_TITLE,FORUM_POST_SHOW_NUM,FORUM_POST_ORDER,FORUM_POST_TYPE,NEWS_SHOW_CACHE_TIME');
$admin_config->buttonSubmit('', '保存')->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()
{
$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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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');
$show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home');
$builder->buttonSubmit();
$builder->data($data);
$builder->display();
}
示例11: content_edit
/**
* 打开内容修改表单
* @param integer $id 内容id
* @return void
*/
public function content_edit($id)
{
if (!check_auth('editIssueContent')) {
$this->error('抱歉,您不具备投稿权限。');
}
$issue_content = D('Issue/IssueContent')->find($id);
if (!$issue_content) {
$this->error('404 not found');
}
if (!check_auth('editIssueContent')) {
//不是管理员则进行检测
if ($issue_content['uid'] != is_login()) {
$this->error('404 not found');
}
}
$issue = D('Issue/Issue')->find($issue_content['issue_id']);
$issues = D('Issue/Issue')->where(array('status' => 1, 'pid' => 0))->order('sort')->getField('id,title');
$builder = new AdminConfigBuilder();
$this->setTitle('修改文章');
$builder->title('修改文章');
$builder->keyId()->keyRelationSelect('issue_id', '分类', null, $issues, U('issue_list'), array('cat_0' => $issue['pid'], 'cat_1' => $issue_content['issue_id']))->keyText('title', '标题')->keySingleImage('cover_id', '封面图片')->keyText('url', '网址')->keyEditor('content', '内容');
$builder->data($issue_content);
$builder->buttonSubmit(U('content_post'))->buttonBack()->display();
}
示例12: 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();
}
/* */
}
示例13: editProfile
public function editProfile($id = 0, $profile_name = '', $visiable = 1)
{
if (IS_POST) {
$data['profile_name'] = $profile_name;
$data['visiable'] = $visiable;
if ($data['profile_name'] == '') {
$this->error('分组名称不能为空!');
}
if ($id != '') {
$res = D('field_group')->where('id=' . $id)->save($data);
} else {
$map['profile_name'] = $profile_name;
$map['status'] = array('egt', 0);
if (D('field_group')->where($map)->count() > 0) {
$this->error('已经有同名分组,请使用其他分组名称!');
}
$data['status'] = 1;
$data['createTime'] = time();
$res = D('field_group')->add($data);
}
if ($res) {
$this->success($id == '' ? "添加分组成功" : "编辑分组成功", U('profile'));
} else {
$this->error($id == '' ? "添加分组失败" : "编辑分组失败");
}
} else {
$builder = new AdminConfigBuilder();
if ($id != 0) {
$profile = D('field_group')->where('id=' . $id)->find();
$builder->title("修改分组信息");
$builder->meta_title = '修改分组信息';
} else {
$builder->title("添加扩展信息分组");
$builder->meta_title = '新增分组';
}
$builder->keyReadOnly("id", "标识")->keyText('profile_name', '分组名称')->keyBool('visiable', '是否公开');
$builder->data($profile);
$builder->buttonSubmit(U('editProfile'), $id == 0 ? "添加" : "修改")->buttonBack();
$builder->display();
}
}
示例14: website
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();
}
示例15: editAdv
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);
//.........这里部分代码省略.........