You are here

function alinks_menu in Alinks 6

Same name and namespace in other branches
  1. 7 alinks.module \alinks_menu()

Implementation of hook_menu().

File

./alinks.module, line 23

Code

function alinks_menu() {
  $items = array();
  $admin = array(
    'administer site configuration',
  );
  $editor = array(
    'edit alinks',
  );
  $items['admin/settings/alinks'] = array(
    'title' => t('Alinks'),
    'description' => t('Set the preferences for Alinks module.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'alinks_admin_settings',
    ),
    'access arguments' => $admin,
  );
  $items['admin/build/alinks'] = array(
    'title' => t('Alinks'),
    'description' => t('Define & edit alinks'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'alinks_add_form',
    ),
    'access arguments' => $editor,
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/build/alinks/add'] = array(
    'title' => t('Add Alink'),
    'description' => t('Add alink'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'alinks_add_form',
    ),
    'access arguments' => $editor,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/build/alinks/edit'] = array(
    'title' => t('Edit Alinks'),
    'description' => t('Edit alinks'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'alinks_edit_form',
    ),
    'access arguments' => $editor,
    'type' => MENU_LOCAL_TASK,
  );
  drupal_add_js('
$(function(){
  $(\'a[@rel$="external"]\')
    .click(function(){this.target = "_blank";
    });
});', 'inline');
  return $items;
}