123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?php
- require_once "tripal_views.views.inc";
- require_once "includes/tripal_views_integration.inc";
- require_once "includes/tripal_views_form_elements.inc";
- require_once "includes/tripal_views_integration_port.inc";
- /**
- * Implements hook_menu()
- *
- * Purpose: this hook provides details about new menu items added by this module
- *
- * @ingroup tripal_views
- */
- function tripal_views_menu() {
- $items = array();
- $items['chado'] = array(
- 'title' => 'Biological Data',
- 'description' => 'Listings of the various biological data available categorized by type.',
- 'page callback' => 'tripal_views_biological_data_page',
- 'access arguments' => array('access content'),
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['admin/tripal/views'] = array(
- 'title' => 'Views Integration',
- 'description' => 'Integration with Drupal Views',
- 'page callback' => 'tripal_views_description_page',
- 'access arguments' => array('administer site configuration'),
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['admin/tripal/views/integration/list'] = array(
- 'title' => 'List of Integrated Tables',
- 'description' => 'Provide a list of all integrated tables and allows for adding new tables or editing already integrated tables.',
- 'page callback' => 'tripal_views_integration_setup_list',
- 'access arguments' => array('manage tripal_views_integration'),
- 'type' => MENU_NORMAL_ITEM,
- 'weight' => 0,
- );
- $items['admin/tripal/views/integration/new'] = array(
- 'title' => 'Integrate A Table',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_views_integration_form'),
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['admin/tripal/views/integration/edit/%'] = array(
- 'title' => 'Edit Views Integration',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_views_integration_form', 5),
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/views/integration/delete/%'] = array(
- 'title' => 'Delete Views Integration',
- 'page callback' => 'tripal_views_integration_delete',
- 'page arguments' => array(5),
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/views/import'] = array(
- 'title' => 'Import Views Integration',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_views_integration_import_form'),
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['admin/tripal/views/integration/export/%'] = array(
- 'title' => 'Import Views Integration',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_views_integration_export_form', 5),
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
- 'type' => MENU_CALLBACK,
- );
- return $items;
- }
- /**
- * Implements hook_views_api()
- *
- * Purpose: Set the permission types that the chado module uses.
- *
- * @ingroup tripal_views
- */
- function tripal_views_perm() {
- return array(
- 'manage tripal_views_integration',
- );
- }
- /**
- * Implements hook_views_api()
- *
- * Purpose: Essentially this hook tells drupal that there is views support for
- * for this module which then includes tripal_views.views.inc where all the
- * views integration code is
- *
- * @ingroup tripal_views
- */
- function tripal_views_views_api() {
- return array(
- 'api' => 2.0,
- );
- }
- /**
- * Implements hook_theme()
- *
- * Purpose: this hook provides details about themable objects added by
- * this module
- *
- * @ingroup tripal_views
- */
- function tripal_views_theme() {
- return array(
- 'tripal_views_integration_form' => array(
- 'arguments' => array('form' => NULL),
- 'template' => 'tripal_views_integration_fields_form',
- ),
- 'tripal_views_data_export_download_form' => array(
- 'arguments' => array('form' => NULL),
- 'template' => 'tripal_views_data_export_download_form',
- ),
- 'file_upload_combo' => array(
- 'arguments' => array('element' => NULL)
- ),
- 'sequence_combo' => array(
- 'arguments' => array('element' => NULL)
- ),
- );
- }
- /**
- * Implements hook_coder_ignore().
- * Defines the path to the file (tripal_views.coder_ignores.txt) where ignore rules for coder are stored
- */
- function tripal_views_coder_ignore() {
- return array(
- 'path' => drupal_get_path('module', 'tripal_views'),
- 'line prefix' => drupal_get_path('module', 'tripal_views'),
- );
- }
- /**
- * A landing page for all views of chado content. Simply lists all menu items that
- * are children of it.
- */
- function tripal_views_biological_data_page() {
- $output = '';
- $item = menu_get_item();
- $content = system_admin_menu_block($item);
- $output .= '<dl class="admin-list">';
- foreach ($content as $item) {
- $output .= '<dt>'. l($item['title'], $item['href'], $item['localized_options']) .'</dt>';
- $output .= '<dd>'. $item['description'] .'</dd>';
- }
- $output .= '</dl>';
- return $output;
- }
|