Commit 21932fc1 authored by changi67's avatar changi67

[FIX] Code duplication / factorization

parent e73deb53
......@@ -60,7 +60,7 @@ if (isset($_REQUEST['remove_attachment'])) {
}
if (isset($_REQUEST['qId'])) {
if (isset($_REQUEST['save'])) {
if (isset($_REQUEST['save']) || isset($_REQUEST['saveapp'])) {
check_ticket('forum-queue');
$smarty->assign('form', 'n');
......@@ -91,6 +91,8 @@ if (isset($_REQUEST['qId'])) {
$commentslib->replace_queue($_REQUEST['qId'], $_REQUEST['forumId'], 'forum' . $_REQUEST['forumId'], $_REQUEST['parentId'],
$user, $_REQUEST['title'], $_REQUEST['data'], $_REQUEST['type'], $_REQUEST['topic_smiley'], $_REQUEST['summary'],
$_REQUEST['topic_title'], $_REQUEST['in_reply_to']);
if ( isset($_REQUEST['saveapp']) )
$commentslib->approve_queued($_REQUEST['qId']);
unset ($_REQUEST['qId']);
}
......@@ -100,41 +102,6 @@ if (isset($_REQUEST['qId'])) {
$commentslib->remove_queued($_REQUEST['qId']);
}
if (isset($_REQUEST['saveapp'])) {
check_ticket('forum-queue');
$smarty->assign('form', 'n');
if (!isset($_REQUEST['summary']))
$_REQUEST['summary'] = '';
if (!isset($_REQUEST['topic_smiley']))
$_REQUEST['topic_smiley'] = '';
if (!isset($_REQUEST['type']))
$_REQUEST['type'] = '';
if (!isset($_REQUEST['topic_title']))
$_REQUEST['topic_title'] = '';
if (!isset($_REQUEST['in_reply_to']))
$_REQUEST['in_reply_to'] = '';
if (!isset($_REQUEST['parentId']))
$_REQUEST['parentId'] = $msg_info['parentId'];
if ($_REQUEST['parentId'] > 0) {
$p_info = $commentslib->get_comment($_REQUEST['parentId']);
$_REQUEST['topic_title'] = $p_info['title'];
}
$commentslib->replace_queue($_REQUEST['qId'], $_REQUEST['forumId'], 'forum' . $_REQUEST['forumId'], $_REQUEST['parentId'],
$user, $_REQUEST['title'], $_REQUEST['data'], $_REQUEST['type'], $_REQUEST['topic_smiley'], $_REQUEST['summary'],
$_REQUEST['topic_title'], $_REQUEST['in_reply_to']);
$commentslib->approve_queued($_REQUEST['qId']);
unset ($_REQUEST['qId']);
}
if (isset($_REQUEST['topicize'])) {
check_ticket('forum-queue');
$smarty->assign('form', 'n');
......
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