You are here

function _simpleads_get_blocks_list in SimpleAds 7.2

Get advertisement blocks list.

5 calls to _simpleads_get_blocks_list()
simpleads_block_configure in includes/blocks.inc
Implements hook_block_configure().
simpleads_block_info in includes/blocks.inc
Implements hook_block_info().
simpleads_block_save in includes/blocks.inc
Implements hook_block_save().
simpleads_block_view in includes/blocks.inc
Implements hook_block_view().
simpleads_form_block_admin_display_form_alter in includes/blocks.inc
Implements hook_form_FORM_ID_alter(). Add Delete link next to the Advertisement block.

File

includes/helper.inc, line 261
Helper functions.

Code

function _simpleads_get_blocks_list() {
  $blocks = array();
  $result = db_select('simpleads_blocks', 'b')
    ->fields('b')
    ->orderBy('b.name', 'ASC')
    ->execute();
  foreach ($result as $block) {
    $blocks[$block->machine_name] = array(
      'bid' => $block->bid,
      'delta' => $block->machine_name,
      'name' => check_plain($block->name),
      'view_name' => $block->view_name,
      'view_display_id' => $block->view_display_id,
      'settings' => unserialize($block->settings),
    );
  }
  return $blocks;
}