You are here

function mefibs_display_is_mefibs_enabled in MEFIBS - More exposed forms in blocks 7

Same name and namespace in other branches
  1. 8 mefibs.module \mefibs_display_is_mefibs_enabled()

Check if mefibs is enabled for the given display handler.

Parameters

object $display_handler:

Return value

boolean

7 calls to mefibs_display_is_mefibs_enabled()
mefibs_block_info in ./mefibs.module
Implements hook_block_info().
mefibs_block_info_alter in ./mefibs.module
Implements hook_block_info_alter().
mefibs_block_view in ./mefibs.module
Implements hook_block_view().
mefibs_exposed_block_form in ./mefibs.module
Form builder for the additional exposed form.
mefibs_exposed_block_form_submit in ./mefibs.module
Custom submit handler for exposed forms.

... See full list

File

./mefibs.module, line 1137
Primarily Drupal hooks and global API functions to manipulate views and to provide an additional block with an exposed filter form.

Code

function mefibs_display_is_mefibs_enabled($display_handler) {
  if (!is_object($display_handler) || !method_exists($display_handler, 'get_option')) {
    return FALSE;
  }
  if (!isset($display_handler->extender['mefibs_blocks'])) {
    return FALSE;
  }
  if (!$display_handler
    ->get_option('exposed_block')) {
    return FALSE;
  }
  $mefibs_blocks = $display_handler->extender['mefibs_blocks']
    ->get_enabled_blocks();
  return count($mefibs_blocks) > 0;
}