diff --git a/phpBB/posting.php b/phpBB/posting.php index 3732615140..97d170586e 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1472,7 +1472,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id 'U_POST_ID' => $row['post_id'], 'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#' . $row['post_id'], - 'U_QUOTE' => ($quote_status) ? 'javascript:addquote(' . $row['post_id'] . ", '" . str_replace("'", "\\'", $poster) . "')" : '', + 'U_QUOTE' => ($auth->acl_get('f_quote', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . str_replace("'", "\\'", $poster) . "')" : '', 'S_ROW_COUNT' => $i) ); diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index a54a31db38..79f633fa70 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -102,6 +102,59 @@ function attach_inline() { insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]'); } +function addquote(post_id, username) { + + var message_name = 'message_' + post_id; + var theSelection = ''; + var divarea = false; + + if (document.all) + { + eval("divarea = document.all." + message_name + ";"); + } + else + { + eval("divarea = document.getElementById('" + message_name + "');"); + } + + // Get text selection - not only the post content :( + if (window.getSelection) + { + theSelection = window.getSelection().toString(); + } + else if (document.getSelection) + { + theSelection = document.getSelection(); + } + else if (document.selection) + { + theSelection = document.selection.createRange().text; + } + + if (theSelection == '') + { + if (document.all) + { + theSelection = divarea.innerText; + } + else if (divarea.textContent) + { + theSelection = divarea.textContent; + } + else if (divarea.firstChild.nodeValue) + { + theSelection = divarea.firstChild.nodeValue; + } + } + + if (theSelection) + { + insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); + } + + return; +} + function bbstyle(bbnumber) { donotinsert = false; diff --git a/phpBB/styles/subSilver/template/posting_topic_review.html b/phpBB/styles/subSilver/template/posting_topic_review.html index 421f2b45e3..0a29a3758e 100644 --- a/phpBB/styles/subSilver/template/posting_topic_review.html +++ b/phpBB/styles/subSilver/template/posting_topic_review.html @@ -1,58 +1,5 @@ - -
{L_TOPIC_REVIEW} - {TOPIC_TITLE} | @@ -101,7 +48,7 @@ function addquote(post_id, username) {||
---|---|---|
|