Переглянути джерело

Altered directory structure of Tripal views module to match others. Fixed links on admin instruction page for Tripal Views

spficklin 11 роки тому
батько
коміт
a91efd349f

+ 21 - 21
tripal_pub/tripal_pub.module

@@ -202,55 +202,55 @@ function tripal_pub_theme() {
   // node templates
     'tripal_pub_base' => array(
       'arguments' => array('node' => NULL),
-  ),
+    ),
     'tripal_pub_properties' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_authors' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_references' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_relationships' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_featuremaps' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_features' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_libraries' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_projects' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
     'tripal_pub_stocks' => array(
       'arguments' => array('node' => NULL)
-  ),
+    ),
 
-  // instructions page for the pub module
+    // instructions page for the pub module
     'tripal_pub_admin' => array(
       'template' => 'tripal_pub_admin',  
       'arguments' =>  array(NULL),  
       'path' => drupal_get_path('module', 'tripal_pub') . '/theme' 
-      ),
+    ),
 
-      // themed forms
+    // themed forms
     'tripal_pub_importer_setup_form' => array(
-       'arguments' => array('form'),
-      ),
+      'arguments' => array('form'),
+    ),
     'tripal_pub_search_form' => array(
-       'arguments' => array('form'),
-      ),
+      'arguments' => array('form'),
+    ),
     'chado_pub_node_form' => array(
-       'arguments' => array('form'),
-      ),
-      );
+      'arguments' => array('form'),
+    ),
+  );
 
-      return $themes;
+  return $themes;
 }
 
 /**

+ 0 - 55
tripal_views/includes/tripal_views_integration.inc

@@ -5,61 +5,6 @@
  * Functions related to the UI for integrating tables with views
  */
 
-/**
- * Purpose: Provide Guidance to new Tripal Admin
- *
- * @return
- *   HTML Formatted text
- *
- * @ingroup tripal_views_integration
- */
-function tripal_views_description_page() {
-
-  $text .= '<h3>Tripal Views Quick Links:</h3>';
-  $text .= "<ul>
-             <li><a href=\"" . url("admin/tripal/views/integration/list")  .  "\">List of integrated tables</a></li>
-             <li><a href=\"" . url("admin/tripal/views/integration/new") .  "\">Integrate a new table</a></li>
-             <li><a href=\"" . url("admin/tripal/views/integration/import") .  "\">Import a previously exported table integration.</a></li>
-           </ul>";
-
-  $text .= '<h3>Views Integration Description:</h3>';
-  $text .= '<p>Tripal Views provides an interface for integrating <a href="http://drupal.org/project/views">Drupal Views</a>
-            with Tripal materialized views.  This will allow site administrators to create custom queries for the materialized views
-            and in turn provide custom content pages, custom blocks and custom search forms. The forms allow a site administrator
-            to select a materialized view and associate other Chado tables on which the view can join.  Usage of this module requires
-            a good understanding of foreign-key relationships in Chado.
-            </p>';
-
-  $text .= '<h3>Setup Instructions:</h3>';
-  $text .= '<p>After installation of the Tripal core module.  The following tasks should be performed
-            <ol>
-              <li><b>Set Permissions</b>: To allow access to site administrators for this module, simply
-               <a href="' . url('admin/user/permissions') . '">assign permissions</a> to the appropriate user roles for the
-               permission type "manage tripal_views_integration". </li>
-            </ol>
-            </p>';
-  $text .= '<h3>Usage Instructions:</h3>';
-  $text .= "<p>To use Tripal Views integration follow these steps:
-            <ol>
-               <li><b>Identify or create a materialized view:</b> Using the <a href=\"" . url("admin/tripal/views/mviews") . "\">
-                 Tripal materialized View</a> interface, identify the view you would like to integrate or create a new one.</li>
-               <li><b>Setup the Views Integration</b>: Navigate to the <a href=\"" . url("admin/tripal/views/integration/mviews/new") . "\">
-                 Tripal views integration setup page</a> to integrate the selected materialized view.  Provide a  user friendly name
-                 and description to help you remember the purpose for integrating the view.  Next, select the view you want to integrate
-                 from the provided select box.  If your materialized view has fields that can join with other Chado tables, you may
-                 provide those relationships in the provided form.  Finally, if your fields require a special handler for display, you
-                 may select it from the drop down provided</li>
-               <li><b>Create custom pages/block/search form</b>:  After saving setup information from step 2 above, you will be redirected to the
-                 Drupal Views interface</a> where you can create a custom page, block or search form.</li>
-               <li><b>Review your integrated views</b>:  A page providing a
-                 <a href=\"" . url("admin/tripal/views/integration/mviews/list") . "\">list of all integrated views</a> is provided. You may
-                 view this page to see all integrated views, but also to remove any unwanted integrations.</li>
-            </ol>
-
-            </p>";
-  return $text;
-}
-
 /**
  * Purpose: Generates a themable table containing the list of integrated tables
  *   The look-and-feel of the table can be altered by overriding the theme for

+ 49 - 0
tripal_views/theme/tripal_views_admin.tpl.php

@@ -0,0 +1,49 @@
+<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 
+   handlers for views.  Different handlers provide different functionality.
+</p>
+
+<br>
+<h3>Setup Instructions:</h3>
+<p>After installation of the Tripal core module.  The following tasks should be performed</p>
+<ol>
+  <li><b>Set Permissions</b>: To allow access to site administrators for this module, simply
+    <?php print l('assign permissions', 'admin/user/permissions') ?> to the appropriate user roles for the
+     permission type "manage tripal_views_integration". </li>
+</ol>
+
+<br>
+<h3>Usage Instructions:</h3>
+<p>To use Tripal Views integration follow these steps:</p>
+<ol>
+   <li><b>Identify or create a materialized view or custom table:</b> Using the <?php print l('Tripal materialized View interface', "admin/tripal/mviews") ?>
+     identify the view you would like to integrate or create a new one.  Or, using the <?php print l('Tripal custom table interface', 'admin/tripal/custom_tables')?></li>
+   <li><b>Integration a new table</b>: Navigate to the <?php print l('new integration page', "admin/tripal/views/integration/new") ?>
+     to integrate the new table.  Provide a user friendly name
+     and description to help you remember the purpose for integrating the view.  Next, select the table  you want to integrate
+     from the provided select box.  If your table has fields that can join with other Chado tables, you may
+     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 
+     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>
+   <li><b>Review your integrated views</b>:  A page providing a
+     <?php print l('list of all integrated views', "admin/tripal/views/integration/list") ?> is provided. You may
+     view this page to see all integrated views, but also to remove any unwanted integrations.</li>
+</ol>

+ 10 - 3
tripal_views/tripal_views.module

@@ -27,9 +27,10 @@ function tripal_views_menu() {
   $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,
+    '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(
@@ -171,6 +172,12 @@ function tripal_views_theme() {
     'sequence_combo' => array(
       'arguments' => array('element' => NULL)
     ),
+    // instructions page for the pub module
+    'tripal_views_admin' => array(
+      'template' => 'tripal_views_admin',  
+      'arguments' =>  array(NULL),  
+      'path' => drupal_get_path('module', 'tripal_views') . '/theme' 
+    ),
   );
 }