You are here

function sna_blocks_block_info in Simple Node Archive Blocks 7

Implements hook_block_info().

File

./sna_blocks.module, line 59
Provide a simple node archive block

Code

function sna_blocks_block_info() {

  // Node archive.
  $block_types = variable_get('sna_blocks_block_types', array(
    'page',
  ));
  foreach ($block_types as $type => $value) {

    // Check the selected block types.
    if ($value != '0') {
      $blocks['sna-node-' . $value] = array(
        'info' => t('Simple Node Archive - Node : @name', array(
          '@name' => $value,
        )),
      );
    }
  }

  // Taxonomy archive.
  $taxonomy_options = variable_get('sna_blocks_taxonomy_options', array());
  $taxonomy_archive = variable_get('sna_blocks_taxonomy_items', array());
  foreach ($taxonomy_archive as $type => $value) {

    // Check the selected block types.
    if ($value != '0') {
      $blocks['sna-taxo-' . $value] = array(
        'info' => t('Simple Node Archive - Taxonomy : @name', array(
          '@name' => $taxonomy_options[$value],
        )),
      );
    }
  }
  return $blocks;
}