Commit 23b1aa33 by Scott

Deprecate old *_set_hidden functions in favor of *_set_status

parent db0ca0eb
......@@ -532,28 +532,28 @@ function qa_admin_single_click($entityid, $action)
switch ($action) {
case 'approve':
if ($queued && !qa_user_post_permit_error('permit_moderate', $post)) {
qa_post_set_hidden($entityid, false, $userid);
qa_post_set_status($entityid, QA_POST_STATUS_NORMAL, $userid);
return true;
}
break;
case 'reject':
if ($queued && !qa_user_post_permit_error('permit_moderate', $post)) {
qa_post_set_hidden($entityid, true, $userid);
qa_post_set_status($entityid, QA_POST_STATUS_HIDDEN, $userid);
return true;
}
break;
case 'hide':
if (!$queued && !qa_user_post_permit_error('permit_hide_show', $post)) {
qa_post_set_hidden($entityid, true, $userid);
qa_post_set_status($entityid, QA_POST_STATUS_HIDDEN, $userid);
return true;
}
break;
case 'reshow':
if ($post['hidden'] && !qa_user_post_permit_error('permit_hide_show', $post)) {
qa_post_set_hidden($entityid, false, $userid);
qa_post_set_status($entityid, QA_POST_STATUS_NORMAL, $userid);
return true;
}
break;
......
......@@ -270,7 +270,7 @@ function qa_question_close_other($oldquestion, $oldclosepost, $note, $userid, $h
/**
* Set $oldquestion to hidden if $hidden is true, visible/normal if otherwise. All other parameters are as for qa_question_set_status(...)
* This function is included mainly for backwards compatibility.
* @deprecated Replaced by qa_question_set_status.
* @param $oldquestion
* @param $hidden
* @param $userid
......@@ -670,7 +670,7 @@ function qa_answer_set_content($oldanswer, $content, $format, $text, $notify, $u
/**
* Set $oldanswer to hidden if $hidden is true, visible/normal if otherwise. All other parameters are as for qa_answer_set_status(...)
* This function is included mainly for backwards compatibility.
* @deprecated Replaced by qa_answer_set_status.
* @param $oldanswer
* @param $hidden
* @param $userid
......@@ -1064,7 +1064,7 @@ function qa_answer_to_comment($oldanswer, $parentid, $content, $format, $text, $
/**
* Set $oldcomment to hidden if $hidden is true, visible/normal if otherwise. All other parameters are as for qa_comment_set_status(...)
* This function is included mainly for backwards compatibility.
* @deprecated Replaced by qa_comment_set_status.
* @param $oldcomment
* @param $hidden
* @param $userid
......
......@@ -237,7 +237,8 @@ function qa_post_set_closed($questionid, $closed = true, $originalpostid = null,
/**
* Hide $postid if $hidden is true, otherwise show the post. Pass the identify of the user making this change in
* $byuserid (or null for a silent change). This function is included mainly for backwards compatibility.
* $byuserid (or null for a silent change).
* @deprecated Replaced by qa_post_set_status.
* @param $postid
* @param bool $hidden
* @param $byuserid
......@@ -315,7 +316,7 @@ function qa_post_delete($postid)
$oldpost = qa_post_get_full($postid, 'QAC');
if (!$oldpost['hidden']) {
qa_post_set_hidden($postid, true, null);
qa_post_set_status($postid, QA_POST_STATUS_HIDDEN, null);
$oldpost = qa_post_get_full($postid, 'QAC');
}
......
......@@ -109,7 +109,7 @@ if (qa_clicked('doblock') || qa_clicked('dounblock') || qa_clicked('dohideall'))
$postids = qa_db_get_ip_visible_postids($ip);
foreach ($postids as $postid)
qa_post_set_hidden($postid, true, $userid);
qa_post_set_status($postid, QA_POST_STATUS_HIDDEN, $userid);
qa_redirect(qa_request());
}
......
......@@ -56,7 +56,7 @@ function qa_page_q_single_click_q($question, $answers, $commentsfollows, $closep
if ((qa_clicked('q_dohide') && $question['hideable']) || (qa_clicked('q_doreject') && $question['moderatable'])) {
if (qa_page_q_click_check_form_code($question, $error)) {
qa_question_set_hidden($question, true, $userid, $handle, $cookieid, $answers, $commentsfollows, $closepost);
qa_question_set_status($question, QA_POST_STATUS_HIDDEN, $userid, $handle, $cookieid, $answers, $commentsfollows, $closepost);
return true;
}
}
......@@ -99,7 +99,7 @@ function qa_page_q_single_click_q($question, $answers, $commentsfollows, $closep
$error = qa_flag_error_html($question, $userid, qa_request());
if (!$error) {
if (qa_flag_set_tohide($question, $userid, $handle, $cookieid, $question))
qa_question_set_hidden($question, true, null, null, null, $answers, $commentsfollows, $closepost); // hiding not really by this user so pass nulls
qa_question_set_status($question, QA_POST_STATUS_HIDDEN, null, null, null, $answers, $commentsfollows, $closepost); // hiding not really by this user so pass nulls
return true;
}
}
......@@ -155,7 +155,7 @@ function qa_page_q_single_click_a($answer, $question, $answers, $commentsfollows
if ((qa_clicked($prefix . 'dohide') && $answer['hideable']) || (qa_clicked($prefix . 'doreject') && $answer['moderatable'])) {
if (qa_page_q_click_check_form_code($answer, $error)) {
qa_answer_set_hidden($answer, true, $userid, $handle, $cookieid, $question, $commentsfollows);
qa_answer_set_status($answer, QA_POST_STATUS_HIDDEN, $userid, $handle, $cookieid, $question, $commentsfollows);
return true;
}
}
......@@ -203,7 +203,7 @@ function qa_page_q_single_click_a($answer, $question, $answers, $commentsfollows
$error = qa_flag_error_html($answer, $userid, qa_request());
if (!$error) {
if (qa_flag_set_tohide($answer, $userid, $handle, $cookieid, $question))
qa_answer_set_hidden($answer, true, null, null, null, $question, $commentsfollows); // hiding not really by this user so pass nulls
qa_answer_set_status($answer, QA_POST_STATUS_HIDDEN, null, null, null, $question, $commentsfollows); // hiding not really by this user so pass nulls
return true;
}
......@@ -247,7 +247,7 @@ function qa_page_q_single_click_c($comment, $question, $parent, &$error)
if ((qa_clicked($prefix . 'dohide') && $comment['hideable']) || (qa_clicked($prefix . 'doreject') && $comment['moderatable'])) {
if (qa_page_q_click_check_form_code($parent, $error)) {
qa_comment_set_hidden($comment, true, $userid, $handle, $cookieid, $question, $parent);
qa_comment_set_status($comment, QA_POST_STATUS_HIDDEN, $userid, $handle, $cookieid, $question, $parent);
return true;
}
}
......@@ -295,7 +295,7 @@ function qa_page_q_single_click_c($comment, $question, $parent, &$error)
$error = qa_flag_error_html($comment, $userid, qa_request());
if (!$error) {
if (qa_flag_set_tohide($comment, $userid, $handle, $cookieid, $question))
qa_comment_set_hidden($comment, true, null, null, null, $question, $parent); // hiding not really by this user so pass nulls
qa_comment_set_status($comment, QA_POST_STATUS_HIDDEN, null, null, null, $question, $parent); // hiding not really by this user so pass nulls
return true;
}
......
......@@ -275,7 +275,7 @@ if (!QA_FINAL_EXTERNAL_USERS) {
$postids = qa_db_get_user_visible_postids($userid);
foreach ($postids as $postid)
qa_post_set_hidden($postid, true, $loginuserid);
qa_post_set_status($postid, QA_POST_STATUS_HIDDEN, $loginuserid);
qa_redirect(qa_request());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment