diff --git a/admin/manage-metas.php b/admin/manage-categories.php similarity index 69% rename from admin/manage-metas.php rename to admin/manage-categories.php index 513a8966..563900f5 100644 --- a/admin/manage-metas.php +++ b/admin/manage-categories.php @@ -2,22 +2,16 @@ include 'common.php'; include 'header.php'; include 'menu.php'; + +Typecho_Widget::widget('Widget_Metas_Category_List')->to($categories); ?>
-
-
    - type) || 'category' == $request->get('type')): ?> class="current"> - get('type')): ?> class="current"> -
-
- +
- type) || 'category' == $request->get('type')): ?> - to($categories); ?>
@@ -85,50 +79,10 @@ include 'menu.php';
- - to($tags); ?> -
-
-
- -
- - -
-
-
- -
    - have()): ?> - next()): ?> -
  • - - name(); ?> - -
  • - - -
    - -
- -
-
- type) || 'category' == $request->get('type')): ?> - form()->render(); ?> - - form()->render(); ?> - + form()->render(); ?>
@@ -233,3 +187,4 @@ include 'common-js.php'; })(); + diff --git a/admin/manage-tags.php b/admin/manage-tags.php new file mode 100644 index 00000000..802e4fe9 --- /dev/null +++ b/admin/manage-tags.php @@ -0,0 +1,91 @@ +to($tags); +?> + +
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
    + have()): ?> + next()): ?> +
  • + + name(); ?> + +
  • + + +
    + +
+ +
+ +
+
+ form()->render(); ?> +
+
+
+
+ + + + + + diff --git a/var/Widget/Menu.php b/var/Widget/Menu.php index d024d497..f02af604 100644 --- a/var/Widget/Menu.php +++ b/var/Widget/Menu.php @@ -130,7 +130,8 @@ class Widget_Menu extends Typecho_Widget array(_t('独立页面'), _t('管理独立页面'), 'manage-pages.php', 'editor', false, 'write-page.php'), array(_t('评论'), _t('管理评论'), 'manage-comments.php', 'contributor'), array(array('Widget_Comments_Admin', 'getMenuTitle'), array('Widget_Comments_Admin', 'getMenuTitle'), 'manage-comments.php?cid=', 'contributor', true), - array(_t('标签和分类'), _t('标签和分类'), 'manage-metas.php', 'editor'), + array(_t('分类'), _t('管理分类'), 'manage-categories.php', 'editor'), + array(_t('标签'), _t('管理标签'), 'manage-tags.php', 'editor'), array(_t('文件'), _t('管理文件'), 'manage-medias.php', 'editor'), array(array('Widget_Contents_Attachment_Edit', 'getMenuTitle'), array('Widget_Contents_Attachment_Edit', 'getMenuTitle'), 'media.php?cid=', 'contributor', true), array(_t('用户'), _t('管理用户'), 'manage-users.php', 'administrator', false, 'user.php'), diff --git a/var/Widget/Metas/Category/Edit.php b/var/Widget/Metas/Category/Edit.php index aa4ca498..7faf793b 100644 --- a/var/Widget/Metas/Category/Edit.php +++ b/var/Widget/Metas/Category/Edit.php @@ -160,7 +160,7 @@ class Widget_Metas_Category_Edit extends Widget_Abstract_Metas implements Widget ->where('type = ?', 'category')->limit(1)); if (!$meta) { - $this->response->redirect(Typecho_Common::url('manage-metas.php', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } $name->value($meta['name']); @@ -228,7 +228,7 @@ class Widget_Metas_Category_Edit extends Widget_Abstract_Metas implements Widget $this->permalink, $this->name), 'success'); /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /** @@ -261,7 +261,7 @@ class Widget_Metas_Category_Edit extends Widget_Abstract_Metas implements Widget $this->permalink, $this->name), 'success'); /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /** @@ -289,7 +289,7 @@ class Widget_Metas_Category_Edit extends Widget_Abstract_Metas implements Widget $deleteCount > 0 ? 'success' : 'notice'); /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /** @@ -341,7 +341,7 @@ class Widget_Metas_Category_Edit extends Widget_Abstract_Metas implements Widget if (!$this->request->isAjax()) { /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } else { $this->response->throwJson(array('success' => 1, 'message' => _t('分类排序已经完成'))); } @@ -403,7 +403,7 @@ class Widget_Metas_Category_Edit extends Widget_Abstract_Metas implements Widget } /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /** diff --git a/var/Widget/Metas/Tag/Edit.php b/var/Widget/Metas/Tag/Edit.php index f3df23d8..0ae4d620 100644 --- a/var/Widget/Metas/Tag/Edit.php +++ b/var/Widget/Metas/Tag/Edit.php @@ -157,7 +157,7 @@ class Widget_Metas_Tag_Edit extends Widget_Abstract_Metas implements Widget_Inte ->where('type = ?', 'tag')->limit(1)); if (!$meta) { - $this->response->redirect(Typecho_Common::url('manage-metas.php?type=tag', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } $name->value($meta['name']); @@ -221,7 +221,7 @@ class Widget_Metas_Tag_Edit extends Widget_Abstract_Metas implements Widget_Inte $this->permalink, $this->name), 'success'); /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php?type=tag', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /** @@ -253,7 +253,7 @@ class Widget_Metas_Tag_Edit extends Widget_Abstract_Metas implements Widget_Inte $this->permalink, $this->name), 'success'); /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php?type=tag', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /** @@ -281,7 +281,7 @@ class Widget_Metas_Tag_Edit extends Widget_Abstract_Metas implements Widget_Inte $deleteCount > 0 ? 'success' : 'notice'); /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php?type=tag', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /** @@ -315,7 +315,7 @@ class Widget_Metas_Tag_Edit extends Widget_Abstract_Metas implements Widget_Inte } /** 转向原页 */ - $this->response->redirect(Typecho_Common::url('manage-metas.php?type=tag', $this->options->adminUrl)); + $this->response->redirect(Typecho_Common::url('manage-tags.php', $this->options->adminUrl)); } /**