function tripal_menu
3.x tripal.module | tripal_menu() |
Implements hook_menu(). Defines all menu items needed by Tripal Core
Related topics
File
- tripal/
tripal.module, line 97 - The core Tripal module
Code
function tripal_menu() {
$items = array();
// Tripal setting groups
$items['admin/tripal'] = array(
'title' => 'Tripal',
'description' => t("Manage the behavior or Tripal and its various modules."),
'weight' => -8,
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('administer tripal'),
'file' => 'system.admin.inc',
'file path' => drupal_get_path('module', 'system'),
);
/**
* Tripal Extensions
*/
$items['admin/tripal/storage'] = array(
'title' => 'Data Storage',
'description' => t("Tripal is designed to access biological
data in any data storage back-end. A storage back-end must have a
module that can be installed that interfaces with Tripal. By default
the base Tripal package provides The Tripal Chado module for storing
data in the GMOD Chado database schema. All available storage backends
and their administrative tools are found here."),
'weight' => 8,
'access arguments' => array('administer tripal'),
);
$items['admin/tripal/extension'] = array(
'title' => 'Extensions',
'description' => t("Configuration and management pages for Tripal extension modules."),
'weight' => 8,
'access arguments' => array('administer tripal'),
);
// Menu items for facilitating import of extension modules.
$items['admin/tripal/extension/available'] = array(
'title' => 'Available Extensions',
'description' => t('Look for extensions to add new functionality to this
site. Tripal can be extended with new functionality developed
by other Tripal site developers. These include modules with new or
different functionality, bulk loading templates, or materialized
views. Anyone can create new extensions and share those for
others to use. Once shared they will appear in this list.'),
'access arguments' => array('administer tripal'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_extensions_form'),
'type' => MENU_NORMAL_ITEM,
'file' => 'includes/tripal.extensions.inc',
'file path' => drupal_get_path('module', 'tripal'),
'weight' => -100
);
// $items['admin/tripal/extension/import'] = array(
// 'title' => 'Import Extensions',
// 'description' => 'Provides a list of the available extensions that are registered at the tripal.info site. From this page you can easily import or install extensions to your site.',
// 'page callback' => 'drupal_get_form',
// 'page arguments' => array('tripal_extensions_form'),
// 'access arguments' => array('administer tripal'),
// 'type' => MENU_NORMAL_ITEM,
// 'file' => 'includes/tripal.extensions.inc',
// 'file path' => drupal_get_path('module', 'tripal'),
// 'weight' => -100,
// );
/**
* Jobs Management
*/
$items['admin/tripal/tripal_jobs'] = array(
'title' => 'Jobs',
'description' => t('Provides tools for managing jobs submitted to Tripal. In some
cases, long-running tasks are too slow to complete within a single
browser session. The Tripal jobs system allows long-running tasks
to be submitted to a queue that can be executed manually by the
site admin or automatically using a module such as the ') .
l('Tripal Daemon', 'https://www.drupal.org/project/tripal_daemon', array('attributes' => array('target' => '_blank'))) .
' extension module.',
'page callback' => 'tripal_jobs_admin_view',
'access arguments' => array('administer tripal'),
'type' => MENU_NORMAL_ITEM,
'weight' => 0,
'file' => 'includes/tripal.jobs.inc',
);
$items['admin/tripal/tripal_jobs/help'] = array(
'title' => 'Help',
'description' => t('Help for the tripal job management system'),
'page callback' => 'theme',
'page arguments' => array('tripal_job_help'),
'access arguments' => array('administer tripal'),
'type' => MENU_LOCAL_TASK,
'weight' => 10
);
$items['admin/tripal/tripal_jobs/cancel/%'] = array(
'title' => 'Jobs',
'description' => t('Cancel a pending job'),
'page callback' => 'tripal_cancel_job',
'page arguments' => array(4),
'access arguments' => array('administer tripal'),
'type' => MENU_CALLBACK,
'file' => 'api/tripal.jobs.api.inc',
);
$items['admin/tripal/tripal_jobs/status/%'] = array(
'page callback' => 'tripal_jobs_status_view',
'page arguments' => array(4),
'access arguments' => array('administer tripal'),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.jobs.inc',
);
$items['admin/tripal/tripal_jobs/rerun/%'] = array(
'title' => 'Jobs',
'description' => t('Re-run an existing job.'),
'page callback' => 'tripal_rerun_job',
'page arguments' => array(4),
'access arguments' => array('administer tripal'),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.jobs.inc',
);
$items['admin/tripal/tripal_jobs/view/%'] = array(
'title' => 'Jobs Details',
'description' => t('View job details.'),
'page callback' => 'tripal_jobs_view',
'page arguments' => array(4),
'access arguments' => array('administer tripal'),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.jobs.inc',
);
$items['admin/tripal/tripal_jobs/views/jobs/enable'] = array(
'title' => 'Enable Jobs Administrative View',
'page callback' => 'tripal_enable_view',
'page arguments' => array('tripal_admin_jobs', 'admin/tripal/tripal_jobs'),
'access arguments' => array('administer tripal'),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.jobs.inc',
);
$items['admin/tripal/tripal_jobs/execute/%'] = array(
'title' => 'Jobs',
'description' => t('Execute an existing job'),
'page callback' => 'tripal_execute_job',
'page arguments' => array(4),
'access arguments' => array('administer tripal'),
'type' => MENU_CALLBACK,
);
/*
* AJAX Callbacks.
*/
$items['bio_data/ajax/field_attach/%'] = array(
'page callback' => 'tripal_ajax_attach_field',
'page arguments' => array(3),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.entity.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
/*
* Dashboard Action Item callbacks.
*/
$items['admin/disable/notification/%'] = array(
'page callback' => 'tripal_disable_admin_notification',
'page arguments' => array(3),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.admin_blocks.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
$items['admin/import/field/%/%/%/%'] = array(
'page callback' => 'tripal_admin_notification_import_field',
'page arguments' => array(3, 4, 5, 6),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.admin_blocks.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
/*
* Term Lookup
*/
$items['cv/lookup'] = array(
'title' => 'Controlled Vocabularies',
'description' => t("A tool to explore the controlled vocabularies that are used on this site."),
'access arguments' => array('access content'),
'page callback' => 'tripal_vocabulary_lookup_page',
'file' => 'includes/tripal.term_lookup.inc',
'file path' => drupal_get_path('module', 'tripal'),
'type' => MENU_NORMAL_ITEM,
);
$items['cv/lookup/%'] = array(
'title' => 'Vocabulary Details',
'description' => t("Provides a tool to discover controlled vocabularies"),
'access arguments' => array('access content'),
'page callback' => 'tripal_vocabulary_lookup_vocab_page',
'page arguments' => array(2),
'file' => 'includes/tripal.term_lookup.inc',
'file path' => drupal_get_path('module', 'tripal'),
'type' => MENU_CALLBACK,
);
$items['cv/lookup/%/%'] = array(
'title' => 'Vocabulary Term Lookup',
'description' => t("Provides a tool to discover controlled vocabularies terms used by this site."),
'access arguments' => array('access content'),
'page callback' => 'tripal_vocabulary_lookup_term_page',
'page arguments' => array(2, 3),
'file' => 'includes/tripal.term_lookup.inc',
'file path' => drupal_get_path('module', 'tripal'),
'type' => MENU_CALLBACK,
);
$items['cv/lookup/%/%/children'] = array(
'access arguments' => array('access content'),
'page callback' => 'tripal_vocabulary_lookup_term_children_ajax',
'page arguments' => array(2, 3),
'file' => 'includes/tripal.term_lookup.inc',
'file path' => drupal_get_path('module', 'tripal'),
'type' => MENU_CALLBACK,
);
// Adds a +Check for new fields link on the 'Tripal Content Types' page.
$items['admin/structure/bio_data/manage/%/fields/check'] = array(
'title' => 'Check for new fields',
'description' => t('Check if new fields should be added to this content type.'),
'page callback' => 'tripal_check_new_fields',
'page arguments' => array(4),
'access arguments' => array('administer tripal'),
'file' => 'api/tripal.entities.api.inc',
'file path' => drupal_get_path('module', 'tripal'),
'type' => MENU_LOCAL_ACTION,
);
$items['tripal/upload'] = array(
'page callback' => 'tripal_file_upload',
'access arguments' => array('upload files'),
'file' => '/includes/tripal.upload.inc',
'type' => MENU_CALLBACK,
);
$items['admin/tripal/loaders'] = array(
'title' => 'Data Loaders',
'description' => t('Tools facilitating data import.'),
'access arguments' => array('load tripal data'),
'type' => MENU_NORMAL_ITEM,
'weight' => 6
);
// Add in the loaders
$importers = tripal_get_importers();
foreach ($importers as $class_name) {
tripal_load_include_importer_class($class_name);
if (class_exists($class_name)) {
$menu_path = 'admin/tripal/loaders/' . $class_name::$machine_name;
if ($class_name::$menu_path) {
$menu_path = $class_name::$menu_path;
}
$items[$menu_path] = array(
'title' => $class_name::$name,
'description' => $class_name::$description,
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_get_importer_form', $class_name),
'access arguments' => array('load tripal data'),
'type' => MENU_NORMAL_ITEM,
'file' => 'includes/tripal.importer.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
}
}
/**
* Data Collections
*/
$items['user/%/data-collections'] = array(
'title' => 'Data Collections',
'description' => 'Your list of saved data collections',
'page callback' => 'tripal_user_collections_page',
'access callback' => 'tripal_accesss_user_collections',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
'file' => 'includes/tripal.collections.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
$items['user/%/data-collections/%/delete'] = array(
'title' => 'Delete a Collections',
'description' => 'Deletes a data collection.',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_user_collections_delete_form', 1, 3),
'access callback' => 'tripal_accesss_user_collections',
'access arguments' => array(1),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.collections.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
$items['user/%/data-collections/%/view'] = array(
'title' => 'View a Collections',
'description' => 'Views a data collection.',
'page callback' => 'tripal_user_collections_view_page',
'page arguments' => array(1, 3),
'access callback' => 'tripal_accesss_user_collections',
'access arguments' => array(1),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.collections.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
$items['user/%/data-collections/generate/%'] = array(
'title' => 'Generate a file for download of a Collections',
'description' => 'Generates a data collection file for download.',
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_user_collections_generate_file_form', 1, 4),
'access callback' => 'tripal_accesss_user_collections',
'access arguments' => array(1),
'type' => MENU_CALLBACK,
'file' => 'includes/tripal.collections.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
$items['admin/tripal/data-collections'] = array(
'title' => 'Data Collections',
'description' => t('Site-wide settings for data collections'),
'page callback' => 'drupal_get_form',
'page arguments' => array('tripal_admin_data_collection_form'),
'access arguments' => array('administer tripal'),
'type' => MENU_NORMAL_ITEM,
'weight' => 0,
'file' => 'includes/tripal.admin.inc',
'file path' => drupal_get_path('module', 'tripal'),
);
//
// USER FILE MANAGEMENT
//
$items['admin/tripal/files'] =[
'title' 'User File Management'
'description' 'Set maximum upload sizes, quotas and view usage.'
'page callback' 'drupal_get_form'
'page arguments'['tripal_admin_manage_files_form']
'access arguments'['administer tripal']
'type' MENU_NORMAL_ITEM
'file' 'includes/tripal.admin_files.inc'
'file path' drupal_get_path('module', 'tripal')
'weight' 30
];
$items['admin/tripal/files/quota'] =[
'title' 'User Quotas'
'description' 'Set default quota, expiration date, and custom quotas'
'page callback' 'drupal_get_form'
'page arguments'['tripal_admin_manage_quota_form']
'access arguments'['administer tripal']
'type' MENU_LOCAL_TASK
'file' 'includes/tripal.admin_files.inc'
'file path' drupal_get_path('module', 'tripal')
'weight' 10
];
// Admin remove user quota
$items['admin/tripal/files/quota/remove/%'] =[
'title' 'Remove custom user quota'
'description' "Revert's a user's quota and expiration of files to the site wide defaults."
'page callback' 'drupal_get_form'
'page arguments'['tripal_admin_remove_quota_form' 5]
'access arguments'['administer tripal']
'type' MENU_CALLBACK
'file' 'includes/tripal.admin_files.inc'
'file path' drupal_get_path('module', 'tripal')
];
// Add user quota
$items['admin/tripal/files/quota/add'] =[
'title' 'Add Custom Quota'
'description' 'Gives the user a new quota and expiration date'
'page callback' 'drupal_get_form'
'page arguments'['tripal_admin_add_custom_form']
'access arguments'['administer tripal']
// TODO: Ask Stephen is this is fine as a link at the top of the form
// as well as a link in the table
'type' MENU_CALLBACK
'file' 'includes/tripal.admin_files.inc'
'file path' drupal_get_path('module', 'tripal')
];
// Autocomplete path for the users on the site
$items['admin/tripal/files/quota/user/autocomplete'] =[
'title' 'Autocomplete for existing users'
'description' 'Provide a list of existing users on the site.'
'page callback' 'tripal_users_autocomplete'
'access arguments'['administer tripal']
'type' MENU_CALLBACK
'file' 'includes/tripal.admin_files.inc'
'file path' drupal_get_path('module', 'tripal')
];
// Edit user quota
$items['admin/tripal/files/quota/edit/%'] =[
'title' 'Edit Custom Quota'
'description' 'Edit an existing user\'s quota and/or expiration date.'
'page callback' 'drupal_get_form'
'page arguments'['tripal_admin_edit_quota_form' 5]
'access arguments'['administer tripal']
'type' MENU_CALLBACK
'file' 'includes/tripal.admin_files.inc'
'file path' drupal_get_path('module', 'tripal')
];
$items['admin/tripal/files/usage'] =[
'title' 'File Usage'
'description' 'Set default quota, expiration date, and custom quotas'
'page callback' 'drupal_get_form'
'page arguments'['tripal_admin_file_usage_page']
'access arguments'['administer tripal']
'type' MENU_LOCAL_TASK
'file' 'includes/tripal.admin_files.inc'
'file path' drupal_get_path('module', 'tripal')
'weight' 15
];
//
// USER FILES
//
// User view quota (Tab)
$items['user/%/files'] =[
'title' 'Uploads'
'description' 'Monitors what files that have been uploaded by user through the tripal module'
'page callback' 'tripal_user_files_page'
'page arguments'[1]
'access callback' 'tripal_access_user_uploads'
'access arguments'['view' 1]
'type' MENU_LOCAL_TASK
'file' 'includes/tripal.user.inc'
'file path' drupal_get_path('module', 'tripal')
'weight' 10
];
$items['user/%/files/%'] =[
'title' 'File Details'
'description' "View details about the file"
'page callback' 'tripal_view_file'
'page arguments'[1 3]
'access callback' 'tripal_access_user_uploads'
'access arguments'['renew' 1 3]
'type' MENU_CALLBACK
'file' 'includes/tripal.user.inc'
'file path' drupal_get_path('module', 'tripal')
];
// User file renew.
$items['user/%/files/%/renew'] =[
'title' 'Renew File'
'description' "Renew a user's file"
'page callback' 'tripal_renew_file'
'page arguments'[3]
'access callback' 'tripal_access_user_uploads'
'access arguments'['renew' 1 3]
'type' MENU_CALLBACK
'file' 'includes/tripal.user.inc'
'file path' drupal_get_path('module', 'tripal')
];
// User file download.
$items['user/%/files/%/download'] =[
'title' 'Download File'
'description' "Download a user's file based off of the link clicked in the table"
'page callback' 'tripal_download_file'
'page arguments'[3]
'access arguments'['download' 1 3]
'access callback' 'tripal_access_user_uploads'
'type' MENU_CALLBACK
'file' 'includes/tripal.user.inc'
'file path' drupal_get_path('module', 'tripal')
];
// User file delete.
$items['user/%/files/%/delete'] =[
'title' 'Delete File'
'description' "Delete a user's file based on either user action or expired file"
'page callback' 'drupal_get_form'
'page arguments'['tripal_delete_file_form' 1 3]
'access callback' 'tripal_access_user_uploads'
'access arguments'['delete' 1 3]
'type' MENU_CALLBACK
'file' 'includes/tripal.user.inc'
'file path' drupal_get_path('module', 'tripal')
];
return $items;
}