summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area.inc24
1 files changed, 22 insertions, 2 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area.inc
index 295e14d..9fed11c 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_area.inc
@@ -1,17 +1,37 @@
<?php
+
/**
* @file
* Views area handlers.
*/
/**
- * @defgroup views_area_handlers Views' area handlers
+ * @defgroup views_area_handlers Views area handlers
* @{
* Handlers to tell Views what can display in header, footer
* and empty text in a view.
*/
+/**
+ * Base class for area handlers.
+ *
+ * @ingroup views_area_handlers
+ */
class views_handler_area extends views_handler {
+
+ /**
+ * Overrides views_handler::init().
+ *
+ * Make sure that no result area handlers are set to be shown when the result
+ * is empty.
+ */
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ if ($this->handler_type == 'empty') {
+ $this->options['empty'] = TRUE;
+ }
+ }
+
/**
* Get this field's label.
*/
@@ -28,7 +48,7 @@ class views_handler_area extends views_handler {
$this->definition['field'] = !empty($this->definition['field']) ? $this->definition['field'] : '';
$label = !empty($this->definition['label']) ? $this->definition['label'] : $this->definition['field'];
$options['label'] = array('default' => $label, 'translatable' => TRUE);
- $options['empty'] = array('default' => 0, 'bool' => TRUE);
+ $options['empty'] = array('default' => FALSE, 'bool' => TRUE);
return $options;
}