summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_display_block.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_display_block.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_display_block.inc43
1 files changed, 25 insertions, 18 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_display_block.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_display_block.inc
index 4338d75..c903a9b 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_display_block.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_display_block.inc
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Contains the block display plugin.
@@ -30,10 +31,10 @@ class views_plugin_display_block extends views_plugin_display {
if (empty($desc)) {
if ($this->display->display_title == $this->definition['title']) {
- $desc = t('View: @view', array('@view' => $this->view->get_human_name()));
+ $desc = t('View: !view', array('!view' => $this->view->get_human_name()));
}
else {
- $desc = t('View: @view: @display', array('@view' => $this->view->get_human_name(), '@display' => $this->display->display_title));
+ $desc = t('View: !view: !display', array('!view' => $this->view->get_human_name(), '!display' => $this->display->display_title));
}
}
return array(
@@ -85,11 +86,6 @@ class views_plugin_display_block extends views_plugin_display {
'value' => views_ui_truncate($block_description, 24),
);
- $cache_type = $this->get_option('block_caching');
- if (empty($cache_type)) {
- $cache_type = DRUPAL_NO_CACHE;
- }
-
$types = $this->block_caching_modes();
$options['block_caching'] = array(
'category' => 'other',
@@ -129,7 +125,6 @@ class views_plugin_display_block extends views_plugin_display {
* Provide the default form for setting options.
*/
function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
// It is very important to call the parent function here:
parent::options_form($form, $form_state);
@@ -152,6 +147,14 @@ class views_plugin_display_block extends views_plugin_display {
'#default_value' => $this->get_cache_type(),
);
break;
+ case 'exposed_form_options':
+ $this->view->init_handlers();
+ if (!$this->uses_exposed() && parent::uses_exposed()) {
+ $form['exposed_form_options']['warning'] = array(
+ '#weight' => -10,
+ '#markup' => '<div class="messages warning">' . t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.') . '</div>',
+ );
+ }
}
}
@@ -179,14 +182,13 @@ class views_plugin_display_block extends views_plugin_display {
/**
* Block views use exposed widgets only if AJAX is set.
*/
- function uses_exposed() {
- if ($this->use_ajax()) {
- return parent::uses_exposed();
+ function uses_exposed() {
+ if ($this->use_ajax()) {
+ return parent::uses_exposed();
+ }
+ return FALSE;
}
- return FALSE;
- }
-
/**
* Update the block delta when you change the machine readable name of the display.
*/
@@ -204,16 +206,21 @@ class views_plugin_display_block extends views_plugin_display {
$hashes[$md5_delta] = $delta;
$delta = $md5_delta;
}
- db_update('block')
- ->fields(array('delta' => $delta))
- ->condition('delta', $old_delta)
- ->execute();
+
+ // Maybe people don't have block module installed, so let's skip this.
+ if (db_table_exists('block')) {
+ db_update('block')
+ ->fields(array('delta' => $delta))
+ ->condition('delta', $old_delta)
+ ->execute();
+ }
// Update the hashes if needed.
if ($hashes != $old_hashes) {
variable_set('views_block_hashes', $hashes);
}
}
+
/**
* Save the block cache setting in the blocks table if this block allready
* exists in the blocks table. Dirty fix untill http://drupal.org/node/235673 gets in.