summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--includes/views/handlers/content_handler_field.inc10
-rw-r--r--includes/views/handlers/content_handler_field_multiple.inc13
3 files changed, 17 insertions, 7 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 50ff85f..4ab4287 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -4,6 +4,7 @@ CCK 6.x-3.x
===========
Features:
+- #1008184 by merlinofchaos, bojanz, dereine, yched: Adapt to Views 3 "semantic views" feature (backwards compatible with Views 2)
- #932680 by Dave Reid: Token integration : allow using of Token API's new $options
- #863226 by KarenS, make sure we have a function that will return inactive instances when other instances of the same field are still active.
- #692822 by Dave Reid, add authoring info and publishing options to CCK extra fields.
diff --git a/includes/views/handlers/content_handler_field.inc b/includes/views/handlers/content_handler_field.inc
index 4b436ad..20cf7d2 100644
--- a/includes/views/handlers/content_handler_field.inc
+++ b/includes/views/handlers/content_handler_field.inc
@@ -137,10 +137,14 @@ class content_handler_field extends views_handler_field_node {
/**
* Return DIV or SPAN based upon the field's element type.
*/
- function element_type() {
- if (isset($this->definition['element type'])) {
- return $this->definition['element type'];
+ function element_type($none_supported = FALSE, $default_empty = FALSE) {
+ // The 'element_type' property denotes Views 3.x ('semantic views'
+ // functionnality). If the property is set, and not set to '' ("default"),
+ // let the generic method handle the output.
+ if (isset($this->options['element_type']) && $this->options['element_type'] !== '') {
+ return parent::element_type($none_supported, $default_empty);
}
+
// TODO Figure out exactly when to return a div or a <span>. Any field
// that ever needs to be shown inline in Views UI. It needs to return
// a div for textareas to prevent wrapping a <span> around a <p>.
diff --git a/includes/views/handlers/content_handler_field_multiple.inc b/includes/views/handlers/content_handler_field_multiple.inc
index 7226bb3..e876e41 100644
--- a/includes/views/handlers/content_handler_field_multiple.inc
+++ b/includes/views/handlers/content_handler_field_multiple.inc
@@ -191,14 +191,19 @@ class content_handler_field_multiple extends content_handler_field {
* Fields rendered with the 'group multiple' option use <div> markers,
* and thus shouldn't be wrapped in a <span>.
*/
- function element_type() {
+ function element_type($none_supported = FALSE, $default_empty = FALSE) {
+ // If this is not a grouped field, use the parent method.
if (!$this->defer_query) {
- return parent::element_type();
+ return parent::element_type($none_supported, $default_empty);
}
- if (isset($this->definition['element type'])) {
- return $this->definition['element type'];
+ // The 'element_type' property denotes Views 3.x ('semantic views'
+ // functionnality). If the property is set, and not set to '' ("default"),
+ // let the generic method handle the output.
+ if (isset($this->options['element_type']) && $this->options['element_type'] !== '') {
+ return parent::element_type($none_supported, $default_empty);
}
+
return 'div';
}