44 * 模板预览插件 【<a href="https://github.com/typecho-fans/plugins" target="_blank">TF</a>社区维护版】
55 *
66 * @package ThemeDemo
7- * @author ShingChi, doudou
8- * @version 1.2.1
7+ * @author ShingChi, doudou, hongweipeng
8+ * @version 1.2.2
99 * @link https://github.com/typecho-fans/plugins/tree/master/ThemeDemo
1010 */
1111/**
@@ -82,7 +82,7 @@ public static function personalConfig(Typecho_Widget_Helper_Form $form){}
8282
8383 /**
8484 * 输出导航条并配置路由表
85- *
85+ *
8686 * @access public
8787 * @return void
8888 */
@@ -119,10 +119,10 @@ public static function setMode(){
119119
120120 //配置路由表
121121 if ($ settings ->mode == 'cookie ' ) {
122- return ;
122+ return ;
123123 }
124124 $ routes = $ options ->routingTable ;
125- $ pathinfo = Typecho_Router:: getPathInfo ();
125+ $ pathinfo = Typecho_Request:: getInstance ()-> getPathInfo ();
126126 if (preg_match ('([^/]+) ' , $ pathinfo , $ matches )) {
127127 if (!self ::check ($ matches [0 ])) return ;
128128 } else {
@@ -199,10 +199,10 @@ public static function setTheme($widget)
199199
200200 /** 配置模版信息 */
201201 if (!empty ($ themeInfo ['config ' ])) {
202- $ options ->{'theme: ' . $ themeName } = $ themeInfo ['config ' ];
203- foreach (unserialize ($ themeInfo ['config ' ]) as $ row => $ value ) {
204- $ options ->{$ row } = $ value ;
205- }
202+ $ options ->{'theme: ' . $ themeName } = $ themeInfo ['config ' ];
203+ foreach (unserialize ($ themeInfo ['config ' ]) as $ row => $ value ) {
204+ $ options ->{$ row } = $ value ;
205+ }
206206 }
207207
208208 /** 配置模版 */
@@ -249,4 +249,4 @@ public static function themeInfo($themeName)
249249
250250 return array ('theme ' => $ themeName , 'config ' => isset ($ config ) ? $ config : '' );
251251 }
252- }
252+ }
0 commit comments