aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorJosh Woody <a_jelly_doughnut@phpbb.com>2010-06-30 13:38:49 -0500
committerJoas Schilling <nickvergessen@gmx.de>2012-08-29 17:50:11 +0200
commita80cfafdd91a384ba810a8ee0d43406bba955faa (patch)
tree0c00c9e50e65e8e6af11494c63645d916bd38216 /phpBB/posting.php
parent67393751356e9f02f7c1ab0a2f7a3a508403edc3 (diff)
downloadforums-a80cfafdd91a384ba810a8ee0d43406bba955faa.tar
forums-a80cfafdd91a384ba810a8ee0d43406bba955faa.tar.gz
forums-a80cfafdd91a384ba810a8ee0d43406bba955faa.tar.bz2
forums-a80cfafdd91a384ba810a8ee0d43406bba955faa.tar.xz
forums-a80cfafdd91a384ba810a8ee0d43406bba955faa.zip
[feature/soft-delete] Rename phpbb_visibility class to phpbb_content_visibility
Rename the class to more accurately reflect what it does. PHPBB3-9657
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 221d469b4a..877ebc6404 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -99,7 +99,7 @@ switch ($mode)
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id
- AND " . phpbb_visibility::get_visibility_sql('topic', $forum_id, 't.');
+ AND " . phpbb_content_visibility::get_visibility_sql('topic', $forum_id, 't.');
break;
case 'quote':
@@ -128,7 +128,7 @@ switch ($mode)
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
AND f.forum_id = t.forum_id
- AND " . phpbb_visibility::get_visibility_sql('topic', $forum_id, 't.');
+ AND " . phpbb_content_visibility::get_visibility_sql('topic', $forum_id, 't.');
break;
case 'smilies':
@@ -181,13 +181,6 @@ if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'b
trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED');
}
-if ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED && !isset($_POST['soft_delete']) && phpbb_visibility::can_restore($forum_id, $post_data['poster_id'], $post_data['post_edit_locked']))
-{
- // don't feel that a confirm_box is needed for this
- // do not return / trigger_error after this because the post content can also be changed
- phpbb_visibility::unhide_posts_topics('restore', array($post_id => $post_data), array($post_id));
-}
-
if ($mode == 'popup')
{
upload_popup($post_data['forum_style']);
@@ -891,6 +884,13 @@ if ($submit || $preview || $refresh)
$error[] = $user->lang['FORM_INVALID'];
}
+ if ($submit && $mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED && !isset($_POST['soft_delete']) && phpbb_content_visibility::can_restore($forum_id, $post_data['poster_id'], $post_data['post_edit_locked']))
+ {
+ // don't feel that a confirm_box is needed for this
+ // do not return / trigger_error after this because the post content can also be changed
+ phpbb_content_visibility::unhide_posts_topics('restore', array($post_id => $post_data), array($post_id));
+ }
+
// Parse subject
if (!$preview && !$refresh && utf8_clean_string($post_data['post_subject']) === '' && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id)))
{
@@ -1429,8 +1429,8 @@ $template->assign_vars(array(
'S_LOCK_POST_ALLOWED' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false,
'S_LOCK_POST_CHECKED' => ($lock_post_checked) ? ' checked="checked"' : '',
'S_SOFT_DELETE_CHECKED' => ($mode == 'edit' && $post_data['post_visibility'] == ITEM_DELETED) ? ' checked="checked"' : '',
- 'S_SOFT_DELETE_ALLOWED' => (phpbb_visibility::can_soft_delete($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false,
- 'S_RESTORE_ALLOWED' => (phpbb_visibility::can_restore($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false,
+ 'S_SOFT_DELETE_ALLOWED' => (phpbb_content_visibility::can_soft_delete($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false,
+ 'S_RESTORE_ALLOWED' => (phpbb_content_visibility::can_restore($forum_id, $post_data['poster_id'], $lock_post_checked)) ? true : false,
'S_IS_DELETED' => ($post_data['post_visibility'] == POST_DELETED) ? true : false,
'S_LINKS_ALLOWED' => $url_status,
'S_MAGIC_URL_CHECKED' => ($urls_checked) ? ' checked="checked"' : '',