You are here

function biblio_menu in Bibliography Module 7

Same name and namespace in other branches
  1. 5 biblio.module \biblio_menu()
  2. 6.2 biblio.module \biblio_menu()
  3. 6 biblio.module \biblio_menu()
  4. 7.2 biblio.module \biblio_menu()

Implements hook_menu().

Here we define some built in links for the biblio module, links exposed are:

File

./biblio.module, line 635
Bibliography Module for Drupal.

Code

function biblio_menu() {
  global $user;
  $items = array();
  $base = variable_get('biblio_base', 'biblio');
  $base_title = check_plain(variable_get('biblio_base_title', 'Biblio'));
  $items["{$base}"] = array(
    'title' => $base_title,
    'page callback' => 'biblio_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
  );
  $items["{$base}/authors"] = array(
    'title' => 'Authors',
    'page callback' => 'biblio_author_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    'weight' => 1,
  );
  $items["{$base}/keywords"] = array(
    'title' => 'Keywords',
    'page callback' => 'biblio_keyword_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    // 'type' => MENU_LOCAL_TASK,.
    'weight' => 2,
  );
  $items["{$base}/import"] = array(
    'title' => 'Import',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_import_form',
    ),
    'file' => 'includes/biblio.import.export.inc',
    'access callback' => 'user_access',
    'access arguments' => array(
      'import from file',
    ),
    // 'type'              => MENU_LOCAL_TASK,.
    'weight' => 10,
  );
  $items["{$base}/user/%"] = array(
    'title' => 'My publications',
    'page callback' => 'biblio_profile_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_biblio_profile_access',
    'access arguments' => array(
      2,
      'menu',
    ),
    'parent' => '',
    'file' => 'includes/biblio.pages.inc',
  );

  /*
    $items["$base/backup"] = array(
    'title' => '',
    'page callback' => 'biblio_backup',
    'access callback' => 'user_access',
    'access arguments' => array('access content'),
    'file' => 'biblio.import.export.inc',
    'type' => MENU_CALLBACK
    );
  */
  $items["{$base}/pot"] = array(
    'title' => '',
    'page callback' => 'biblio_dump_db_data_for_pot',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'type' => MENU_CALLBACK,
  );
  $wildcard = 2 + (count(explode("/", $base)) - 1);
  $items[$base . '/authors/%'] = array(
    'title' => 'Show author information',
    'page callback' => 'biblio_goto',
    'page arguments' => array(
      $base,
      'f[author]',
      2,
    ),
    'access arguments' => array(
      'access biblio content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/authors/%/edit"] = array(
    'title' => 'Edit author information',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_author_edit_form',
      $wildcard,
    ),
    'access callback' => 'biblio_access',
    'access arguments' => array(
      'edit_author',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/keywords/%/edit"] = array(
    'title' => '',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_keyword_edit_form',
      $wildcard,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/keyword/%/delete"] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_keyword_delete_confirm',
      $wildcard,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'weight' => 1,
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/view/%"] = array(
    'page callback' => 'biblio_view_node',
    'page arguments' => array(
      $wildcard,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    'type' => MENU_CALLBACK,
  );
  $items["user/%user/{$base}"] = array(
    'title' => 'Publications',
    'page callback' => 'biblio_profile_page',
    'page arguments' => array(
      1,
      'profile',
      'no_filters',
    ),
    'access callback' => '_biblio_profile_access',
    'access arguments' => array(
      1,
      'profile',
    ),
    'file' => 'includes/biblio.pages.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/content/biblio'] = array(
    'title' => 'Biblio settings',
    'description' => 'Configure default behavior of the Biblio module.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_settings',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
  );
  $items['admin/config/content/biblio/basic'] = array(
    'title' => 'Preferences',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/content/biblio/import'] = array(
    'title' => 'Data import',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_import_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.import.export.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
  );
  $items['admin/config/content/biblio/export'] = array(
    'title' => 'Export',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_export_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.import.export.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );
  $items['admin/config/content/biblio/fields'] = array(
    'title' => 'Fields',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_types_edit_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
  );
  $items['admin/config/content/biblio/fields/common'] = array(
    'title' => 'Common',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_types_edit_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/content/biblio/iomap'] = array(
    'title' => 'Import/Export Mapping',
    'page callback' => 'biblio_admin_io_mapper_page',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -1,
  );
  $items['admin/config/content/biblio/iomap/formats'] = array(
    'title' => 'Import/Export Mapping',
    'page callback' => 'biblio_admin_io_mapper_page',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -100,
  );
  $formats = module_invoke_all('biblio_mapper_options');
  foreach ($formats as $key => $format) {
    $items['admin/config/content/biblio/iomap/edit/' . $key] = array(
      'title' => $format['title'],
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'biblio_admin_io_mapper_form',
        6,
      ),
      'access arguments' => array(
        'administer biblio',
      ),
      'file' => 'includes/biblio.admin.inc',
      'tab_parent' => 'admin/config/content/biblio/iomap',
      'type' => MENU_LOCAL_TASK,
      'weight' => -1,
    );
  }
  $items['admin/config/content/biblio/iomap/%/%/add'] = array(
    'title' => '',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_io_mapper_add_form',
      5,
      6,
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'tab_parent' => 'admin/config/content/biblio/iomap',
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
    'weight' => -1,
  );
  $items['admin/config/content/biblio/pubtype'] = array(
    'title' => 'Publication types',
    'page callback' => 'biblio_admin_types_form',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
  );
  $items['admin/config/content/biblio/pubtype/list'] = array(
    'title' => 'List',
    'page callback' => 'biblio_admin_types_form',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/content/biblio/pubtype/delete/%'] = array(
    'title' => '',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_types_delete_form',
      6,
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/biblio/pubtype/new'] = array(
    'title' => 'Add New Type',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_types_add_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
  );
  $items['admin/config/content/biblio/pubtype/reset'] = array(
    'page callback' => 'biblio_admin_types_reset',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/biblio/fields/reset'] = array(
    'title' => 'Reset all types to defaults',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_types_reset_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/content/biblio/pubtype/hide'] = array(
    'title' => '',
    'page callback' => 'biblio_admin_types_hide',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/biblio/pubtype/show'] = array(
    'title' => '',
    'page callback' => 'biblio_admin_types_show',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/biblio/author'] = array(
    'title' => 'Authors',
    'page callback' => 'biblio_author_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -7,
  );
  $items['admin/config/content/biblio/author/list'] = array(
    'title' => 'List',
    'page callback' => 'biblio_author_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -7,
  );
  $items['admin/config/content/biblio/author/%'] = array(
    'title' => 'Show author information',
    'page callback' => 'biblio_goto',
    'page arguments' => array(
      $base,
      'f[author]',
      5,
    ),
    'access arguments' => array(
      'access biblio content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/biblio/author/%/edit'] = array(
    'title' => 'Edit author information',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_author_edit_form',
      5,
    ),
    'access callback' => 'biblio_access',
    'access arguments' => array(
      'edit_author',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
    'weight' => -6,
  );
  $items['admin/config/content/biblio/author/orphans'] = array(
    'title' => 'Orphaned Authors',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_orphans_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'description' => 'Delete orphaned biblio authors.',
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -6,
  );
  $items['admin/config/content/biblio/author/type'] = array(
    'title' => 'Author Types',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_author_types_form',
      7,
      6,
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -5,
  );
  $items['admin/config/content/biblio/author/type/new'] = array(
    'title' => 'Add New Author Type',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_author_types_form_new',
      'new',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
  );
  $items['admin/config/content/biblio/author/type/%/edit'] = array(
    'title' => 'Edit Author Type',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_author_types_form_edit',
      'edit',
      6,
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
    'weight' => -9,
  );
  $items['admin/config/content/biblio/author/type/%/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_author_type_delete_confirm',
      6,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'weight' => 1,
    'type' => MENU_CALLBACK,
  );
  $items['admin/config/content/biblio/keywords'] = array(
    'title' => 'Keywords',
    'page callback' => 'biblio_keyword_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -7,
  );
  $items['admin/config/content/biblio/keywords/list'] = array(
    'title' => 'List',
    'page callback' => 'biblio_keyword_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -7,
  );
  $items['admin/config/content/biblio/keywords/%/edit'] = array(
    'title' => 'Edit keyword information',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_keyword_edit_form',
      5,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_CALLBACK,
    'weight' => -6,
  );
  $items['admin/config/content/biblio/keywords/orphans'] = array(
    'title' => 'Orphaned Keywords',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_admin_keyword_orphans_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'description' => 'Delete orphaned biblio keywords.',
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => -6,
  );

  /*    $items['admin/config/content/biblio/authors/reset'] = array(
    'title' => t('Reset all Author types to defaults'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('biblio_admin_author_type_reset_form'),
    'access arguments' => array('administer biblio'),
    'file' => 'includes/biblio.admin.inc',
    'type' => MENU_LOCAL_TASK
    );
     */
  $items['biblio/autocomplete'] = array(
    'title' => 'Autocomplete ',
    'page callback' => 'biblio_autocomplete',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'type' => MENU_CALLBACK,
  );

  /*  $items["$base/list"] = array(
    'title'             => 'List',
    'type'              => MENU_DEFAULT_LOCAL_TASK,
    'weight'            => -10
    );
    $items["$base/filter"] = array(
    'title'             => 'Filter',
    'page callback'     => 'drupal_get_form',
    'page arguments'    => array('biblio_form_filter'),
    'access callback'   => 'user_access',
    'access arguments'  => array('show filter tab'),
    'type'              => MENU_LOCAL_TASK,
    'file'              => 'includes/biblio.pages.inc',
    'weight'            => -9
    );
     */
  $items["{$base}/filter/clear"] = array(
    'title' => '',
    'page callback' => 'biblio_filter_clear',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/help"] = array(
    'title' => 'Help',
    'page callback' => 'biblio_help_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'access biblio content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/export"] = array(
    'title' => '',
    'page callback' => 'biblio_export',
    'access callback' => 'user_access',
    'access arguments' => array(
      'show export links',
    ),
    'file' => 'includes/biblio.import.export.inc',
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/citekey"] = array(
    'title' => '',
    'page callback' => 'biblio_citekey_view',
    'access arguments' => array(
      'access biblio content',
    ),
    'file' => 'includes/biblio.pages.inc',
    'type' => MENU_CALLBACK,
  );
  $items["{$base}/recent/rss.xml"] = array(
    'title' => 'RSS feed',
    'page callback' => 'biblio_recent_feed',
    'access callback' => 'biblio_access',
    'access arguments' => array(
      'rss',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}