Skip to content
This repository was archived by the owner on May 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from jzwalk/master
Browse files Browse the repository at this point in the history
针对自定义admin目录与rewrite判断问题修正 #1
  • Loading branch information
Che Kun committed May 10, 2014
2 parents ec88608 + 4bd69e5 commit 7888022
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package AppStore
* @author chekun
* @version 1.0.1
* @version 1.0.0
* @link http://typecho.dilicms.com
*/
class AppStore_Plugin implements Typecho_Plugin_Interface
Expand Down Expand Up @@ -37,8 +37,8 @@ public static function activate()

//创建菜单和路由
Helper::addPanel(3, 'AppStore/market.php', '应用商店', '应用商店', 'administrator');
Helper::addRoute('app.store.market', '/admin/app-store/market', 'AppStore_Action', 'market');
Helper::addRoute('app.store.install', '/admin/app-store/install', 'AppStore_Action', 'install');
Helper::addRoute('app.store.market', __TYPECHO_ADMIN_DIR__.'app-store/market', 'AppStore_Action', 'market');
Helper::addRoute('app.store.install', __TYPECHO_ADMIN_DIR__.'app-store/install', 'AppStore_Action', 'install');
}

/**
Expand Down Expand Up @@ -88,4 +88,4 @@ public static function config(Typecho_Widget_Helper_Form $form)
*/
public static function personalConfig(Typecho_Widget_Helper_Form $form){}

}
}
7 changes: 5 additions & 2 deletions market.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<?php !defined('__TYPECHO_ROOT_DIR__') and exit();

Typecho_Response::getInstance()->redirect('/index.php/admin/app-store/market');
$options = Helper::options();
$siteUrl = $options->siteUrl;
$isRewrite = $options->rewrite;
$absUrl = ($isRewrite ? rtrim($siteUrl, '/') : $siteUrl."index.php");
Typecho_Response::getInstance()->redirect($absUrl.__TYPECHO_ADMIN_DIR__.'app-store/market');
2 changes: 1 addition & 1 deletion views/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function init()
}

$.ajax({
url: '<?php echo str_replace('/market', '/install', Typecho_Request::getInstance()->getRequestUrl()); ?>',
url: '<?php echo $options->adminUrl('app-store/install'); ?>',
dataType: 'json',
data: {
version: $version.val(),
Expand Down

0 comments on commit 7888022

Please sign in to comment.