Browse Source

Tripal Views: Fixed Admin links and added help & configure link to the modules page

Lacey Sanderson 11 years ago
parent
commit
950b61280a

+ 3 - 11
tripal_views/theme/tripal_views_admin.tpl.php

@@ -1,18 +1,10 @@
-<h3>Tripal Views Quick Links:</h3>
-<ul>
-  <li><?php print l('List of integrated tables',"admin/tripal/views/integration/list") ?></li>
-  <li><?php print l('Integrate a new table',"admin/tripal/views/integration/new") ?></li>
-  <li><?php print l('Import a previously exported table integration.',"admin/tripal/views/integration/import") ?></li>
-</ul>
-
-<br>
 <h3>Views Integration Description:</h3>
 <p>Tripal Views provides an interface for integrating <a href="http://drupal.org/project/views">Drupal Views</a>
    with Chado tables, custom tables and materialized views.  This allows site administrators to create custom pages
    and forms for tables in the Chado schema (if Chado was installed by Tripal).  All tables in Chado are integrated
    automatically with Drupal Views but custom tables and materialized views are not.  After creating a new materialized
    view or custom table you can follow the links above to integrate the table with Drupal Views.  The interface allows
-   you to specify which fields the table can be joined with other tables and also specify field, sort and filter 
+   you to specify which fields the table can be joined with other tables and also specify field, sort and filter
    handlers for views.  Different handlers provide different functionality.
 </p>
 
@@ -38,8 +30,8 @@
      provide those relationships in the provided form.  Finally, if your fields require a special handlers, you
      may select them from the drop downs provided</li>
    <li><b>Alter an existing integration</b>:  If a table is already integrated you can alter its integration configuration by navigating
-     to the <?php print l('list of integrated tables', 'admin/tripal/views/integration/list')?>, select the table from the list and alter it accordingly.  
-     You can create new integration configurations for tables that are already integrated by lowering the priority setting.  The configuration setting 
+     to the <?php print l('list of integrated tables', 'admin/tripal/views/integration/list')?>, select the table from the list and alter it accordingly.
+     You can create new integration configurations for tables that are already integrated by lowering the priority setting.  The configuration setting
      with the lowest priority will be selected.</li>
    <li><b>Create custom pages/block/search form</b>:  After saving conifguration settings from either step above, you can navigate to the
      Drupal Views interface where you can create a custom page, block or search form.</li>

+ 1 - 0
tripal_views/tripal_views.info

@@ -4,6 +4,7 @@ core = 7.x
 project = tripal_core
 package = Tripal
 version = 7.x-2.0beta
+configure = admin/tripal/views-integration
 
 files[] = views/handlers/chado_views_handler_relationship.inc
 files[] = views/handlers/views_handler_join_chado_through_linking.inc

+ 45 - 34
tripal_views/tripal_views.module

@@ -7,7 +7,6 @@ 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
@@ -24,16 +23,16 @@ function tripal_views_menu() {
     'type' => MENU_NORMAL_ITEM,
   );
 
-  $items['admin/tripal/views'] = array(
+  $items['admin/tripal/views-integration'] = array(
     'title' => 'Views Integration',
     'description' => 'Integration of all the chado tables and fields with Drupal Views.',
-    'page callback' => 'theme',
-    'page arguments' => array('tripal_views_admin'),
+    //'page callback' => 'theme',
+    //'page arguments' => array('tripal_views_admin'),
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_NORMAL_ITEM
   );
 
-  $items['admin/tripal/views/integration/list'] = array(
+  $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',
@@ -42,15 +41,17 @@ function tripal_views_menu() {
     'weight' => 0,
   );
 
-  $items['admin/tripal/views/integration/new'] = array(
+  $items['admin/tripal/views-integration/new'] = array(
     'title' => 'Integrate A Table',
+    'description' => 'Describe to Tripal Views how to integrate a new chado table or materialized view.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_form'),
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_NORMAL_ITEM,
+    'weight' => 1,
   );
 
-  $items['admin/tripal/views/integration/edit/%'] = array(
+  $items['admin/tripal/views-integration/edit/%'] = array(
     'title' => 'Edit Views Integration',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_form', 5),
@@ -58,7 +59,7 @@ function tripal_views_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  $items['admin/tripal/views/integration/delete/%'] = array(
+  $items['admin/tripal/views-integration/delete/%'] = array(
     'title' => 'Delete Views Integration',
     'page callback' => 'tripal_views_integration_delete',
     'page arguments' => array(5),
@@ -66,43 +67,44 @@ function tripal_views_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  $items['admin/tripal/views/import'] = array(
+  $items['admin/tripal/views-integration/import'] = array(
     'title' => 'Import Views Integration',
+    'description' => 'Import a Tripal Views Integration from another site.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_import_form'),
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_NORMAL_ITEM,
+    'weight' => 2,
   );
 
-  $items['admin/tripal/views/integration/export/%'] = array(
-    'title' => 'Import Views Integration',
+  $items['admin/tripal/views-integration/export'] = array(
+    'title' => 'Export Views Integration',
+    'description' => 'Export a Tripal Views Integration for use in another Tripal site',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_views_integration_export_form', 5),
+    'access arguments' => array('manage tripal_views_integration'),
+    'type' => MENU_NORMAL_ITEM,
+    'weight' => 3,
+  );
+
+  $items['admin/tripal/views-integration/export/%'] = array(
+    'title' => 'Export Views Integration',
+    'description' => 'Export a Tripal Views Integration for use in another Tripal site',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_export_form', 5),
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_CALLBACK,
   );
 
-  // D6:
-  // Menu item for the AJAX callback function that retrieves the
-  // portion of the form that contains all of the fields for the table being integrated
-  //$items['tripal/views/integration/ajax/view_setup_table'] = array(
-  //  'title' => 'Import Views Integration',
-  //  'page callback' => 'tripal_views_integration_ajax_view_setup_table',
-  //  'page arguments' => array(),
-  //  'access arguments' => array('manage tripal_views_integration'),
-  //  'type' => MENU_CALLBACK,
-  //);
-
-  // D6:
-  // Menu item for the AJAX callback function that retrieves the list of
-  // column names for the table that is selected to be joined.
-  //$items['tripal/views/integration/ajax/join_field/%/%'] = array(
-  //  'title' => 'Import Views Integration',
-  //  'page callback' => 'tripal_views_integration_ajax_join_field',
-  //  'page arguments' => array(5, 6),
-  //  'access arguments' => array('manage tripal_views_integration'),
-  //  'type' => MENU_CALLBACK,
-  //);
+  $items['admin/tripal/views-integration/help'] = array(
+    'title' => 'Help',
+    'description' => "A description of the Tripal Views module including a short description of it's usage.",
+    'page callback' => 'theme',
+    'page arguments' => array('tripal_views_admin'),
+    'access arguments' => array('manage tripal_views_integration'),
+    'type' => MENU_NORMAL_ITEM,
+    'weight' => 4,
+  );
 
   return $items;
 }
@@ -125,8 +127,17 @@ function tripal_views_init() {
 }
 
 /**
- * Implements hook_views_api()
- *
+ * Implements hook_help()
+ * Purpose: Adds a help page to the module list
+ */
+function tripal_views_help ($path, $arg) {
+  if ($path == 'admin/help#tripal_views') {
+    return theme('tripal_views_admin', array());
+  }
+}
+
+/**
+ * Implements hook_permissions()
  * Purpose: Set the permission types that the chado module uses.
  *
  * @ingroup tripal_views