aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/posting.php2
-rw-r--r--phpBB/styles/subSilver/template/editor.js53
-rw-r--r--phpBB/styles/subSilver/template/posting_topic_review.html55
3 files changed, 55 insertions, 55 deletions
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 @@
<!-- $Id$ -->
-<script language="JavaScript" type="text/javascript">
-<!--
-
-function insert_quote(text) {
- if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos)
- {
- var caretPos = document.forms[form_name].elements[text_name].caretPos;
- caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
- document.forms[form_name].elements[text_name].focus();
- } else {
- document.forms[form_name].elements[text_name].value += text;
- document.forms[form_name].elements[text_name].focus();
- }
-}
-
-function addquote(post_id, username) {
-
- var message_name = 'message_' + post_id;
- var theSelection = '';
-
- // Get text selection - not only the post content :(
- if ((clientVer >= 4) && is_ie && is_win)
- {
- theSelection = document.selection.createRange().text;
- }
- else if (window.getSelection)
- {
- theSelection = window.getSelection();
- }
-
- if (theSelection == '')
- {
- if (document.all)
- {
- eval("theSelection = document.all." + message_name + ".innerText;");
- }
- else
- {
- eval("theSelection = document.getElementById('" + message_name + "').firstChild.nodeValue;");
- }
- }
-
- if (theSelection != '')
- {
- insert_quote('[quote="' + username + '"]' + theSelection + '[/quote]');
- }
-
- return;
-}
-
-//-->
-</script>
-
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th align="center">{L_TOPIC_REVIEW} - {TOPIC_TITLE}</th>
@@ -101,7 +48,7 @@ function addquote(post_id, username) {
<tr>
<td valign="top"><table width="100%" cellspacing="0" cellpadding="2">
<tr>
- <td><div id="message_{topic_review_row.U_POST_ID}" class="postbody">{topic_review_row.MESSAGE}</div></td>
+ <td><div id="message_{topic_review_row.U_POST_ID}"><div class="postbody">{topic_review_row.MESSAGE}</div></div></td>
</tr>
</table></td>
</tr>