Commit a7e660d9 authored by yched's avatar yched

#1008184 by merlinofchaos, bojanz, dereine, yched: Adapt to Views 3 "semantic...

#1008184 by merlinofchaos, bojanz, dereine, yched: Adapt to Views 3 "semantic views" feature (backwards compatible with Views 2)
parent 186b11dc
......@@ -12,7 +12,7 @@ CCK 6.x-2.x
- #932680 by Dave Reid: Token integration - allow using of Token API's new $options param
- #986612 by Dave Reid: Token integration - fix variable name clash (harmless in normal cases)
- #435520 by yched, sun: Fix text fields rendered as 'n/a' in some cases
- #1008184 by merlinofchaos, bojanz, dereine, yched: Adapt to Views 3 "semantic views" feature (backwards compatible with Views 2)
CCK 6.x-2.8
===========
......
......@@ -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>.
......
......@@ -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';
}
......
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