本文整理汇总了PHP中Admin\Builder\AdminConfigBuilder::data方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminConfigBuilder::data方法的具体用法?PHP AdminConfigBuilder::data怎么用?PHP AdminConfigBuilder::data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Builder\AdminConfigBuilder
的用法示例。
在下文中一共展示了AdminConfigBuilder::data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例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');
$show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home');
$builder->buttonSubmit();
$builder->data($data);
$builder->display();
}
示例8: 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();
}
}
示例9: 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();
}
示例10: addpack
/**
* 新增补丁
* @author 奕潇 <yixiao2020@qq.com>
*/
public function addpack($title_old = '', $title = '', $sql = '', $des = '', $author = '')
{
if (IS_POST) {
$aId = I('post.id', 0, 'intval');
if ($aId != 0) {
//编辑逻辑,取到原有数据
$info = $this->getJsonFile($aId);
}
//dump($this->mPackPath . '/' . $aId . '.json');exit;
$aTitle = I('post.title');
$aDes = I('post.des');
$aAuthor = I('post.author');
$aSql = I('post.sql');
if ($aSql == '') {
$this->error('必须填写Sql语句。');
}
$info['title'] = $aTitle;
$info['des'] = $aDes;
$info['author'] = $aAuthor;
if ($aId == 0) {
//新增逻辑
$time = time();
if ($title == '') {
$title = $time;
}
$info['title'] = $title;
$fh = $this->writeSql($sql, $time);
$info['ctime'] = time();
$info['mtime'] = '0';
$fh = $this->writeJsonFile($time, $info);
$this->success("新增补丁成功。");
} else {
$info['mtime'] = time();
//打开文件
$this->writeJsonFile($aId, $info);
fclose($fh);
$this->writeSql($aSql, $aId);
$this->success("编辑补丁成功。");
exit;
}
} else {
$aId = I('get.id', 0, 'intval');
if ($aId != 0) {
$info = $this->getJsonFile($aId);
$info['sql'] = $this->read_file($this->pack_sql_dir . '/' . $aId . '.sql');
}
$formBuilder = new AdminConfigBuilder();
$formBuilder->title('新增补丁')->keyText('title', '补丁名称')->keyTextArea('des', '用途介绍')->keyTextArea('sql', 'sql语句')->keyText('author', '作者')->buttonSubmit();
if ($aId != 0) {
$info['id'] = $aId;
$formBuilder->keyHidden('id');
}
$formBuilder->data($info);
$formBuilder->display();
}
}
示例11: addType
public function addType()
{
$aId = I('id', 0, 'intval');
if (IS_POST) {
$aPid = I('pid', 0, 'intval');
$aSort = I('sort', 0, 'intval');
$aStatus = I('status', -2, 'intval');
$aTitle = I('title', '', 'op_t');
if ($aId != 0) {
$type['id'] = $aId;
}
$type['sort'] = $aSort;
$type['pid'] = $aPid;
if ($aStatus != -2) {
$type['status'] = $aStatus;
}
$type['title'] = $aTitle;
if ($aId != 0) {
$result = M('ForumType')->save($type);
} else {
$result = M('ForumType')->add($type);
}
if ($result) {
$this->success('操作成功!');
} else {
$this->error('操作失败!');
}
}
$type = M('ForumType')->find($aId);
if (!$type) {
$type['status'] = 1;
$type['sort'] = 1;
}
$configBuilder = new AdminConfigBuilder();
$configBuilder->title('编辑分类');
$configBuilder->keyId()->keyText('title', '分类名')->keyInteger('sort', '排序')->keyStatus()->buttonSubmit()->buttonBack();
$configBuilder->data($type);
$configBuilder->display();
}
示例12: 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(L('_GROUP_NAME_CANNOT_BE_EMPTY_'));
}
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(L('_ALREADY_HAS_THE_SAME_NAME_GROUP_PLEASE_USE_THE_OTHER_GROUP_NAME_'));
}
$data['status'] = 1;
$data['createTime'] = time();
$res = D('field_group')->add($data);
}
if ($res) {
$this->success($id == '' ? L('_ADD_GROUP_SUCCESS_') : L('_EDIT_GROUP_SUCCESS_'), U('profile'));
} else {
$this->error($id == '' ? L('_ADD_GROUP_FAILURE_') : L('_EDIT_GROUP_FAILED_'));
}
} else {
$builder = new AdminConfigBuilder();
if ($id != 0) {
$profile = D('field_group')->where('id=' . $id)->find();
$builder->title(L('_MODIFIED_GROUP_INFORMATION_'));
$builder->meta_title = L('_MODIFIED_GROUP_INFORMATION_');
} else {
$builder->title(L('_ADD_EXTENDED_INFORMATION_PACKET_'));
$builder->meta_title = L('_NEW_GROUP_');
}
$builder->keyReadOnly("id", L('_LOGO_'))->keyText('profile_name', L('_GROUP_NAME_'))->keyBool('visiable', L('_OPEN_YE_OR_NO_'));
$builder->data($profile);
$builder->buttonSubmit(U('editProfile'), $id == 0 ? L('_ADD_') : L('_MODIFY_'))->buttonBack();
$builder->display();
}
}
示例13: 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();
}
/* */
}
示例14: addpack
/**
* 新增补丁
* @author 奕潇 <yixiao2020@qq.com>
*/
public function addpack($title_old = '', $title = '', $sql = '', $des = '', $author = '')
{
if (IS_POST) {
$aId = I('post.id', 0, 'intval');
if ($aId != 0) {
//编辑逻辑,取到原有数据
$info = $this->getJsonFile($aId);
}
//dump($this->mPackPath . '/' . $aId . '.json');exit;
$aTitle = I('post.title');
$aDes = I('post.des');
$aAuthor = I('post.author');
$aSql = I('post.sql');
if ($aSql == '') {
$this->error(L('_SQL_STATEMENTS_MUST_BE_FILLED_OUT_'));
}
$info['title'] = $aTitle;
$info['des'] = $aDes;
$info['author'] = $aAuthor;
if ($aId == 0) {
//新增逻辑
$time = time();
if ($title == '') {
$title = $time;
}
$info['title'] = $title;
$fh = $this->writeSql($sql, $time);
$info['ctime'] = time();
$info['mtime'] = '0';
$fh = $this->writeJsonFile($time, $info);
$this->success(L('_NEW_PATCH_SUCCESS_'));
} else {
$info['mtime'] = time();
//打开文件
$this->writeJsonFile($aId, $info);
fclose($fh);
$this->writeSql($aSql, $aId);
$this->success(L('_EDIT_PATCH_SUCCESS_'));
exit;
}
} else {
$aId = I('get.id', 0, 'intval');
if ($aId != 0) {
$info = $this->getJsonFile($aId);
$info['sql'] = $this->read_file($this->pack_sql_dir . '/' . $aId . '.sql');
}
$formBuilder = new AdminConfigBuilder();
$formBuilder->title(L('_NEW_PATCH_'))->keyText('title', L('_PATCH_NAME_'))->keyTextArea('des', L('_INTRODUCTION_'))->keyTextArea('sql', L('_SQL_STATEMENT_'))->keyText('author', L('_AUTHOR_'))->buttonSubmit();
if ($aId != 0) {
$info['id'] = $aId;
$formBuilder->keyHidden('id');
}
$formBuilder->data($info);
$formBuilder->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();
}
}