|
@@ -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
|