You are here

function headerimage_get_blocks in Header image 7

Same name and namespace in other branches
  1. 5 headerimage.module \headerimage_get_blocks()
  2. 6 headerimage.module \headerimage_get_blocks()

Return all Header Image blocks

Return value

array of Header Image blocks

9 calls to headerimage_get_blocks()
headerimage_block_confirm_delete in ./headerimage.admin.inc
Delete block form
headerimage_block_info in ./headerimage.module
Implementation of hook_block_info().
headerimage_form_alter in ./headerimage.module
Implementation of hook_form_alter
headerimage_help in ./headerimage.module
Implementation of hook_help
headerimage_settings_block_add in ./headerimage.admin.inc
Overview of all image blocks

... See full list

File

./headerimage.module, line 784
headerimage.module Conditionally display an node in a block.

Code

function headerimage_get_blocks() {
  static $blocks;
  if (!isset($blocks)) {
    $blocks = array();
    $result = db_select('headerimage_block', 'hi')
      ->fields('hi')
      ->execute();
    foreach ($result as $block) {
      if (!empty($block)) {
        $blocks[$block->delta] = $block->title;
      }
    }
  }
  return $blocks;
}