You are here

function twitter_block_menu in Twitter Block 7.2

Same name and namespace in other branches
  1. 7 twitter_block.module \twitter_block_menu()

Implements hook_menu().

File

./twitter_block.module, line 49
A module to provide simple Twitter blocks using the Twitter Search API.

Code

function twitter_block_menu() {

  // Create an array of block settings.
  $settings = array(
    'title' => 'Add Twitter block',
    'description' => 'Add a new Twitter block.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'twitter_block_add_block_form',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'twitter_block.admin.inc',
  );

  // Add a local action to the block configuration page.
  $items['admin/structure/block/add-twitter-block'] = array(
    'access arguments' => array(
      'administer blocks',
    ),
  ) + $settings;

  // Get the default site theme.
  $default_theme = variable_get('theme_default', 'bartik');

  // Add a local action to the per-theme block configuration pages.
  foreach (list_themes() as $key => $theme) {
    if ($key != $default_theme) {
      $items['admin/structure/block/list/' . $key . '/add-twitter-block'] = array(
        'access callback' => '_twitter_block_themes_access',
        'access arguments' => array(
          $theme,
        ),
      ) + $settings;
    }
  }
  $items['admin/structure/block/administer/twitter_block/%/delete'] = array(
    'title' => 'Delete Twitter block',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'twitter_block_delete',
      5,
    ),
    'access arguments' => array(
      'administer blocks',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'twitter_block.admin.inc',
  );
  $items['admin/config/system/twitter-block'] = array(
    'title' => 'Twitter Block',
    'description' => 'Configure cache settings for Twitter blocks.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'twitter_block_admin_settings_form',
    ),
    'access arguments' => array(
      'administer twitter block',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'twitter_block.admin.inc',
  );
  return $items;
}