Revision: 1525
Author: [email protected]
Date: Sat Mar 3 15:37:04 2012
Log: 修正后台修改或添加页面状态错误的问题;修正保存私密、审核日志时会新
增一篇同样日志的问题
http://code.google.com/p/typecho/source/detail?r=1525
Modified:
/trunk/var/Widget/Contents/Page/Admin.php
/trunk/var/Widget/Contents/Post/Edit.php
=======================================
--- /trunk/var/Widget/Contents/Page/Admin.php Sun Feb 7 05:30:09 2010
+++ /trunk/var/Widget/Contents/Page/Admin.php Sat Mar 3 15:37:04 2012
@@ -31,8 +31,8 @@
$select = $this->select()->where('table.contents.type
= ?', 'page');
/** 过滤状态 */
- $select->where('table.contents.status = ? OR
(table.contents.status = ? AND table.contents.parent = 0)',
- 'publish', 'draft');
+ $select->where('table.contents.status = ? OR table.contents.status
= ? OR (table.contents.status = ? AND table.contents.parent = 0)',
+ 'publish', 'waiting', 'draft');
/** 过滤标题 */
if (NULL != ($keywords = $this->request->keywords)) {
=======================================
--- /trunk/var/Widget/Contents/Post/Edit.php Fri Mar 2 00:57:10 2012
+++ /trunk/var/Widget/Contents/Post/Edit.php Sat Mar 3 15:37:04 2012
@@ -177,7 +177,7 @@
protected function publish(array $contents)
{
/** 发布内容, 检查是否具有直接发布的权限 */
- $contents['status'] = $contents['visibility']
== 'password' ? 'publish' : ($contents['visibility']
== 'private' ? 'private' : ($contents['visibility'] == 'publish' &&
$this->user->pass('editor', true) ? 'publish' : 'waiting'));
+ $contents['status'] = $contents['visibility']
== 'password' ? 'publish' : ($contents['visibility']
== 'private' ? 'private' : ($contents['visibility'] == 'waiting' |
| !$this->user->pass('editor', true) ? 'waiting' : 'publish'));
$contents['password'] = $contents['visibility'] == 'password' ?
$contents['password'] : '';
/** 真实的内容id */
@@ -233,14 +233,14 @@
protected function save(array $contents)
{
/** 发布内容, 检查是否具有直接发布的权限 */
- $contents['status'] = $contents['visibility']
== 'password' ? 'draft' : ($contents['visibility']
== 'private' ? 'private' : ($contents['visibility']
== 'publish' ? 'draft' : 'waiting'));
+ $contents['status'] = $contents['visibility']
== 'password' ? 'draft' : ($contents['visibility']
== 'private' ? 'private' : ($contents['visibility']
== 'waiting' ? 'waiting' : 'draft'));
$contents['password'] = $contents['visibility'] == 'password' ?
$contents['password'] : '';
/** 真实的内容id */
$realId = 0;
/** 如果草稿已经存在 */
- if ($this->draft) {
+ if ($this->draft || $contents['status'] == 'private' ||
$contents['status'] == 'waiting') {
/** 直接将草稿状态更改 */
if ($this->update($contents, $this->db->sql()->where('cid
= ?', $this->draft['cid']))) {
_______________________________________________
announce mailing list
[email protected]
http://lists.typecho.org/mailman/listinfo/announce