You are here

function biblio_ui_menu in Bibliography Module 7.3

Implements hook_menu().

File

modules/biblio_ui/biblio_ui.module, line 10
Main functionality file for the biblio UI module.

Code

function biblio_ui_menu() {
  $items = array();

  // Biblio UI.
  $items['biblio/add'] = array(
    'title' => 'Add biblio entries',
    'description' => 'Select a biblio type to create an entry for.',
    'access callback' => 'biblio_access',
    'access arguments' => array(
      'create',
    ),
    'page callback' => 'biblio_ui_add_biblio_list',
  );
  foreach (biblio_types() as $type => $info) {
    $items['biblio/add/' . $type] = array(
      'title' => $info->name,
      'description' => 'Create biblio entries.',
      'access callback' => 'biblio_access',
      'access arguments' => array(
        'create',
      ),
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'biblio_ui_manage_biblio',
        $type,
      ),
    );
  }
  $items['biblio/%biblio'] = array(
    'title callback' => 'biblio_ui_biblio_title',
    'title arguments' => array(
      1,
    ),
    'access callback' => 'biblio_access',
    'access arguments' => array(
      'view',
      1,
    ),
    'page callback' => 'biblio_ui_view_biblio',
    'page arguments' => array(
      1,
    ),
  );
  $items['biblio/%biblio/view'] = array(
    'title' => 'View',
    'access callback' => 'biblio_access',
    'access arguments' => array(
      'view',
      1,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_manage_biblio',
      1,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => '50',
  );
  $items['biblio/%biblio/edit'] = array(
    'title' => 'Edit',
    'description callback' => 'biblio_ui_description_callback',
    'access callback' => 'biblio_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'description arguments' => array(
      1,
      'edit',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_manage_biblio',
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'weight' => '60',
  );
  $items['biblio/%biblio/delete'] = array(
    'title' => 'Delete',
    'description callback' => 'biblio_ui_description_callback',
    'access callback' => 'biblio_access',
    'description arguments' => array(
      1,
      'delete',
    ),
    'access arguments' => array(
      'delete',
      1,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_delete_biblio',
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'weight' => '70',
  );

  // For example:
  // biblio/export/1,2,3/endnote/tagged
  // biblio/export/4,5,6/bibtex
  $items['biblio/export/%/%'] = array(
    'title' => t('Export Biblio'),
    'description callback' => 'biblio_ui_description_callback',
    'description arguments' => array(
      1,
      'export',
    ),
    'access callback' => 'biblio_ui_export_access',
    'access arguments' => array(
      2,
      3,
      4,
    ),
    'page callback' => 'biblio_ui_export_menu_item',
    'page arguments' => array(
      2,
      3,
      4,
    ),
  );

  // For example:
  // biblio/export_view/biblio/page/endnote
  // biblio/export_view/biblio/page/endnote/tagged
  $items['biblio/export_view/%/%/%'] = array(
    'title' => t('Export Biblio by View'),
    'description callback' => 'biblio_ui_description_callback',
    'description arguments' => array(
      1,
      'export',
    ),
    'access callback' => 'biblio_ui_export_view_access',
    'access arguments' => array(
      2,
      3,
      4,
      5,
    ),
    'page callback' => 'biblio_ui_export_view',
    'page arguments' => array(
      2,
      3,
      4,
      5,
    ),
  );
  if (module_exists('devel')) {
    $items['biblio/%biblio/devel'] = array(
      'title' => 'Devel',
      'page callback' => 'devel_load_object',
      'page arguments' => array(
        'biblio',
        1,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'devel.pages.inc',
      'file path' => drupal_get_path('module', 'devel'),
      'weight' => 80,
    );
  }
  $items['biblio/import'] = array(
    'title' => 'Import biblio entries',
    'description' => 'Import publications in various styles.',
    'access arguments' => array(
      'create biblio',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_import_biblio',
    ),
    'file' => 'biblio_ui.pages.inc',
  );
  $items['admin/structure/biblio'] = array(
    'title' => 'Biblio types',
    'description' => 'Manage biblio types',
    'access arguments' => array(
      'administer biblio',
    ),
    'page callback' => 'biblio_ui_manage_bundles',
  );
  $items['admin/structure/biblio/add'] = array(
    'title' => 'Add biblio type',
    'description' => 'Manage biblio types',
    'access arguments' => array(
      'administer biblio',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_manage_bundles_manage',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/structure/biblio/attach-fields'] = array(
    'title' => 'Attach biblio fields',
    'description' => 'Import predefined biblio types',
    'access arguments' => array(
      'administer biblio',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_attach_biblio_fields',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  foreach (biblio_types() as $biblio_type) {
    $items['admin/structure/biblio/' . $biblio_type->type] = array(
      'title' => $biblio_type->name,
      'access arguments' => array(
        'manage biblio structure',
      ),
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'biblio_ui_manage_bundles_manage',
        3,
      ),
    );
    $items['admin/structure/biblio/' . $biblio_type->type . '/edit'] = array(
      'title' => 'Edit',
      'access arguments' => array(
        'manage biblio structure',
      ),
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'biblio_ui_manage_bundles_manage',
        3,
      ),
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => 0,
    );
    $items['admin/structure/biblio/' . $biblio_type->type . '/delete'] = array(
      'title' => 'Delete',
      'access callback' => 'biblio_ui_can_delete_bundle',
      'access arguments' => array(
        $biblio_type->type,
      ),
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'biblio_ui_delete_bundle',
        $biblio_type->type,
      ),
      'type' => MENU_LOCAL_TASK,
      'weight' => 1,
    );
    $items['admin/structure/biblio/' . $biblio_type->type . '/fields/add'] = array(
      'title' => 'Attach biblio fields',
      'description' => 'Attach predefined biblio types',
      'access arguments' => array(
        'administer biblio',
      ),
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'biblio_ui_create_fields',
        3,
      ),
      'type' => MENU_LOCAL_ACTION,
    );
  }
  $items['admin/config/content/biblio'] = array(
    'title' => 'Biblio settings',
    'description' => 'Configure Biblio settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_admin_form',
    ),
    'access arguments' => array(
      'administer biblio',
    ),
    'file' => 'biblio_ui.admin.inc',
  );

  // Biblio contributor UI.
  $items['admin/biblio-contributor'] = array(
    'title' => 'Biblio contributor',
    'access callback' => 'biblio_contributor_access',
    'access arguments' => array(
      'create',
    ),
    'page callback' => array(
      'views_embed_view',
    ),
    'page arguments' => array(
      'biblio_contributor',
    ),
  );
  $items['admin/biblio-contributor/add'] = array(
    'title' => 'Add biblio contributor',
    'access callback' => 'biblio_contributor_access',
    'access arguments' => array(
      'create',
    ),
    'page callback' => array(
      'drupal_get_form',
    ),
    'page arguments' => array(
      'biblio_ui_contributor_create_form',
    ),
    'type' => MENU_LOCAL_ACTION,
  );
  $items['biblio-contributor/%biblio_contributor/edit'] = array(
    'title' => 'Edit',
    'description arguments' => array(
      1,
      'edit',
    ),
    'access callback' => 'biblio_contributor_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_contributor_create_form',
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => '60',
  );
  $items['biblio-contributor/%biblio_contributor/delete'] = array(
    'title' => 'Delete',
    'description arguments' => array(
      1,
      'delete',
    ),
    'access callback' => 'biblio_contributor_access',
    'access arguments' => array(
      'delete',
      1,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'biblio_ui_contributor_delete_form',
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => '70',
  );
  if (module_exists('devel')) {
    $items['biblio-contributor/%biblio_contributor/devel'] = array(
      'title' => 'Devel',
      'page callback' => 'devel_load_object',
      'page arguments' => array(
        'biblio-contributor',
        1,
      ),
      'access arguments' => array(
        'access devel information',
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'devel.pages.inc',
      'file path' => drupal_get_path('module', 'devel'),
      'weight' => 80,
    );
  }
  return $items;
}