Quellcode durchsuchen

Tripal Project adheres to Drupal coding standards

Pubudu Basnayaka vor 12 Jahren
Ursprung
Commit
d9569ba525

+ 3 - 3
tripal_project/tripal_project.admin.inc

@@ -5,10 +5,10 @@
  */
 
 function tripal_project_administration_description_page() {
- $output = '';
+  $output = '';
 
 
- return $output;
+  return $output;
 }
 
 function tripal_project_configuration_page() {
@@ -91,7 +91,7 @@ function tripal_project_sync_all_projects() {
       $node = node_submit($new_node);
       node_save($node);
       if ($node->nid) {
-         print "Added " . $project[0]->name . " (Node ID:" . $node->nid . ")\n";
+        print "Added " . $project[0]->name . " (Node ID:" . $node->nid . ")\n";
       }
     }
     else {

+ 3 - 3
tripal_project/tripal_project.install

@@ -11,21 +11,21 @@
  */
 
 /**
- * Implementation of hook_install()
+ * Implementation of hook_install().
  */
 function tripal_project_install() {
   drupal_install_schema('tripal_project');
 }
 
 /**
- * Implementation of hook_uninstall()
+ * Implementation of hook_uninstall().
  */
 function tripal_project_uninstall() {
   drupal_uninstall_schema('tripal_project');
 }
 
 /**
- * Implementation of hook_schema()
+ * Implementation of hook_schema().
  */
 function tripal_project_schema() {
 

+ 63 - 63
tripal_project/tripal_project.module

@@ -25,9 +25,9 @@ require('tripal_project.admin.inc');
  *
  */
 function tripal_project_views_api() {
-   return array(
+  return array(
       'api' => 2.0,
-   );
+  );
 }
 
 /**
@@ -35,14 +35,14 @@ function tripal_project_views_api() {
  */
 function tripal_project_menu() {
   $items[ 'admin/tripal/tripal_project' ]= array(
-    'title' => t('Projects'),
+    'title' => 'Projects',
     'page callback' => 'tripal_project_administration_description_page',
     'access arguments' => array('administer site configuration'),
     'type' => MENU_NORMAL_ITEM
   );
 
   $items[ 'admin/tripal/tripal_project/configuration' ]= array(
-    'title' => t('Configuration'),
+    'title' => 'Configuration',
     'page callback' => 'tripal_project_configuration_page',
     'access arguments' => array('administer site configuration'),
     'type' => MENU_NORMAL_ITEM
@@ -99,10 +99,10 @@ function chado_project_access($op, $node, $account) {
   if ($op == 'update' || $op == 'delete') {
 
     if (!user_access('edit own chado_projects', $account)) {
-       return FALSE;
+      return FALSE;
     }
     if (user_access('edit own chado_projects', $account) &&
-       $account->uid != $node->uid) {
+      $account->uid != $node->uid) {
       return FALSE;
     }
   }
@@ -120,13 +120,13 @@ function chado_project_access($op, $node, $account) {
 //-----------------------------------------------------------------------------
 
 /**
-* Implementation of hook_node_info()
-*
-* This node_info, is a simple node that describes the functionallity of the module. It specifies
-* that the title(Project Name) and body(Description) set to true so that they information can be
-* entered
-*
-*/
+ * Implementation of hook_node_info().
+ *
+ * This node_info, is a simple node that describes the functionallity of the module. It specifies
+ * that the title(Project Name) and body(Description) set to true so that they information can be
+ * entered
+ *
+ */
 function tripal_project_node_info() {
   return array(
     'chado_project' => array(
@@ -142,21 +142,21 @@ function tripal_project_node_info() {
 }
 
 /**
-* Implementation of hook_form().
-*
-*  This form takes the Project Title information and description from the user.
-*
-*  @parm &$node
-*    The initialized node
-*
-*  @parm $form_state
-*    The state of the form, that has the user entered information that is neccessary for adding
-*    information to the project
-*
-*  @return $form
-*    An array as described by the Drupal Form API
-*
-*/
+ * Implementation of hook_form().
+ *
+ *  This form takes the Project Title information and description from the user.
+ *
+ *  @parm &$node
+ *    The initialized node
+ *
+ *  @parm $form_state
+ *    The state of the form, that has the user entered information that is neccessary for adding
+ *    information to the project
+ *
+ *  @return $form
+ *    An array as described by the Drupal Form API
+ *
+ */
 function chado_project_form(&$node, $form_state) {
 
   $type = node_get_types('type', $node);
@@ -193,23 +193,23 @@ function chado_project_form(&$node, $form_state) {
 }
 
 /**
-* Implementation of hook_insert()
-*
-*  @parm $node
-*    Then node that has the information stored within, accessed given the nid
-*
-*/
+ * Implementation of hook_insert().
+ *
+ *  @parm $node
+ *    Then node that has the information stored within, accessed given the nid
+ *
+ */
 function chado_project_insert($node) {
 
   $values =  array(
      'name' => $node->title,
      'description' => $node->description,
-   );
+  );
 
-   if (!$node->project_id) {
+  if (!$node->project_id) {
      //inserts info into chado table.
-     $result = tripal_core_chado_insert('project', $values);
-     $node->project_id = $result['project_id'];
+  $result = tripal_core_chado_insert('project', $values);
+  $node->project_id = $result['project_id'];
   }
 
   //inserts the row of vid,nid,project_id into the chado_project table
@@ -218,21 +218,21 @@ 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
-*
-*/
+ *
+ * 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
+ *
+ */
 function chado_project_delete($node) {
   // Notice that we're matching all revision, by using the node's nid.
 
   // Find the project to delete
   $values =  array(
      'project_id' => $node->project->project_id,
-   );
+  );
   tripal_core_chado_delete('project', $values);
 
   //deleteing in drupal chado_project table
@@ -241,13 +241,13 @@ function chado_project_delete($node) {
 }
 
 /**
-* Implements hook_update()
-*
-* @param $node
-*  The node which is to have its containing information updated when the user modifies information
-*  pertaining to the specific project
-*
-*/
+ * Implements hook_update().
+ *
+ * @param $node
+ *  The node which is to have its containing information updated when the user modifies information
+ *  pertaining to the specific project
+ *
+ */
 function chado_project_update($node) {
 
   // Find the project to update
@@ -266,15 +266,15 @@ function chado_project_update($node) {
 }
 
 /**
-* Implementation of node_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
-*
-*/
+ * Implementation of node_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
+ *
+ */
 function chado_project_load($node) {
 
   //selecting the coresponding table information

+ 7 - 7
tripal_project/tripal_project.views.inc

@@ -29,7 +29,7 @@ function tripal_project_views_data()  {
     );
     foreach ($tables as $tablename) {
       if (!tripal_views_is_integrated($tablename, 10)) {
-        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename,TRUE);
+        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
         tripal_views_integration_add_entry($table_integration_array);
       }
     }
@@ -38,7 +38,7 @@ function tripal_project_views_data()  {
     );
     foreach ($tables as $tablename) {
       if (!tripal_views_is_integrated($tablename, 10)) {
-        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename,FALSE);
+        $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, FALSE);
         tripal_views_integration_add_entry($table_integration_array);
       }
     }
@@ -56,12 +56,12 @@ function tripal_project_views_data()  {
  * @return: An array of handler definitions
  */
 function tripal_project_views_handlers() {
- return array(
+  return array(
    'info' => array(
      'path' => drupal_get_path('module', 'tripal_project') . '/views/handlers',
-   ),
+  ),
    'handlers' => array(
 
-   ),
- );
-}
+  ),
+  );
+}