Esempio n. 1
0
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('基本配置');
     $builder->keyText('WEBSITE_NAME', '网站名称显示')->keyEditor('COPY_RIGHT', '网站版权信息')->group('通用设置', 'WEBSITE_NAME,COPY_RIGHT');
     $builder->keyTextArea('SUMMARY', '登陆页导语', '不要过长,一句话即可')->group('登陆页设置', 'SUMMARY');
     $builder->buttonSubmit();
     $builder->data($data);
     $builder->display();
 }
 public function config()
 {
     $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();
 }
Esempio n. 3
0
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('基本设置');
     $data['MAX_SHOW_HEIGHT'] = $data['MAX_SHOW_HEIGHT'] ? $data['MAX_SHOW_HEIGHT'] : 160;
     $builder->keyInteger('MAX_SHOW_HEIGHT', '标签面板初始最大展示高度')->keyDefault('MAX_SHOW_HEIGHT', 160);
     $role_list = M('Role')->where(array('status' => 1))->field('id,title')->select();
     foreach ($role_list as &$val) {
         $val = array('data-id' => $val['id'], 'title' => $val['title']);
     }
     unset($val);
     $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $role_list), array('data-id' => 'enable', 'title' => '启用', 'items' => array()));
     $builder->keyKanban('SHOW_ROLE_TAB', '找人界面展示身份tab', '拖拽到右侧以展示这些身份tab,操作的项目对应系统身份');
     $data['SHOW_ROLE_TAB'] = $builder->parseKanbanArray($data['SHOW_ROLE_TAB'], $role_list, $default);
     $builder->group('基本设置', 'MAX_SHOW_HEIGHT,SHOW_ROLE_TAB');
     $data['USER_SHOW_TITLE1'] = $data['USER_SHOW_TITLE1'] ? $data['USER_SHOW_TITLE1'] : '活跃会员';
     $data['USER_SHOW_COUNT1'] = $data['USER_SHOW_COUNT1'] ? $data['USER_SHOW_COUNT1'] : 5;
     $data['USER_SHOW_ORDER_FIELD1'] = $data['USER_SHOW_ORDER_FIELD1'] ? $data['USER_SHOW_ORDER_FIELD1'] : 'score1';
     $data['USER_SHOW_ORDER_TYPE1'] = $data['USER_SHOW_ORDER_TYPE1'] ? $data['USER_SHOW_ORDER_TYPE1'] : 'desc';
     $data['USER_SHOW_CACHE_TIME1'] = $data['USER_SHOW_CACHE_TIME1'] ? $data['USER_SHOW_CACHE_TIME1'] : '600';
     $data['USER_SHOW_TITLE2'] = $data['USER_SHOW_TITLE2'] ? $data['USER_SHOW_TITLE2'] : '最新会员';
     $data['USER_SHOW_COUNT2'] = $data['USER_SHOW_COUNT2'] ? $data['USER_SHOW_COUNT2'] : 5;
     $data['USER_SHOW_ORDER_FIELD2'] = $data['USER_SHOW_ORDER_FIELD2'] ? $data['USER_SHOW_ORDER_FIELD2'] : 'reg_time';
     $data['USER_SHOW_ORDER_TYPE2'] = $data['USER_SHOW_ORDER_TYPE2'] ? $data['USER_SHOW_ORDER_TYPE2'] : 'desc';
     $data['USER_SHOW_CACHE_TIME2'] = $data['USER_SHOW_CACHE_TIME2'] ? $data['USER_SHOW_CACHE_TIME2'] : '600';
     $score = D("Ucenter/Score")->getTypeList(array('status' => 1));
     $order['reg_time'] = '注册时间';
     $order['last_login_time'] = '最后登录时间';
     foreach ($score as $s) {
         $order['score' . $s['id']] = '【' . $s['title'] . '】';
     }
     $builder->keyText('USER_SHOW_TITLE1', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT1', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD1', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE1', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME1', '缓存时间', '默认600秒,以秒为单位');
     $builder->keyText('USER_SHOW_TITLE2', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT2', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD2', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE2', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME2', '缓存时间', '默认600秒,以秒为单位');
     $builder->group('首页展示左侧栏', 'USER_SHOW_TITLE1,USER_SHOW_COUNT1,USER_SHOW_ORDER_FIELD1,USER_SHOW_ORDER_TYPE1,USER_SHOW_CACHE_TIME1');
     $builder->group('首页展示右侧栏', 'USER_SHOW_TITLE2,USER_SHOW_COUNT2,USER_SHOW_ORDER_FIELD2,USER_SHOW_ORDER_TYPE2,USER_SHOW_CACHE_TIME2');
     $builder->data($data);
     $builder->buttonSubmit();
     $builder->display();
 }
 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();
 }
 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();
 }
 public function config()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('基本设置');
     $data['USER_SHOW_TITLE1'] = $data['USER_SHOW_TITLE1'] ? $data['USER_SHOW_TITLE1'] : '活跃会员';
     $data['USER_SHOW_COUNT1'] = $data['USER_SHOW_COUNT1'] ? $data['USER_SHOW_COUNT1'] : 5;
     $data['USER_SHOW_ORDER_FIELD1'] = $data['USER_SHOW_ORDER_FIELD1'] ? $data['USER_SHOW_ORDER_FIELD1'] : 'score1';
     $data['USER_SHOW_ORDER_TYPE1'] = $data['USER_SHOW_ORDER_TYPE1'] ? $data['USER_SHOW_ORDER_TYPE1'] : 'desc';
     $data['USER_SHOW_CACHE_TIME1'] = $data['USER_SHOW_CACHE_TIME1'] ? $data['USER_SHOW_CACHE_TIME1'] : '600';
     $data['USER_SHOW_TITLE2'] = $data['USER_SHOW_TITLE2'] ? $data['USER_SHOW_TITLE2'] : '最新会员';
     $data['USER_SHOW_COUNT2'] = $data['USER_SHOW_COUNT2'] ? $data['USER_SHOW_COUNT2'] : 5;
     $data['USER_SHOW_ORDER_FIELD2'] = $data['USER_SHOW_ORDER_FIELD2'] ? $data['USER_SHOW_ORDER_FIELD2'] : 'reg_time';
     $data['USER_SHOW_ORDER_TYPE2'] = $data['USER_SHOW_ORDER_TYPE2'] ? $data['USER_SHOW_ORDER_TYPE2'] : 'desc';
     $data['USER_SHOW_CACHE_TIME2'] = $data['USER_SHOW_CACHE_TIME2'] ? $data['USER_SHOW_CACHE_TIME2'] : '600';
     $score = D("Ucenter/Score")->getTypeList(array('status' => 1));
     $order['reg_time'] = '注册时间';
     $order['last_login_time'] = '最后登录时间';
     foreach ($score as $s) {
         $order['score' . $s['id']] = '【' . $s['title'] . '】';
     }
     $builder->keyText('USER_SHOW_TITLE1', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT1', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD1', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE1', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME1', '缓存时间', '默认600秒,以秒为单位');
     $builder->keyText('USER_SHOW_TITLE2', '标题名称', '在首页展示块的标题');
     $builder->keyText('USER_SHOW_COUNT2', '显示人数', '只有在网站首页模块中启用了专辑块之后才会显示');
     $builder->keyRadio('USER_SHOW_ORDER_FIELD2', '排序值', '展示模块的数据排序方式', $order);
     $builder->keyRadio('USER_SHOW_ORDER_TYPE2', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'));
     $builder->keyText('USER_SHOW_CACHE_TIME2', '缓存时间', '默认600秒,以秒为单位');
     $builder->group('首页展示左侧栏', 'USER_SHOW_TITLE1,USER_SHOW_COUNT1,USER_SHOW_ORDER_FIELD1,USER_SHOW_ORDER_TYPE1,USER_SHOW_CACHE_TIME1');
     $builder->group('首页展示右侧栏', 'USER_SHOW_TITLE2,USER_SHOW_COUNT2,USER_SHOW_ORDER_FIELD2,USER_SHOW_ORDER_TYPE2,USER_SHOW_CACHE_TIME2');
     $builder->data($data);
     $builder->buttonSubmit();
     $builder->display();
 }
 public function 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();
 }
 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();
     }
 }
 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();
 }
Esempio n. 10
0
 /**
  * 新增补丁
  * @author 奕潇 <*****@*****.**>
  */
 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();
     }
 }
 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();
 }
 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();
     }
 }
Esempio n. 13
0
 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();
     }
     /*  */
 }
 /**
  * 新增补丁
  * @author 奕潇 <*****@*****.**>
  */
 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();
     }
 }
Esempio n. 15
0
 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();
     }
 }
Esempio n. 16
0
 public function hotSellConfig($id = 0, $cname = 0)
 {
     if (IS_POST) {
         if (!(is_numeric($cname) && $cname >= 0)) {
             $this->error('请正确输入阀值,阀值是一个不小于0的数字');
         }
         $id = $id ? $id : $this->shop_configModel->where('ename=' . "'min_sell_num'")->getField('id');
         $data['cname'] = $cname;
         $data['changetime'] = time();
         $rs = $this->shop_configModel->where('id=' . $id)->save($data);
         if ($rs) {
             $this->success('保存成功');
         } else {
             $this->error('保存失败');
         }
     } else {
         $hotSell = $this->shop_configModel->where('ename=' . "'min_sell_num'")->find();
         $builder = new AdminConfigBuilder();
         $builder->title('热销商品阀值配置');
         $builder->meta_title = '热销商品阀值配置';
         $builder->keyId()->keyReadOnly('ename', '标识')->keyText('cname', '热销阀值', '当已售出量高于该值时,即为热销商品');
         $builder->data($hotSell);
         $builder->buttonSubmit(U('Shop/hotSellConfig'), '保存');
         $builder->display();
     }
 }
Esempio n. 17
0
 /**
  * @param int $id
  * @param $goods_name
  * @param $goods_ico
  * @param $goods_introduct
  * @param $goods_detail
  * @param $money_need
  * @param $goods_num
  * @param $status
  * @param $category_id
  * @param $is_new
  * @param $sell_num
  * @author 郑钟良<*****@*****.**>
  */
 public function goodsEdit($id = 0, $goods_name = '', $goods_ico = '', $goods_introduct = '', $goods_detail = '', $money_need = '', $goods_num = '', $status = '', $category_id = 0, $is_new = 0, $sell_num = 0)
 {
     $isEdit = $id ? 1 : 0;
     if (IS_POST) {
         if ($goods_name == '' || $goods_name == null) {
             $this->error('请输入商品名称');
         }
         if (!is_numeric($goods_ico)) {
             $this->error('请上传商品图标');
         }
         if ($goods_introduct == '' || $goods_introduct == null) {
             if ($goods_detail == '' || $goods_detail == null) {
                 $this->error('请输入商品广告语');
             } else {
                 $goods_introduct = substr($goods_detail, 0, 25);
             }
         }
         if (!(is_numeric($money_need) && $money_need >= 0)) {
             $this->error('请正确输入商品价格');
         }
         if (!(is_numeric($goods_num) && $goods_num >= 0)) {
             $this->error('请正确输入商品剩余量');
         }
         if (!(is_numeric($sell_num) && $sell_num >= 0)) {
             $this->error('请正确输入商品已售量');
         }
         $goods['goods_name'] = $goods_name;
         $goods['goods_ico'] = $goods_ico;
         $goods['goods_introduct'] = $goods_introduct;
         $goods['goods_detail'] = $goods_detail;
         $goods['money_need'] = $money_need;
         $goods['goods_num'] = $goods_num;
         $goods['status'] = $status;
         $goods['category_id'] = $category_id;
         $goods['is_new'] = $is_new;
         $goods['sell_num'] = $sell_num;
         $goods['changetime'] = time();
         if ($isEdit) {
             $rs = $this->shopModel->where('id=' . $id)->save($goods);
         } else {
             //商品名存在验证
             $map['status'] = array('egt', 0);
             $map['goods_name'] = $goods_name;
             if ($this->shopModel->where($map)->count()) {
                 $this->error('已存在同名商品');
             }
             $goods['createtime'] = time();
             $rs = $this->shopModel->add($goods);
         }
         if ($rs) {
             $this->success($isEdit ? '编辑成功' : '添加成功', U('Shop/goodsList'));
         } else {
             $this->error($isEdit ? '编辑失败' : '添加失败');
         }
     } else {
         $builder = new AdminConfigBuilder();
         $builder->title($isEdit ? '编辑商品' : '添加商品');
         $builder->meta_title = $isEdit ? '编辑商品' : '添加商品';
         //获取分类列表
         $category_map['status'] = array('egt', 0);
         $goods_category_list = $this->shop_categoryModel->where($category_id)->order('pid desc')->select();
         $options = array_combine(array_column($goods_category_list, 'id'), array_column($goods_category_list, 'title'));
         $builder->keyId()->keyText('goods_name', '商品名称')->keySingleImage('goods_ico', '商品图标')->keySelect('category_id', '商品分类', '', $options)->keyText('goods_introduct', '商品广告语')->keyEditor('goods_detail', '商品详情')->keyInteger('money_need', '商品价格')->keyInteger('goods_num', '商品余量')->keyInteger('sell_num', '已售出量')->keyBool('is_new', '是否为新品')->keyStatus('status', '出售状态');
         if ($isEdit) {
             $goods = $this->shopModel->where('id=' . $id)->find();
             $builder->data($goods);
             $builder->buttonSubmit(U('Shop/goodsEdit'));
             $builder->buttonBack();
             $builder->display();
         } else {
             $goods['status'] = 1;
             $builder->buttonSubmit(U('Shop/goodsEdit'));
             $builder->buttonBack();
             $builder->data($goods);
             $builder->display();
         }
     }
 }
Esempio n. 18
0
 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();
     }
 }
 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();
     }
     /*  */
 }
 public function website()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title(L('_SITE_INFO_'))->suggest(L('_SITE_INFO_VICE_'));
     /*        $builder->keySelect('LANG', L('_WEBSITE_LANGUAGE_'), L('_SELECT_THE_DEFAULT_LANGUAGE_'), array('zh-cn' => L('_SIMPLIFIED_CHINESE_'), 'en-us' => L('_ENGLISH_')));*/
     $builder->keyText('WEB_SITE_NAME', L('_SITE_NAME_'), L('_SITE_NAME_VICE_'));
     $builder->keyText('ICP', L('_LICENSE_NO_'), L('_LICENSE_NO_VICE_'));
     $builder->keySingleImage('LOGO', L('_SITE_LOGO_'), L('_SITE_LOGO_VICE_'));
     $builder->keySingleImage('QRCODE', L('_QR_WEIXIN_'), L('_QR_WEIXIN_VICE_'));
     $builder->keySingleImage('JUMP_BACKGROUND', L('_IMG_BG_REDIRECTED_'), L('_IMG_BG_REDIRECTED_'));
     $builder->keyText('SUCCESS_WAIT_TIME', L(''), L(''));
     $builder->keyText('ERROR_WAIT_TIME', L(''), L(''));
     $builder->keyEditor('ABOUT_US', L(''), L(''));
     $builder->keyEditor('SUBSCRIB_US', L(''), L(''));
     $builder->keyEditor('COPY_RIGHT', L(''), L(''));
     $addons = \Think\Hook::get('uploadDriver');
     $opt = array('local' => L('_LOCAL_'));
     foreach ($addons as $name) {
         if (class_exists($name)) {
             $class = new $name();
             $config = $class->getConfig();
             if ($config['switch']) {
                 $opt[$class->info['name']] = $class->info['title'];
             }
         }
     }
     $builder->keySelect('PICTURE_UPLOAD_DRIVER', L('_PICTURE_UPLOAD_DRIVER_'), L('_PICTURE_UPLOAD_DRIVER_'), $opt);
     $builder->keySelect('DOWNLOAD_UPLOAD_DRIVER', L('_ATTACHMENT_UPLOAD_DRIVER_'), L('_ATTACHMENT_UPLOAD_DRIVER_'), $opt);
     $builder->group(L('_BASIC_INFORMATION_'), array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE', 'LANG'));
     $builder->group(L('_THE_FOOTER_INFORMATION_'), array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
     $builder->group(L('_JUMP_PAGE_'), array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
     $builder->keyBool('GET_INFORMATION', L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_'), L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_VICE_'));
     $builder->keyText('GET_INFORMATION_INTERNAL', L('_MESSAGE_POLLING_INTERVAL_'), L('_MESSAGE_POLLING_INTERVAL_VICE_'));
     $builder->group(L('_PERFORMANCE_SETTINGS_'), array('GET_INFORMATION', 'GET_INFORMATION_INTERNAL'));
     $builder->group(L('_UPLOAD_CONFIGURATION_'), array('PICTURE_UPLOAD_DRIVER', 'DOWNLOAD_UPLOAD_DRIVER'));
     $builder->data($data);
     $builder->keyDefault('SUCCESS_WAIT_TIME', 2);
     $builder->keyDefault('ERROR_WAIT_TIME', 5);
     $builder->keyDefault('LANG', 'zh-cn');
     $builder->keyDefault('GET_INFORMATION', 1);
     $builder->keyDefault('GET_INFORMATION_INTERNAL', 10);
     $builder->buttonSubmit();
     $builder->display();
 }
Esempio n. 21
0
 /**
  * 打开内容修改表单
  * @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();
 }
Esempio n. 22
0
 public function website()
 {
     $builder = new AdminConfigBuilder();
     $data = $builder->handleConfig();
     $builder->title('网站信息')->suggest('此处配置网站的一般信息。');
     $builder->keyText('WEB_SITE_NAME', '网站名', '用于邮件,短信,站内信显示');
     $builder->keyText('ICP', '网站备案号', '设置在网站底部显示的备案号,如“沪ICP备12007941号-2');
     $builder->keySingleImage('LOGO', '网站Logo', '网站的logo设置,建议尺寸156*50');
     $builder->keySingleImage('QRCODE', '微信二维码', '悬浮微信二维码');
     $builder->keySingleImage('JUMP_BACKGROUND', '跳转页背景图片', '跳转页背景图片');
     $builder->keyText('SUCCESS_WAIT_TIME', '成功等待时间', '设置成功时页面等待页面');
     $builder->keyText('ERROR_WAIT_TIME', '失败等待时间', '设置失败时页面等待页面');
     $builder->keyEditor('ABOUT_US', '关于我们内容', '页脚关于我们介绍');
     $builder->keyEditor('SUBSCRIB_US', '关注我们', '页脚关注我们内容');
     $builder->keyEditor('COPY_RIGHT', '版权信息', '页脚版权信息');
     $addons = \Think\Hook::get('uploadDriver');
     $opt = array('local' => '本地');
     foreach ($addons as $name) {
         if (class_exists($name)) {
             $class = new $name();
             $config = $class->getConfig();
             if ($config['switch']) {
                 $opt[$class->info['name']] = $class->info['title'];
             }
         }
     }
     $builder->keySelect('PICTURE_UPLOAD_DRIVER', '图片上传驱动', '图片上传驱动', $opt);
     $builder->keySelect('DOWNLOAD_UPLOAD_DRIVER', '附件上传驱动', '附件上传驱动', $opt);
     $builder->group('基本信息', array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE'));
     $builder->group('页脚信息', array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
     $builder->group('跳转页面', array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
     $builder->group('上传配置', array('PICTURE_UPLOAD_DRIVER', 'DOWNLOAD_UPLOAD_DRIVER'));
     $builder->data($data);
     $builder->keyDefault('SUCCESS_WAIT_TIME', 2);
     $builder->keyDefault('ERROR_WAIT_TIME', 5);
     $builder->buttonSubmit();
     $builder->display();
 }
 public function editAdv()
 {
     $advModel = D('Common/Adv');
     $aId = I('id', 0, 'intval');
     if ($aId != 0) {
         $adv = $advModel->find($aId);
         $aPosId = $adv['pos_id'];
     } else {
         $aPosId = I('get.pos_id', 0, 'intval');
     }
     $advPosModel = D('Common/AdvPos');
     $pos = $advPosModel->find($aPosId);
     if (IS_POST) {
         $adv['title'] = I('title', '', 'text');
         $adv['pos_id'] = $aPosId;
         $adv['url'] = I('url', '', 'text');
         $adv['sort'] = I('sort', 1, 'intval');
         $adv['status'] = I('status', 1, 'intval');
         $adv['create_time'] = I('create_time', '', 'intval');
         $adv['start_time'] = I('start_time', '', 'intval');
         $adv['end_time'] = I('end_time', '', 'intval');
         $adv['target'] = I('target', '', 'text');
         S('adv_list_' . $pos['name'] . $pos['path'], null);
         if ($pos['type'] == 2) {
             //todo 多图
             $aTitles = I('title', '', 'text');
             $aUrl = I('url', '', 'text');
             $aSort = I('sort', '', 'intval');
             $aStartTime = I('start_time', '', 'intval');
             $aEndTime = I('end_time', '', 'intval');
             $aTarget = I('target', '', 'text');
             $added = 0;
             $advModel->where(array('pos_id' => $aPosId))->delete();
             foreach (I('pic', 0, 'intval') as $key => $v) {
                 $data['pic'] = $v;
                 $data['target'] = $aTarget[$key];
                 $adv_temp['title'] = $aTitles[$key];
                 $adv_temp['pos_id'] = $adv['pos_id'];
                 $adv_temp['url'] = $aUrl[$key];
                 $adv_temp['sort'] = $aSort[$key];
                 $adv_temp['status'] = 1;
                 $adv_temp['create_time'] = time();
                 $adv_temp['start_time'] = $aStartTime[$key];
                 $adv_temp['end_time'] = $aEndTime[$key];
                 $adv_temp['target'] = $aTarget[$key];
                 $adv_temp['data'] = json_encode($data);
                 $result = $advModel->add($adv_temp);
                 if ($result !== false) {
                     $added++;
                 }
                 //todo添加
             }
             $this->success('成功改动' . $added . '个广告。');
         } else {
             switch ($pos['type']) {
                 case 1:
                     //todo 单图
                     $data['pic'] = I('pic', 0, 'intval');
                     $data['target'] = I('target', 0, 'text');
                     break;
                 case 3:
                     $data['text'] = I('text', '', 'text');
                     $data['text_color'] = I('text_color', '', 'text');
                     $data['text_font_size'] = I('text_font_size', '', 'text');
                     $data['target'] = I('target', 0, 'text');
                     //todo 文字
                     break;
                 case 4:
                     //todo 代码
                     $data['code'] = I('code', '', '');
                     break;
             }
             $adv['data'] = json_encode($data);
             if ($aId == 0) {
                 $result = $advModel->add($adv);
             } else {
                 $adv['id'] = $aId;
                 $result = $advModel->save($adv);
             }
             if ($result === false) {
                 $this->error('保存失败。');
             } else {
                 $this->success('保存成功。');
             }
         }
     } else {
         //快速添加广告位逻辑
         //todo 快速添加
         $builder = new AdminConfigBuilder();
         $adv['pos'] = $pos['title'] . '——' . $pos['name'] . '——' . $pos['path'];
         $adv['pos_id'] = $aPosId;
         $builder->keyReadOnly('pos', '所属广告位');
         $builder->keyReadOnly('pos_id', '广告位ID');
         $builder->keyId()->keyTitle('title', '广告说明');
         $builder->title($pos['title'] . '设置——' . $advPosModel->switchType($pos['type']));
         $builder->keyTime('start_time', '开始生效时间', '不设置则立即生效')->keyTime('end_time', '失效时间', '不设置则一直有效')->keyText('sort', '排序')->keyCreateTime()->keyStatus();
         $builder->buttonSubmit();
         $data = json_decode($adv['data'], true);
         if (!empty($data)) {
             $adv = array_merge($adv, $data);
         }
         if ($aId) {
             $builder->data($adv);
         } else {
             $builder->data(array('pos' => $adv['pos'], 'pos_id' => $aPosId));
         }
         switch ($pos['type']) {
             case 1:
                 //todo 单图
                 $builder->keySingleImage('pic', '图片', '选图上传,建议尺寸' . $pos['width'] . '*' . $pos['height']);
                 $builder->keyText('url', '链接地址');
                 $builder->keySelect('target', '打开方式', null, array('_blank' => '新窗口:_blank', '_self' => '当前层:_self', '_parent' => '父框架:_parent', '_top' => '整个框架:_top'));
                 break;
             case 2:
                 //todo 多图
                 break;
             case 3:
                 $builder->keyText('text', '文字内容', '广告展示文字');
                 $builder->keyText('url', '链接地址');
                 $builder->keyColor('text_color', '文字颜色', '文字颜色')->keyDefault('data[text_color]', '#000000');
                 $builder->keyText('text_font_size', '文字大小,需带单位,例如:14px')->keyDefault('data[text_font_size]', '12px');
                 $builder->keySelect('target', '打开方式', null, array('_blank' => '新窗口:_blank', '_self' => '当前层:_self', '_parent' => '父框架:_parent', '_top' => '整个框架:_top'));
                 //todo 文字
                 break;
             case 4:
                 //todo 代码
                 $builder->keyTextArea('code', '代码内容', '不对此字段进行过滤,可填写js、html');
                 break;
         }
         $builder->keyDefault('status', 1)->keyDefault('sort', 1);
         $builder->keyDefault('title', $pos['title'] . '的广告 ' . date('m月d日', time()) . ' 添加')->keyDefault('end_time', time() + 60 * 60 * 24 * 7);
         if ($pos['type'] == 2) {
             $this->_meta_title = $pos['title'] . '设置——' . $advPosModel->switchType($pos['type']);
             $adv['start_time'] = isset($adv['start_time']) ? $adv['start_time'] : time();
             $adv['end_time'] = isset($adv['end_time']) ? $adv['end_time'] : time() + 60 * 60 * 24 * 7;
             $adv['create_time'] = isset($adv['create_time']) ? $adv['create_time'] : time();
             $adv['sort'] = isset($adv['sort']) ? $adv['sort'] : 1;
             $adv['status'] = isset($adv['status']) ? $adv['status'] : 1;
             $advs = D('Adv')->where(array('pos_id' => $aPosId))->select();
             foreach ($advs as &$v) {
                 $data = json_decode($v['data'], true);
                 if (!empty($data)) {
                     $v = array_merge($v, $data);
                 }
             }
             unset($v);
             $this->assign('list', $advs);
             $this->assign('pos', $pos);
             $this->display('editslider');
         } else {
             $builder->display();
         }
     }
 }
Esempio n. 24
0
    /**
     * 创建新模块
     * @return void
     * @author swh <*****@*****.**>
     */
    public function create()
    {
        $module = array('name' => 'Example', 'alias' => '示例模块', 'version' => '1.0.0', 'icon' => 'code', 'summary' => '示例模块', 'developer' => 'admpub.com', 'website' => 'http://www.admpub.com', 'entry' => 'example/index/index', 'admin_entry' => 'admin/example/index', 'show_nav' => true, 'is_com' => false);
        if (IS_POST) {
            foreach ($module as $key => &$value) {
                $value = I('post.' . $key, '', 'text');
            }
            if (!preg_match('/^[a-z][\\w]*$/i', $module['name'])) {
                $this->error('模块英文名必须以字母开头,并且不能包含除了字母、数字、下划线以外的字符');
            }
            $module['show_nav'] = $module['show_nav'] ? 1 : 0;
            $module['is_com'] = $module['is_com'] ? 1 : 0;
            $name = ucfirst($module['name']);
            $modulePath = APP_PATH . $name . '/';
            if (is_dir($modulePath)) {
                $this->error('已经存在英文名为“' . $module['name'] . '”的模块。');
            }
            $dirs = array('Conf', 'Controller', 'Info', 'Model', 'Static/js', 'Static/css', 'View/default/Index');
            foreach ($dirs as $value) {
                if (!is_dir($modulePath . $value)) {
                    mkdir($modulePath . $value, TRUE, 0777);
                }
            }
            file_put_contents($modulePath . 'Conf/config.php', '<?php ' . PHP_EOL . "return array(\n    // 预先加载的标签库\n    'TAGLIB_PRE_LOAD' => 'OT\\TagLib\\Article,OT\\TagLib\\Think',\n\n    /* 主题设置 */\n    'DEFAULT_THEME' => 'default', // 默认模板主题名称\n\n    /* 模板相关配置 */\n    'TMPL_PARSE_STRING' => array(\n        '__STATIC__' => __ROOT__ . '/Public/static',\n        '__ADDONS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/Addons',\n        '__IMG__' => __ROOT__ . '/Application/'.MODULE_NAME   . '/Static/images',\n        '__CSS__' => __ROOT__ . '/Application/'.MODULE_NAME .'/Static/css',\n        '__JS__' => __ROOT__ . '/Application/'.MODULE_NAME. '/Static/js',\n        '__ZUI__' => __ROOT__ . '/Public/zui'\n    ),\n\n    'NEED_VERIFY'=>true,//此处控制默认是否需要审核,该配置项为了便于部署起见,暂时通过在此修改来设定。\n);");
            file_put_contents($modulePath . 'Controller/IndexController.class.php', '<?php
/**
 * 前台首页控制器
 * @author ' . $module['developer'] . '
 * generated by ' . date('Y-m-d H:i:s') . '
 */
namespace ' . $name . '\\Controller;
use Common\\Controller\\Base;

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

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

		//your code at here.

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

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

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

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

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

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

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

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

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

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


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

class ' . $name . 'Model extends Base {

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

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

	protected function _initialize() {
		parent::_initialize();
	}
}
');
            $module['can_uninstall'] = 1;
            $dumped = var_export($module, TRUE);
            file_put_contents($modulePath . 'Info/info.php', '<?php ' . PHP_EOL . 'return ' . $dumped . ';');
            file_put_contents($modulePath . 'Info/install.sql', '-- 安装模块sql' . PHP_EOL . PHP_EOL . PHP_EOL);
            file_put_contents($modulePath . 'Info/uninstall.sql', '-- 卸载模块sql' . PHP_EOL . PHP_EOL . PHP_EOL);
            file_put_contents($modulePath . 'View/default/Index/index.html', '<extend name="Base/common"/>
<block name="style">
    <link href="__CSS__/' . $module['name'] . '.css" rel="stylesheet" type="text/css"/>
</block>
<block name="body">
是的,你没有看错,本模块就是你创建的!:)
</block>
');
            file_put_contents($modulePath . 'Static/css/' . $module['name'] . '.css', '');
            $this->moduleModel->cleanModulesCache();
            $this->success('创建成功', U('lists'));
            return;
        }
        $builder = new AdminConfigBuilder();
        $builder->title('创建模块');
        $builder->keyText('name', L('模块英文名'), L('必须以字母开头,且整个名称只能由字母、数字、下划线构成'))->keyText('alias', L('模块中文名'))->keyText('version', L('版本号'))->keyText('icon', L('图标'))->keyTextArea('summary', L('模块简述'))->keyText('developer', L('开发者'))->keyText('website', L('官方网站'))->keyText('entry', L('前台入口'), L('支持U函数的网址'))->keyText('admin_entry', L('后台入口'), L('支持U函数的网址'))->keyBool('show_nav', L('显示在导航菜单中'))->keyBool('is_com', L('是否商业模块'));
        $module = array('name' => 'Example', 'alias' => '示例模块', 'version' => '1.0.0', 'icon' => 'code', 'summary' => '示例模块', 'developer' => 'admpub.com', 'website' => 'http://www.admpub.com', 'entry' => 'example/index/index', 'admin_entry' => 'admin/example/index', 'show_nav' => true, 'is_com' => false);
        $builder->data($module);
        $builder->buttonSubmit()->buttonBack()->display();
    }