From 5611b5694666259da3a4230974100fed2da6a5ea Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 9 Aug 2018 10:12:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98=EF=BC=8C=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=EF=BC=8C=E5=8F=8B=E6=83=85=E9=93=BE=E6=8E=A5=EF=BC=8C=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ArticleController.class.php | 6 +- .../Controller/CustomViewController.class.php | 6 +- .../Controller/NavFooterController.class.php | 235 ------------------ ...ass.php => NavigationController.class.php} | 8 +- .../Controller/ThemeController.class.php | 12 +- .../Controller/UeditorController.class.php | 4 +- .../Admin/Lang/zh-cn/navfooter.php | 37 --- .../Admin/Lang/zh-cn/navheader.php | 46 ---- .../Admin/Lang/zh-cn/navigation.php | 47 ++++ .../Admin/View/Default/Link/Index.html | 2 +- .../Admin/View/Default/NavFooter/Index.html | 173 ------------- .../{NavHeader => Navigation}/Index.html | 82 +++--- .../{NavHeader => Navigation}/Nav.html | 4 +- .../Admin/View/Default/Theme/Index.html | 2 +- .../Application/Common/Common/function.php | 11 +- service/Application/Common/Lang/zh-cn.php | 1 + .../Application/Library/Uploader.class.php | 16 -- .../Temp/8cde93cbd070139d84f31d26f8ea8f4d.php | 2 +- .../Temp/a58f8070835be94249ea77f3601c6647.php | 2 +- service/Public/Admin/Default/Js/NavFooter.js | 26 -- .../Js/{NavHeader.js => Navigation.js} | 0 .../image/2018/08/09/1533779508195660.jpg | Bin 0 -> 113916 bytes .../image/2018/08/09/1533779966550231.jpeg | Bin 0 -> 97092 bytes service/shopxo.sql | 98 +++++++- 24 files changed, 215 insertions(+), 605 deletions(-) delete mode 100755 service/Application/Admin/Controller/NavFooterController.class.php rename service/Application/Admin/Controller/{NavHeaderController.class.php => NavigationController.class.php} (92%) delete mode 100755 service/Application/Admin/Lang/zh-cn/navfooter.php delete mode 100755 service/Application/Admin/Lang/zh-cn/navheader.php create mode 100755 service/Application/Admin/Lang/zh-cn/navigation.php delete mode 100755 service/Application/Admin/View/Default/NavFooter/Index.html rename service/Application/Admin/View/Default/{NavHeader => Navigation}/Index.html (68%) rename service/Application/Admin/View/Default/{NavHeader => Navigation}/Nav.html (51%) delete mode 100755 service/Public/Admin/Default/Js/NavFooter.js rename service/Public/Admin/Default/Js/{NavHeader.js => Navigation.js} (100%) create mode 100644 service/Public/Upload/article/image/2018/08/09/1533779508195660.jpg create mode 100644 service/Public/Upload/customview/image/2018/08/09/1533779966550231.jpeg diff --git a/service/Application/Admin/Controller/ArticleController.class.php b/service/Application/Admin/Controller/ArticleController.class.php index e203c7fe8..5f6cd78cd 100755 --- a/service/Application/Admin/Controller/ArticleController.class.php +++ b/service/Application/Admin/Controller/ArticleController.class.php @@ -243,7 +243,7 @@ class ArticleController extends CommonController // 正则匹配文章图片 $temp_image = $this->MatchContentImage($m->content); - $m->image = serialize($temp_image); + $m->image = json_encode($temp_image); $m->image_count = count($temp_image); // 数据添加 @@ -282,7 +282,7 @@ class ArticleController extends CommonController // 正则匹配文章图片 $temp_image = $this->MatchContentImage($m->content); - $m->image = serialize($temp_image); + $m->image = json_encode($temp_image); $m->image_count = count($temp_image); // 数据更新 @@ -310,7 +310,7 @@ class ArticleController extends CommonController { if(!empty($content)) { - $pattern = '//'; + $pattern = '//'; preg_match_all($pattern, $content, $match); return empty($match[1]) ? array() : $match[1]; } diff --git a/service/Application/Admin/Controller/CustomViewController.class.php b/service/Application/Admin/Controller/CustomViewController.class.php index 3df223571..e44ef1940 100755 --- a/service/Application/Admin/Controller/CustomViewController.class.php +++ b/service/Application/Admin/Controller/CustomViewController.class.php @@ -249,7 +249,7 @@ class CustomViewController extends CommonController // 正则匹配文章图片 $temp_image = $this->MatchContentImage($m->content); - $m->image = serialize($temp_image); + $m->image = json_encode($temp_image); $m->image_count = count($temp_image); // 数据添加 @@ -284,7 +284,7 @@ class CustomViewController extends CommonController // 正则匹配文章图片 $temp_image = $this->MatchContentImage($m->content); - $m->image = serialize($temp_image); + $m->image = json_encode($temp_image); $m->image_count = count($temp_image); $m->upd_time = time(); $m->title = I('title'); @@ -314,7 +314,7 @@ class CustomViewController extends CommonController { if(!empty($content)) { - $pattern = '//'; + $pattern = '//'; preg_match_all($pattern, $content, $match); return empty($match[1]) ? array() : $match[1]; } diff --git a/service/Application/Admin/Controller/NavFooterController.class.php b/service/Application/Admin/Controller/NavFooterController.class.php deleted file mode 100755 index 9763f723d..000000000 --- a/service/Application/Admin/Controller/NavFooterController.class.php +++ /dev/null @@ -1,235 +0,0 @@ -Is_Login(); - - // 权限校验 - $this->Is_Power(); - } - - /** - * [Index 导航列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-06T21:31:53+0800 - */ - public function Index() - { - // 获取导航列表 - $this->assign('list', $this->GetNavList()); - - // 文章分类 - $this->assign('article_category_list', M('ArticleCategory')->field(array('id', 'name'))->where(array('is_enable'=>1))->select()); - - // 自定义页面 - $this->assign('customview_list', M('CustomView')->field(array('id', 'title'))->where(array('is_enable'=>1))->select()); - - // 是否新窗口打开 - $this->assign('common_is_new_window_open_list', L('common_is_new_window_open_list')); - - // 是否显示 - $this->assign('common_is_show_list', L('common_is_show_list')); - - $this->display('Index'); - } - - /** - * [GetNavList 获取数据列表] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-10T22:16:29+0800 - */ - private function GetNavList() - { - $m = M('Navigation'); - $field = array('id', 'name', 'url', 'value', 'data_type', 'sort', 'is_show', 'is_new_window_open'); - return NavDataDealWith($m->field($field)->where(array('nav_type'=>'footer'))->order('sort')->select()); - } - - /** - * [Save 添加/编辑] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-07T21:58:19+0800 - */ - public function Save() - { - // 是否ajax请求 - if(!IS_AJAX) - { - $this->error(L('common_unauthorized_access')); - } - - // 请求类型 - switch(I('data_type')) - { - // 自定义导航 - case 'custom': - $this->DataSave(5); - break; - - // 文章分类导航 - case 'article_category': - $this->DataSave(6); - break; - - // 自定义页面导航 - case 'customview': - $this->DataSave(7); - break; - } - $this->ajaxReturn(L('common_param_error'), -1); - } - - /** - * [DataSave 导航数据保存] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-02-05T20:12:30+0800 - * @param [int] $check_type [校验类型] - */ - private function DataSave($check_type) - { - $m = D('Navigation'); - - // 数据校验 - if($m->create($_POST, $check_type)) - { - // 非自定义导航数据处理 - if(empty($_POST['name'])) - { - switch(I('data_type')) - { - // 文章分类导航 - case 'article_category': - $temp_name = M('ArticleCategory')->where(array('id'=>I('value')))->getField('name'); - break; - - // 自定义页面导航 - case 'customview': - $temp_name = M('CustomView')->where(array('id'=>I('value')))->getField('title'); - break; - } - // 只截取16个字符 - $m->name = mb_substr($temp_name, 0, 16, C('DEFAULT_CHARSET')); - } else { - $m->name = I('name'); - } - - // 清除缓存 - S(C('cache_common_home_nav_footer_key'), null); - - // id为空则表示是新增 - if(empty($_POST['id'])) - { - // 额外数据处理 - $m->add_time = time(); - $m->nav_type = 'footer'; - - // 写入数据库 - if($m->add()) - { - $this->ajaxReturn(L('common_operation_add_success')); - } else { - $this->ajaxReturn(L('common_operation_add_error'), -100); - } - } else { - // 数据编辑 - if($m->where(array('id'=>I('id')))->save()) - { - $this->ajaxReturn(L('common_operation_edit_success')); - } else { - $this->ajaxReturn(L('common_operation_edit_error'), -100); - } - } - } else { - $this->ajaxReturn($m->getError(), -1); - } - } - - /** - * [Delete 删除] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2016-12-09T21:13:47+0800 - */ - public function Delete() - { - if(!IS_AJAX) - { - $this->error(L('common_unauthorized_access')); - } - - $m = D('Navigation'); - if($m->create($_POST, 4)) - { - if($m->delete($id)) - { - // 清除缓存 - S(C('cache_common_home_nav_footer_key'), null); - - $this->ajaxReturn(L('common_operation_delete_success')); - } else { - $this->ajaxReturn(L('common_operation_delete_error'), -100); - } - } else { - $this->ajaxReturn($m->getError(), -1); - } - } - - /** - * [StatusUpdate 状态更新] - * @author Devil - * @blog http://gong.gg/ - * @version 0.0.1 - * @datetime 2017-01-12T22:23:06+0800 - */ - public function StatusUpdate() - { - // 参数 - if(empty($_POST['id']) || !isset($_POST['state'])) - { - $this->ajaxReturn(L('common_param_error'), -1); - } - - // 数据更新 - if(M('Navigation')->where(array('id'=>I('id')))->save(array('is_show'=>I('state')))) - { - // 清除缓存 - S(C('cache_common_home_nav_footer_key'), null); - - $this->ajaxReturn(L('common_operation_edit_success')); - } else { - $this->ajaxReturn(L('common_operation_edit_error'), -100); - } - } -} -?> \ No newline at end of file diff --git a/service/Application/Admin/Controller/NavHeaderController.class.php b/service/Application/Admin/Controller/NavigationController.class.php similarity index 92% rename from service/Application/Admin/Controller/NavHeaderController.class.php rename to service/Application/Admin/Controller/NavigationController.class.php index 511459b02..b9efe18a8 100755 --- a/service/Application/Admin/Controller/NavHeaderController.class.php +++ b/service/Application/Admin/Controller/NavigationController.class.php @@ -9,7 +9,7 @@ namespace Admin\Controller; * @version 0.0.1 * @datetime 2016-12-01T21:51:08+0800 */ -class NavHeaderController extends CommonController +class NavigationController extends CommonController { private $nav_type; @@ -175,7 +175,7 @@ class NavHeaderController extends CommonController } // 清除缓存 - S(C('cache_common_home_nav_header_key'), null); + S(C('cache_common_home_nav_'.$this->nav_type.'_key', null)); // id为空则表示是新增 if(empty($_POST['id'])) @@ -228,7 +228,7 @@ class NavHeaderController extends CommonController if($m->delete($id)) { // 清除缓存 - S(C('cache_common_home_nav_header_key'), null); + S(C('cache_common_home_nav_'.$this->nav_type.'_key', null)); $this->ajaxReturn(L('common_operation_delete_success')); } else { @@ -258,7 +258,7 @@ class NavHeaderController extends CommonController if(M('Navigation')->where(array('id'=>I('id')))->save(array('is_show'=>I('state')))) { // 清除缓存 - S(C('cache_common_home_nav_header_key'), null); + S(C('cache_common_home_nav_'.$this->nav_type.'_key', null)); $this->ajaxReturn(L('common_operation_edit_success')); } else { diff --git a/service/Application/Admin/Controller/ThemeController.class.php b/service/Application/Admin/Controller/ThemeController.class.php index 6bc5a79c6..cb114419b 100755 --- a/service/Application/Admin/Controller/ThemeController.class.php +++ b/service/Application/Admin/Controller/ThemeController.class.php @@ -35,6 +35,9 @@ class ThemeController extends CommonController // 静态目录和html目录 $this->html_path = 'Application'.DS.'Home'.DS.'View'.DS; $this->static_path = 'Public'.DS.'Home'.DS; + + // 小导航 + $this->view_type = I('view_type', 'home'); } /** @@ -46,12 +49,8 @@ class ThemeController extends CommonController */ public function Index() { - // 导航参数 - $view_type = I('view_type', 'home'); - $this->assign('view_type', $view_type); - // 模板 - switch($view_type) + switch($this->view_type) { // 模板安装 case 'upload': @@ -69,6 +68,9 @@ class ThemeController extends CommonController $this->display('Index'); } + + // 导航参数 + $this->assign('view_type', $this->view_type); } /** diff --git a/service/Application/Admin/Controller/UeditorController.class.php b/service/Application/Admin/Controller/UeditorController.class.php index ae249bb0c..d7f27769c 100755 --- a/service/Application/Admin/Controller/UeditorController.class.php +++ b/service/Application/Admin/Controller/UeditorController.class.php @@ -149,7 +149,7 @@ class UeditorController extends CommonController } /* 生成上传实例对象并完成上传 */ - $up = new \My\Uploader($field_name, $temp_config, $base64); + $up = new \Library\Uploader($field_name, $temp_config, $base64); /** * 得到上传文件所对应的各个参数,数组结构 @@ -292,7 +292,7 @@ class UeditorController extends CommonController $source = isset($_POST[$field_name]) ? $_POST[$field_name] : $_GET[$field_name]; foreach($source as $imgUrl) { - $item = new \My\Uploader($imgUrl, $temp_config, "remote"); + $item = new \Library\Uploader($imgUrl, $temp_config, "remote"); $info = $item->getFileInfo(); array_push($list, array( "state" => $info["state"], diff --git a/service/Application/Admin/Lang/zh-cn/navfooter.php b/service/Application/Admin/Lang/zh-cn/navfooter.php deleted file mode 100755 index 232e4552d..000000000 --- a/service/Application/Admin/Lang/zh-cn/navfooter.php +++ /dev/null @@ -1,37 +0,0 @@ - '导航添加', - 'navheader_edit_name' => '导航编辑', - 'navheader_custom_operation_add' => '自定义', - 'navheader_article_category_operation_add' => '分类', - 'navheader_customview_operation_add' => '页面', - 'navheader_article_category_name_format' => '默认文章分类名称', - 'navheader_customview_name_format' => '默认自定义页面名称', - - // 自定义导航 - 'navheader_level_text' => '导航级别', - 'navheader_level_format' => '导航级别选择错误', - 'navheader_name_text' => '导航名称', - 'navheader_name_format' => '导航名称格式 2~16 个字符', - 'navheader_url_text' => 'url地址', - 'navheader_url_text_tips' => '带http://', - 'navheader_url_format' => 'url格式有误', - - // 文章分类导航 - 'navheader_article_category_id_text' => '文章分类', - 'navheader_article_category_id_format' => '文章分类选择有误', - - // 自定义页面导航 - 'navheader_customview_id_text' => '自定义页面', - 'navheader_customview_id_format' => '自定义页面选择有误', -); -?> \ No newline at end of file diff --git a/service/Application/Admin/Lang/zh-cn/navheader.php b/service/Application/Admin/Lang/zh-cn/navheader.php deleted file mode 100755 index 5d1dee54c..000000000 --- a/service/Application/Admin/Lang/zh-cn/navheader.php +++ /dev/null @@ -1,46 +0,0 @@ - '导航添加', - 'navheader_edit_name' => '导航编辑', - 'navheader_custom_operation_add' => '自定义', - 'navheader_article_category_operation_add' => '文字分类', - 'navheader_customview_operation_add' => '自定义页面', - 'navheader_goods_category_operation_add' => '商品分类页面', - 'navheader_article_category_name_format' => '默认文章分类名称', - 'navheader_customview_name_format' => '默认自定义页面名称', - 'navheader_goods_category_name_format' => '默认商品分类名称', - - // 自定义导航 - 'navheader_level_text' => '导航级别', - 'navheader_level_format' => '导航级别选择错误', - 'navheader_name_text' => '导航名称', - 'navheader_name_format' => '导航名称格式 2~16 个字符', - 'navheader_url_text' => 'url地址', - 'navheader_url_text_tips' => '带http://', - 'navheader_url_format' => 'url格式有误', - - // 文章分类导航 - 'navheader_article_category_id_text' => '文章分类', - 'navheader_article_category_id_format' => '文章分类选择有误', - - // 自定义页面导航 - 'navheader_customview_id_text' => '自定义页面', - 'navheader_customview_id_format' => '自定义页面选择有误', - - // 商品分类导航 - 'navheader_goods_category_id_text' => '商品分类', - 'navheader_goods_category_id_format' => '商品分类选择有误', - - 'navheader_nav_header_name' => '中间导航', - 'navheader_nav_footer_name' => '底部导航', -); -?> \ No newline at end of file diff --git a/service/Application/Admin/Lang/zh-cn/navigation.php b/service/Application/Admin/Lang/zh-cn/navigation.php new file mode 100755 index 000000000..90d89bfb8 --- /dev/null +++ b/service/Application/Admin/Lang/zh-cn/navigation.php @@ -0,0 +1,47 @@ + '导航添加', + 'navigation_edit_name' => '导航编辑', + 'navigation_custom_operation_add' => '自定义', + 'navigation_article_category_operation_add' => '文字分类', + 'navigation_customview_operation_add' => '自定义', + 'navigation_goods_category_operation_add' => '商品分类', + 'navigation_article_category_name_format' => '默认文章分类名称', + 'navigation_customview_name_format' => '默认自定义页面名称', + 'navigation_goods_category_name_format' => '默认商品分类名称', + + // 自定义导航 + 'navigation_level_text' => '导航级别', + 'navigation_level_format' => '导航级别选择错误', + 'navigation_name_text' => '导航名称', + 'navigation_name_format' => '导航名称格式 2~16 个字符', + 'navigation_url_text' => 'url地址', + 'navigation_url_text_tips' => '带http://', + 'navigation_url_format' => 'url格式有误', + + // 文章分类导航 + 'navigation_article_category_id_text' => '文章分类', + 'navigation_article_category_id_format' => '文章分类选择有误', + + // 自定义页面导航 + 'navigation_customview_id_text' => '自定义页面', + 'navigation_customview_id_format' => '自定义页面选择有误', + + // 商品分类导航 + 'navigation_goods_category_id_text' => '商品分类', + 'navigation_goods_category_id_format' => '商品分类选择有误', + + // tab nav + 'navigation_nav_header_name' => '中间导航', + 'navigation_nav_footer_name' => '底部导航', +); +?> \ No newline at end of file diff --git a/service/Application/Admin/View/Default/Link/Index.html b/service/Application/Admin/View/Default/Link/Index.html index a748fa8f0..593d5152f 100755 --- a/service/Application/Admin/View/Default/Link/Index.html +++ b/service/Application/Admin/View/Default/Link/Index.html @@ -69,7 +69,7 @@ {{$v.describe}} - am-successam-default" data-url="{{:U('Admin/Link/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}"> + am-successam-default" data-url="{{:U('Admin/Link/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1"> diff --git a/service/Application/Admin/View/Default/NavFooter/Index.html b/service/Application/Admin/View/Default/NavFooter/Index.html deleted file mode 100755 index 5ebd86779..000000000 --- a/service/Application/Admin/View/Default/NavFooter/Index.html +++ /dev/null @@ -1,173 +0,0 @@ - - - -
-
- -
- - - -
- - - - - - - -
-
-
-

{{:L('navheader_article_category_operation_add')}}{{:L('navheader_add_name')}}

- × -
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - class="am-active"> - - - - - - - - - - -
{{:L('navheader_name_text')}}{{:L('common_nav_type_name')}}{{:L('common_view_status_title')}}{{:L('common_operation_name')}}
{{$v.name}} - - - - {{:L('common_nav_type_list')[$v['data_type']]}} - am-successam-default" data-url="{{:U('Admin/NavFooter/StatusUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_show']}}" data-is-update-status="1"> - - - -
{{:L('common_not_data_tips')}}
- -
-
- - - - - \ No newline at end of file diff --git a/service/Application/Admin/View/Default/NavHeader/Index.html b/service/Application/Admin/View/Default/Navigation/Index.html similarity index 68% rename from service/Application/Admin/View/Default/NavHeader/Index.html rename to service/Application/Admin/View/Default/Navigation/Index.html index df66713c5..9be21f181 100755 --- a/service/Application/Admin/View/Default/NavHeader/Index.html +++ b/service/Application/Admin/View/Default/Navigation/Index.html @@ -9,10 +9,10 @@
- - - - + + + +
@@ -20,15 +20,15 @@