Ver código fonte

Projects: cleaned up doc

Lacey Sanderson 11 anos atrás
pai
commit
ede5bfaee6

+ 9 - 5
tripal_project/includes/tripal_project.admin.inc

@@ -1,11 +1,13 @@
 <?php
 /**
  * @file
- * @todo Add file header description
+ * Administration of projects
  */
 
 /**
+ * Admin launchpad
  *
+ * @ingroup tripal_project
  */
 function tripal_project_admin_project_view() {
   $output = '';
@@ -37,10 +39,11 @@ function tripal_project_admin_project_view() {
   return $output;
 }
 /**
- * 
- * @param $form_state
+ * Project settings
+ *
+ * @ingroup tripal_project
  */
-function tripal_project_admin($form_state) {
+function tripal_project_admin($form, $form_state) {
   $form = array();
 
   $form['nothing'] = array(
@@ -51,9 +54,10 @@ function tripal_project_admin($form_state) {
 }
 
 /**
+ * Validate project settings
  *
  * @ingroup tripal_project
  */
 function tripal_project_admin_validate($form, &$form_state) {
 
-}
+}

+ 17 - 16
tripal_project/includes/tripal_project.chado_node.inc

@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * Implement the project node content type
+ */
 
 /**
  * Implementation of hook_node_info().
@@ -7,7 +11,6 @@
  * that the title(Project Name) and body(Description) set to true so that they information can be
  * entered
  *
- *
  * @ingroup tripal_project
  */
 function tripal_project_node_info() {
@@ -35,6 +38,7 @@ function tripal_project_node_info() {
     ),
   );
 }
+
 /**
  * Implementation of hook_form().
  *
@@ -188,8 +192,10 @@ function chado_project_form(&$node, $form_state) {
   return $form;
 
 }
+
 /**
- *  validates submission of form when adding or updating a project node
+ * Implements hook_validate().
+ * Validates submission of form when adding or updating a project node
  *
  * @ingroup tripal_project
  */
@@ -224,13 +230,13 @@ function chado_project_validate($node, $form, &$form_state) {
     form_set_error('title', t('The unique project name already exists. Please choose another'));
   }
 }
+
 /**
  * Implementation of hook_insert().
  *
  *  @parm $node
  *    Then node that has the information stored within, accessed given the nid
  *
- *
  * @ingroup tripal_project
  */
 function chado_project_insert($node) {
@@ -294,13 +300,11 @@ function chado_project_insert($node) {
 }
 
 /**
- *
  * Implementation of hook_delete().
  *
  * @param $node
- * The node which is to be deleted, only chado project and chado_project need to be dealt with
- * since the drupal node is deleted automagically
- *
+ *  The node which is to be deleted, only chado project and chado_project need to be dealt with
+ *  since the drupal node is deleted automagically
  *
  * @ingroup tripal_project
  */
@@ -335,7 +339,6 @@ function chado_project_delete($node) {
  *  The node which is to have its containing information updated when the user modifies information
  *  pertaining to the specific project
  *
- *
  * @ingroup tripal_project
  */
 function chado_project_update($node) {
@@ -380,15 +383,11 @@ function chado_project_update($node) {
 }
 
 /**
- * Implementation of node_load().
+ * Implementation of hook_load().
  *
  * @param $node
  *   The node that is to have its containing information loaded
  *
- * @return $node
- *   The node, containing the loaded project with the current nid
- *
- *
  * @ingroup tripal_project
  */
 function chado_project_load($nodes) {
@@ -406,7 +405,7 @@ function chado_project_load($nodes) {
 }
 
 /**
- * Implement hook_access().
+ * Implement hook_node_access().
  *
  * This hook allows node modules to limit access to the node types they define.
  *
@@ -454,9 +453,11 @@ function chado_project_node_access($node, $op, $account) {
   }
   return NULL;
 }
+
 /**
+ * Implements hook_node_view().
  *
- * @ingroup tripal_feature
+ * @ingroup tripal_project
  */
 function tripal_project_node_view($node, $view_mode, $langcode) {
   switch ($node->type) {
@@ -497,4 +498,4 @@ function tripal_project_node_view($node, $view_mode, $langcode) {
       }
       break;
   }
-}
+}

+ 20 - 8
tripal_project/tripal_project.install

@@ -1,17 +1,14 @@
 <?php
-
 /**
  * @file
- * This file contains all the functions which describe and implement drupal database tables
- * needed by this module. This module was developed by Chad N.A. Krilow and Lacey-Anne Sanderson,
- * University of Saskatchewan.
- *
- * The project manamgenet module allows you to sync data in a chado/Tripal instance with
- * multiple project/mysql instances as well as manage and create such project instances
+ * Install the tripal project
  */
 
 /**
+ * Implements hook_disable().
  * Disable default views when module is disabled
+ *
+ * @ingroup tripal_project
  */
 function tripal_project_disable() {
 
@@ -27,6 +24,7 @@ function tripal_project_disable() {
 /**
  * Implementation of hook_requirements().
  *
+ * @ingroup tripal_project
  */
 function tripal_project_requirements($phase) {
   $requirements = array();
@@ -42,8 +40,11 @@ function tripal_project_requirements($phase) {
   }
   return $requirements;
 }
+
 /**
  * Implementation of hook_install().
+ *
+ * @ingroup tripal_project
  */
 function tripal_project_install() {
 
@@ -56,6 +57,8 @@ function tripal_project_install() {
 
 /**
  * Implementation of hook_uninstall().
+ *
+ * @ingroup tripal_project
  */
 function tripal_project_uninstall() {
 
@@ -63,6 +66,8 @@ function tripal_project_uninstall() {
 
 /**
  * Implementation of hook_schema().
+ *
+ * @ingroup tripal_project
  */
 function tripal_project_schema() {
   $schema['chado_project'] = array(
@@ -88,7 +93,9 @@ function tripal_project_schema() {
 }
 
 /**
+ * Add cvs pertaining to projects
  *
+ * @ingroup tripal_project
  */
 function tripal_project_add_cvs() {
   tripal_cv_add_cv('project_property', 'Contains properties for projects');
@@ -99,8 +106,11 @@ function tripal_project_add_cvs() {
     'Contains Types of relationships between projects.'
   );
 }
+
 /**
+ * Add cvterms pertaining to projects
  *
+ * @ingroup tripal_project
  */
 function tripal_project_add_cvterms() {
 
@@ -133,6 +143,8 @@ function tripal_project_add_cvterms() {
 
 /**
  * This is the required update for tripal_project when upgrading from Drupal core API 6.x.
+ *
+ * @ingroup tripal_project
  */
 function tripal_project_update_7000() {
 
@@ -156,4 +168,4 @@ function tripal_project_update_7000() {
 
   // add in new CVterms
   tripal_project_add_cvterms();
-}
+}

+ 29 - 17
tripal_project/tripal_project.module

@@ -1,8 +1,15 @@
 <?php
-require('api/tripal_project.api.inc');
-require('theme/tripal_project.theme.inc');
-require('includes/tripal_project.admin.inc');
-require('includes/tripal_project.chado_node.inc');
+/**
+ * @file
+ * Integrates the Chado Project tables with Drupal Nodes & Views
+ */
+
+require 'api/tripal_project.api.inc';
+
+require 'theme/tripal_project.theme.inc';
+
+require 'includes/tripal_project.admin.inc';
+require 'includes/tripal_project.chado_node.inc';
 
 /**
  * @defgroup tripal_project Project Module
@@ -13,23 +20,22 @@ require('includes/tripal_project.chado_node.inc');
  */
 
 /**
- * Implements hook_views_api()
+ * Implements hook_views_api().
  *
- * Purpose: Essentially this hook tells drupal that there is views support for
+ * Essentially this hook tells drupal that there is views support for
  *  for this module which then includes tripal_project.views.inc where all the
  *  views integration code is
  *
  * @ingroup tripal_project
- *
  */
 function tripal_project_views_api() {
   return array(
-      'api' => 2.0,
+      'api' => 3.0,
   );
 }
 
 /**
- * Implements hook_menu
+ * Implements hook_menu().
  *
  * @ingroup tripal_project
  */
@@ -83,8 +89,10 @@ function tripal_project_menu() {
 }
 
 /**
- * Implements hook_help()
- * Purpose: Adds a help page to the module list
+ * Implements hook_help().
+ * Adds a help page to the module list
+ *
+ * @ingroup tripal_project
  */
 function tripal_project_help ($path, $arg) {
   if ($path == 'admin/help#tripal_project') {
@@ -93,12 +101,11 @@ function tripal_project_help ($path, $arg) {
 }
 
 /**
- * Implements hook_perm()
+ * Implements hook_permission()
  *
  *  This function sets the permission for the user to access the information in the database.
  *  This includes creating, inserting, deleting and updating of information in the database
  *
- *
  * @ingroup tripal_project
  */
 function tripal_project_permission() {
@@ -126,9 +133,9 @@ function tripal_project_permission() {
   );
 }
 
-
-
 /**
+ *  Implements hook_theme().
+ *
  *  We need to let drupal know about our theme functions and their arguments.
  *  We create theme functions to allow users of the module to customize the
  *  look and feel of the output generated in this module
@@ -185,6 +192,7 @@ function tripal_project_theme($existing, $type, $theme, $path) {
 }
 
 /**
+ * Implements hook_block_info().
  *
  * @ingroup tripal_project
  */
@@ -207,7 +215,9 @@ function tripal_project_block_info() {
 
   return $blocks;
 }
+
 /**
+ * Implements hook_block_view().
  *
  * @ingroup tripal_project
  */
@@ -246,15 +256,17 @@ function tripal_project_block_view($delta = '') {
 }
 
 /**
- * Implementation of hook_form_alter()
+ * Implementation of hook_form_alter().
  *
  * @param $form
  * @param $form_state
  * @param $form_id
+ *
+ * @ingroup tripal_project
  */
 function tripal_project_form_alter(&$form, &$form_state, $form_id) {
   // turn of preview button for insert/updates
   if ($form_id == "chado_project_node_form") {
     $form['actions']['preview']['#access'] = FALSE;
   }
-}
+}

+ 12 - 3
tripal_project/tripal_project.views_default.inc

@@ -1,9 +1,13 @@
 <?php
+/**
+ * @file
+ * Project Default Views
+ */
 
 /**
+ * Implements hook_views_default_views().
  *
- *
- *
+ * @ingroup tripal_project
  */
 function tripal_project_views_default_views() {
   $views = array();
@@ -14,6 +18,11 @@ function tripal_project_views_default_views() {
   return $views;
 }
 
+/**
+ * Project administration view
+ *
+ * @ingroup tripal_project
+ */
 function tripal_project_defaultview_admin_projects() {
 
   $view = new view();
@@ -189,4 +198,4 @@ function tripal_project_defaultview_admin_projects() {
   $handler->display->display_options['tab_options']['weight'] = '0';
 
   return $view;
-}
+}