From 9d41fbd5e9a25934596202ccf11fe4d0cb05f30a Mon Sep 17 00:00:00 2001 From: molong Date: Tue, 29 Nov 2016 20:16:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=9B=AE=E5=BD=95=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E5=8F=98=E6=9B=B4=EF=BC=8C=E6=8A=8A=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E7=B2=BE=E7=AE=80=E4=B8=80=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Fornt.php | 4 ++-- application/common/model/Config.php | 12 ++++++++---- template/{mobile => }/.gitignore | 0 .../{pc => }/default/content/article/detail.html | 0 template/{pc => }/default/content/article/list.html | 0 template/{pc => }/default/content/page/detail.html | 0 template/{pc => }/default/index/index.html | 0 template/{pc => }/default/info.php | 3 ++- template/{pc => }/default/logo.png | Bin template/{pc => }/default/public/base.html | 0 .../{pc => }/default/static/css/member_login.css | 0 template/{pc => }/default/static/css/style.css | 0 template/{pc => }/default/static/css/user.css | 0 template/{pc => }/default/static/images/bg.jpg | Bin template/{pc => }/default/static/images/slide1.png | Bin template/{pc => }/default/static/images/slide2.png | Bin template/{pc => }/default/static/images/slide3.png | Bin template/{pc => }/default/static/images/tab1-1.png | Bin template/{pc => }/default/static/images/tab1-2.png | Bin template/{pc => }/default/static/images/tab1-3.png | Bin template/{pc => }/default/static/images/tab1-4.png | Bin template/{pc => }/default/static/images/tab1.png | Bin template/{pc => }/default/user/content/index.html | 0 template/{pc => }/default/user/index/index.html | 0 template/{pc => }/default/user/login/find.html | 0 template/{pc => }/default/user/login/forget.html | 0 template/{pc => }/default/user/login/index.html | 0 template/{pc => }/default/user/login/register.html | 0 template/{pc => }/default/user/order/confirm.html | 0 template/{pc => }/default/user/order/index.html | 0 template/{pc => }/default/user/order/lists.html | 0 template/{pc => }/default/user/order/pay.html | 0 template/{pc => }/default/user/profile/avatar.html | 0 template/{pc => }/default/user/profile/editpw.html | 0 template/{pc => }/default/user/profile/index.html | 0 template/{pc => }/default/user/public/base.html | 0 template/{pc => }/default/user/public/edit.html | 0 template/{pc => }/default/user/public/left_nav.html | 0 template/pc/.gitignore | 0 39 files changed, 12 insertions(+), 7 deletions(-) rename template/{mobile => }/.gitignore (100%) rename template/{pc => }/default/content/article/detail.html (100%) rename template/{pc => }/default/content/article/list.html (100%) rename template/{pc => }/default/content/page/detail.html (100%) rename template/{pc => }/default/index/index.html (100%) rename template/{pc => }/default/info.php (63%) rename template/{pc => }/default/logo.png (100%) rename template/{pc => }/default/public/base.html (100%) rename template/{pc => }/default/static/css/member_login.css (100%) rename template/{pc => }/default/static/css/style.css (100%) rename template/{pc => }/default/static/css/user.css (100%) rename template/{pc => }/default/static/images/bg.jpg (100%) rename template/{pc => }/default/static/images/slide1.png (100%) rename template/{pc => }/default/static/images/slide2.png (100%) rename template/{pc => }/default/static/images/slide3.png (100%) rename template/{pc => }/default/static/images/tab1-1.png (100%) rename template/{pc => }/default/static/images/tab1-2.png (100%) rename template/{pc => }/default/static/images/tab1-3.png (100%) rename template/{pc => }/default/static/images/tab1-4.png (100%) rename template/{pc => }/default/static/images/tab1.png (100%) rename template/{pc => }/default/user/content/index.html (100%) rename template/{pc => }/default/user/index/index.html (100%) rename template/{pc => }/default/user/login/find.html (100%) rename template/{pc => }/default/user/login/forget.html (100%) rename template/{pc => }/default/user/login/index.html (100%) rename template/{pc => }/default/user/login/register.html (100%) rename template/{pc => }/default/user/order/confirm.html (100%) rename template/{pc => }/default/user/order/index.html (100%) rename template/{pc => }/default/user/order/lists.html (100%) rename template/{pc => }/default/user/order/pay.html (100%) rename template/{pc => }/default/user/profile/avatar.html (100%) rename template/{pc => }/default/user/profile/editpw.html (100%) rename template/{pc => }/default/user/profile/index.html (100%) rename template/{pc => }/default/user/public/base.html (100%) rename template/{pc => }/default/user/public/edit.html (100%) rename template/{pc => }/default/user/public/left_nav.html (100%) delete mode 100644 template/pc/.gitignore diff --git a/application/common/controller/Fornt.php b/application/common/controller/Fornt.php index 3dcfd7a9..00bf2a22 100644 --- a/application/common/controller/Fornt.php +++ b/application/common/controller/Fornt.php @@ -36,9 +36,9 @@ class Fornt extends Base { protected function setThemes() { //网站主题设置 - $themes['mobile'] = config('mobile_themes') ? config('mobile_themes') : 'default'; + $themes['mobile'] = config('mobile_themes') ? config('mobile_themes') : 'mobile'; $themes['pc'] = config('pc_themes') ? config('pc_themes') : 'default'; - $view_path = $this->isMobile() ? 'template/mobile/' . $themes['mobile'] . '/' : 'template/pc/' . $themes['pc'] . '/'; + $view_path = $this->isMobile() ? 'template/' . $themes['mobile'] . '/' : 'template/' . $themes['pc'] . '/'; $module = $this->request->module(); if (!in_array($module, array('index', 'install'))) { $view_path_pre = $module . '/'; diff --git a/application/common/model/Config.php b/application/common/model/Config.php index 3a951464..99e62ceb 100644 --- a/application/common/model/Config.php +++ b/application/common/model/Config.php @@ -80,16 +80,20 @@ class Config extends Base{ } protected function getList($type){ - $path = ROOT_PATH . 'template/' . $type . '/'; + $path = ROOT_PATH . 'template/'; $file = opendir($path); while (false !== ($filename = readdir($file))) { if (!in_array($filename, array('.', '..'))) { $files = $path . $filename . '/info.php'; if (is_file($files)) { $info = include($files); - $info['id'] = $filename; - $info['img'] = '/template/' . $type . '/' . $filename . '/' . $info['img']; - $list[] = $info; + if ($info['type'] == $type) { + $info['id'] = $filename; + $info['img'] = '/template/' . $filename . '/' . $info['img']; + $list[] = $info; + }else{ + continue; + } } } } diff --git a/template/mobile/.gitignore b/template/.gitignore similarity index 100% rename from template/mobile/.gitignore rename to template/.gitignore diff --git a/template/pc/default/content/article/detail.html b/template/default/content/article/detail.html similarity index 100% rename from template/pc/default/content/article/detail.html rename to template/default/content/article/detail.html diff --git a/template/pc/default/content/article/list.html b/template/default/content/article/list.html similarity index 100% rename from template/pc/default/content/article/list.html rename to template/default/content/article/list.html diff --git a/template/pc/default/content/page/detail.html b/template/default/content/page/detail.html similarity index 100% rename from template/pc/default/content/page/detail.html rename to template/default/content/page/detail.html diff --git a/template/pc/default/index/index.html b/template/default/index/index.html similarity index 100% rename from template/pc/default/index/index.html rename to template/default/index/index.html diff --git a/template/pc/default/info.php b/template/default/info.php similarity index 63% rename from template/pc/default/info.php rename to template/default/info.php index 5ca05138..2202f053 100644 --- a/template/pc/default/info.php +++ b/template/default/info.php @@ -1,8 +1,9 @@ '默认模板', // + 'name' => '默认模板', //模板名称 'remark' => '模板名称.', // 模板简单介绍 'img' => 'logo.png', // 后台显示模板缩列图 相对于模板目录路径 + 'type' => 'pc', //模板类型,pc为PC端模板,mobile为手机端模板 'version' => 'v1', // 模板版本 'author' => '郭平平', // 作者 ); \ No newline at end of file diff --git a/template/pc/default/logo.png b/template/default/logo.png similarity index 100% rename from template/pc/default/logo.png rename to template/default/logo.png diff --git a/template/pc/default/public/base.html b/template/default/public/base.html similarity index 100% rename from template/pc/default/public/base.html rename to template/default/public/base.html diff --git a/template/pc/default/static/css/member_login.css b/template/default/static/css/member_login.css similarity index 100% rename from template/pc/default/static/css/member_login.css rename to template/default/static/css/member_login.css diff --git a/template/pc/default/static/css/style.css b/template/default/static/css/style.css similarity index 100% rename from template/pc/default/static/css/style.css rename to template/default/static/css/style.css diff --git a/template/pc/default/static/css/user.css b/template/default/static/css/user.css similarity index 100% rename from template/pc/default/static/css/user.css rename to template/default/static/css/user.css diff --git a/template/pc/default/static/images/bg.jpg b/template/default/static/images/bg.jpg similarity index 100% rename from template/pc/default/static/images/bg.jpg rename to template/default/static/images/bg.jpg diff --git a/template/pc/default/static/images/slide1.png b/template/default/static/images/slide1.png similarity index 100% rename from template/pc/default/static/images/slide1.png rename to template/default/static/images/slide1.png diff --git a/template/pc/default/static/images/slide2.png b/template/default/static/images/slide2.png similarity index 100% rename from template/pc/default/static/images/slide2.png rename to template/default/static/images/slide2.png diff --git a/template/pc/default/static/images/slide3.png b/template/default/static/images/slide3.png similarity index 100% rename from template/pc/default/static/images/slide3.png rename to template/default/static/images/slide3.png diff --git a/template/pc/default/static/images/tab1-1.png b/template/default/static/images/tab1-1.png similarity index 100% rename from template/pc/default/static/images/tab1-1.png rename to template/default/static/images/tab1-1.png diff --git a/template/pc/default/static/images/tab1-2.png b/template/default/static/images/tab1-2.png similarity index 100% rename from template/pc/default/static/images/tab1-2.png rename to template/default/static/images/tab1-2.png diff --git a/template/pc/default/static/images/tab1-3.png b/template/default/static/images/tab1-3.png similarity index 100% rename from template/pc/default/static/images/tab1-3.png rename to template/default/static/images/tab1-3.png diff --git a/template/pc/default/static/images/tab1-4.png b/template/default/static/images/tab1-4.png similarity index 100% rename from template/pc/default/static/images/tab1-4.png rename to template/default/static/images/tab1-4.png diff --git a/template/pc/default/static/images/tab1.png b/template/default/static/images/tab1.png similarity index 100% rename from template/pc/default/static/images/tab1.png rename to template/default/static/images/tab1.png diff --git a/template/pc/default/user/content/index.html b/template/default/user/content/index.html similarity index 100% rename from template/pc/default/user/content/index.html rename to template/default/user/content/index.html diff --git a/template/pc/default/user/index/index.html b/template/default/user/index/index.html similarity index 100% rename from template/pc/default/user/index/index.html rename to template/default/user/index/index.html diff --git a/template/pc/default/user/login/find.html b/template/default/user/login/find.html similarity index 100% rename from template/pc/default/user/login/find.html rename to template/default/user/login/find.html diff --git a/template/pc/default/user/login/forget.html b/template/default/user/login/forget.html similarity index 100% rename from template/pc/default/user/login/forget.html rename to template/default/user/login/forget.html diff --git a/template/pc/default/user/login/index.html b/template/default/user/login/index.html similarity index 100% rename from template/pc/default/user/login/index.html rename to template/default/user/login/index.html diff --git a/template/pc/default/user/login/register.html b/template/default/user/login/register.html similarity index 100% rename from template/pc/default/user/login/register.html rename to template/default/user/login/register.html diff --git a/template/pc/default/user/order/confirm.html b/template/default/user/order/confirm.html similarity index 100% rename from template/pc/default/user/order/confirm.html rename to template/default/user/order/confirm.html diff --git a/template/pc/default/user/order/index.html b/template/default/user/order/index.html similarity index 100% rename from template/pc/default/user/order/index.html rename to template/default/user/order/index.html diff --git a/template/pc/default/user/order/lists.html b/template/default/user/order/lists.html similarity index 100% rename from template/pc/default/user/order/lists.html rename to template/default/user/order/lists.html diff --git a/template/pc/default/user/order/pay.html b/template/default/user/order/pay.html similarity index 100% rename from template/pc/default/user/order/pay.html rename to template/default/user/order/pay.html diff --git a/template/pc/default/user/profile/avatar.html b/template/default/user/profile/avatar.html similarity index 100% rename from template/pc/default/user/profile/avatar.html rename to template/default/user/profile/avatar.html diff --git a/template/pc/default/user/profile/editpw.html b/template/default/user/profile/editpw.html similarity index 100% rename from template/pc/default/user/profile/editpw.html rename to template/default/user/profile/editpw.html diff --git a/template/pc/default/user/profile/index.html b/template/default/user/profile/index.html similarity index 100% rename from template/pc/default/user/profile/index.html rename to template/default/user/profile/index.html diff --git a/template/pc/default/user/public/base.html b/template/default/user/public/base.html similarity index 100% rename from template/pc/default/user/public/base.html rename to template/default/user/public/base.html diff --git a/template/pc/default/user/public/edit.html b/template/default/user/public/edit.html similarity index 100% rename from template/pc/default/user/public/edit.html rename to template/default/user/public/edit.html diff --git a/template/pc/default/user/public/left_nav.html b/template/default/user/public/left_nav.html similarity index 100% rename from template/pc/default/user/public/left_nav.html rename to template/default/user/public/left_nav.html diff --git a/template/pc/.gitignore b/template/pc/.gitignore deleted file mode 100644 index e69de29b..00000000