summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoitDave2012-12-10 21:21:16 (GMT)
committer doitDave2012-12-10 21:21:16 (GMT)
commitc525bdb915f08924934d60de3a4bb90eb6d6fff9 (patch)
tree012c6d96276221feec231df715f679245aaf8478
parentcfbf24e01fb32e521e914cf6cefc9c25707f6262 (diff)
Added a validation to make sure that multiquote links will not appear in collapsed comment threads.
-rw-r--r--quote_plus.module12
1 files changed, 10 insertions, 2 deletions
diff --git a/quote_plus.module b/quote_plus.module
index a25584d..cea1879 100644
--- a/quote_plus.module
+++ b/quote_plus.module
@@ -59,7 +59,6 @@ function quote_plus_comment(&$a1, $op) {
case 'view':
// Optionally add the thread-specific "vancode" ID in a readable form
// like #1, #2, #
- #dsm($a1);
break;
}
}
@@ -423,7 +422,7 @@ function quote_plus_link($type, $object, $teaser = FALSE) {
$multiquote_link_title_node, $multiquote_link_title_comment,
$multiquote_link_tip, $multiquotes, $multiquote_unlink_title_node,
$multiquote_unlink_title_comment, $multiquote_unlink_title_node,
- $multiquote_unlink_tip;
+ $multiquote_unlink_tip, $collapsed;
static $node_data = array();
static $enable_quote = array();
@@ -447,6 +446,13 @@ function quote_plus_link($type, $object, $teaser = FALSE) {
) == COMMENT_FORM_BELOW;
}
+ // 3. Does the current user view expanded or collapsed comments?
+ // (Important for adding multiquote links at all.)
+ if(!isset($collapsed)) {
+ $collapsed = _comment_get_display_setting('mode', $master_node);
+ $collapsed = $collapsed == COMMENT_MODE_FLAT_COLLAPSED || $collapsed == COMMENT_MODE_THREADED_COLLAPSED;
+ }
+
// We also need the data of the node the current object is (related to).
// But we do not want to load a node any more often than once.
if (!isset($node_data[$object->nid])) {
@@ -552,6 +558,8 @@ function quote_plus_link($type, $object, $teaser = FALSE) {
&&
$has_comment_form
&&
+ !$collapsed
+ &&
$object->nid == $master_node->nid
) {
// Determine whether this object is to be multiquoted.