本文整理匯總了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);
//.........這裏部分代碼省略.........