From 1cd85e5010c3f2d4e3b360aeffff56aaf1721886 Mon Sep 17 00:00:00 2001 From: joyqi Date: Fri, 1 Nov 2013 12:11:31 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20#46=20=E8=BF=99=E6=98=AF=E7=94=B1?= =?UTF-8?q?=E4=BA=8E=E5=88=A4=E6=96=AD=E7=B1=BB=E5=9E=8B=E7=9A=84bug?= =?UTF-8?q?=E9=80=A0=E6=88=90=E7=9A=84=E8=8D=89=E7=A8=BF=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=A2=AB=E8=AF=86=E5=88=AB=EF=BC=8C=E5=A6=82=E6=9E=9C=E8=BF=98?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=8C=E7=9B=B4=E6=8E=A5=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=A1=B5=E9=9D=A2=E7=84=B6=E5=90=8E=E9=87=8D=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/manage-pages.php | 8 ++++---- var/Widget/Contents/Post/Admin.php | 4 ++-- var/Widget/Contents/Post/Edit.php | 12 ++++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/admin/manage-pages.php b/admin/manage-pages.php index 32be4535..a9a7f057 100644 --- a/admin/manage-pages.php +++ b/admin/manage-pages.php @@ -63,13 +63,13 @@ $stat = Typecho_Widget::widget('Widget_Stat'); title(); ?> hasSaved || 'page_draft' == $pages->type) { - echo '(' . _t('草稿') . ')'; + echo '' . _t('草稿') . ''; } else if ('waiting' == $pages->status) { - echo '(' . _t('待审核') . ')'; + echo '' . _t('待审核') . ''; } else if ('private' == $pages->status) { - echo '(' . _t('私密') . ')'; + echo '' . _t('私密') . ''; } else if ($pages->password) { - echo '(' . _t('密码保护') . ')'; + echo '' . _t('密码保护') . ''; } ?> type): ?> diff --git a/var/Widget/Contents/Post/Admin.php b/var/Widget/Contents/Post/Admin.php index fdb286bd..80621d33 100644 --- a/var/Widget/Contents/Post/Admin.php +++ b/var/Widget/Contents/Post/Admin.php @@ -61,8 +61,8 @@ class Widget_Contents_Post_Admin extends Widget_Abstract_Contents { $savedPost = $this->db->fetchRow($this->db->select('cid', 'modified') ->from('table.contents') - ->where('table.contents.parent = ? AND table.contents.type = ?', - $this->cid, 'post_draft') + ->where('table.contents.parent = ? AND (table.contents.type = ? OR table.contents.type = ?)', + $this->cid, 'post_draft', 'page_draft') ->limit(1)); if ($savedPost) { diff --git a/var/Widget/Contents/Post/Edit.php b/var/Widget/Contents/Post/Edit.php index c0bc161e..116d13c7 100644 --- a/var/Widget/Contents/Post/Edit.php +++ b/var/Widget/Contents/Post/Edit.php @@ -63,8 +63,8 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg return $this->row; } else { return $this->db->fetchRow($this->widget('Widget_Abstract_Contents')->select() - ->where('table.contents.parent = ? AND table.contents.type = ?', - $this->cid, 'post_draft') + ->where('table.contents.parent = ? AND (table.contents.type = ? OR table.contents.type = ?)', + $this->cid, 'post_draft', 'page_draft') ->limit(1), array($this->widget('Widget_Abstract_Contents'), 'filter')); } } @@ -178,7 +178,9 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg { /** 发布内容, 检查是否具有直接发布的权限 */ if ($this->user->pass('editor', true)) { - if ('password' == $contents['visibility'] || !in_array($contents['visibility'], array('private', 'waiting', 'publish'))) { + if (empty($contents['visibility'])) { + $contents['status'] = 'publish'; + } else if ('password' == $contents['visibility'] || !in_array($contents['visibility'], array('private', 'waiting', 'publish'))) { if (empty($contents['password']) || 'password' != $contents['visibility']) { $contents['password'] = ''; } @@ -248,7 +250,9 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg { /** 发布内容, 检查是否具有直接发布的权限 */ if ($this->user->pass('editor', true)) { - if ('password' == $contents['visibility'] || !in_array($contents['visibility'], array('private', 'waiting', 'publish'))) { + if (empty($contents['visibility'])) { + $contents['status'] = 'publish'; + } else if ('password' == $contents['visibility'] || !in_array($contents['visibility'], array('private', 'waiting', 'publish'))) { if (empty($contents['password']) || 'password' != $contents['visibility']) { $contents['password'] = ''; }