From 6f429d6fe71232d02fcb333a7120dbd117ad8a44 Mon Sep 17 00:00:00 2001 From: bradfordcondon Date: Wed, 13 Dec 2017 15:02:45 -0500 Subject: [PATCH 1/2] clear out unused files --- README.md | 2 - .../tripal_analysis_expression.info | 2 +- .../includes/tripal_biomaterial.admin.inc | 99 --- .../tripal_biomaterial.chado_node.inc | 585 ------------------ tripal_biomaterial/tripal_biomaterial.module | 28 +- .../includes/tripal_arraydesign.admin.inc | 87 --- .../includes/tripal_protocol.admin.inc | 85 --- tripal_protocol/tripal_protocol.info | 3 +- tripal_protocol/tripal_protocol.module | 2 - 9 files changed, 4 insertions(+), 889 deletions(-) delete mode 100644 tripal_biomaterial/includes/tripal_biomaterial.admin.inc delete mode 100644 tripal_biomaterial/includes/tripal_biomaterial.chado_node.inc delete mode 100644 tripal_protocol/includes/tripal_arraydesign.admin.inc delete mode 100644 tripal_protocol/includes/tripal_protocol.admin.inc diff --git a/README.md b/README.md index 48b34b8d..76cd76cb 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ This is an extension module for the Tripal project. Please note this module requires **Tripal 3** or greater. The [Tripal 2 functional module is available for download](https://github.com/tripal/tripal_analysis_expression/releases/tag/1.0.2) but is no longer supported. -New documentation for the new data loaders and module structure is under development. - # Tripal Analysis: Expression 1. [Introduction](#introduction) diff --git a/tripal_analysis_expression/tripal_analysis_expression.info b/tripal_analysis_expression/tripal_analysis_expression.info index b673d739..8dfc7a82 100644 --- a/tripal_analysis_expression/tripal_analysis_expression.info +++ b/tripal_analysis_expression/tripal_analysis_expression.info @@ -1,7 +1,7 @@ name = Tripal Expression description = A module to load expression data core = 7.x -version = 7.x-0.1-dev +version = 7.x-3.0 project = tripal_analysis_expression package = Tripal Extensions configure = admin/tripal/extension/tripal_analysis_expression diff --git a/tripal_biomaterial/includes/tripal_biomaterial.admin.inc b/tripal_biomaterial/includes/tripal_biomaterial.admin.inc deleted file mode 100644 index dcab49b3..00000000 --- a/tripal_biomaterial/includes/tripal_biomaterial.admin.inc +++ /dev/null @@ -1,99 +0,0 @@ - 'tripal_analysis_expression', - 'content_type' => 'chado_biomaterial', - 'options' => [ - '[biomaterial.name]' => 'Biomaterial Only', - ], - 'unique_option' => '[biomaterial.name]' //*** fix me - ]; - chado_add_admin_form_set_title($form, $form_state, $details); - - $details = [ - 'module' => 'tripal_analysis_expression', - 'content_type' => 'chado_biomaterial', - 'options' => [ //*** fix these - '/biomaterial/[biomaterial.biomaterial_id]' => 'Biomaterial ID', - '/biomaterial/[biomaterial.name]' => 'Biomaterial Name', - ], - ]; - chado_add_admin_form_set_url($form, $form_state, $details); - - $form['ontologies'] = [ - '#title' => t('Biomaterial Ontology Terms'), - '#type' => 'fieldset', - '#description' => t('Configuration settings for ontology term display.'), - '#collapsible' => TRUE, - ]; - - $form['ontologies']['chado_biomaterial_ontologies_to_display'] = [ - '#title' => t('Ontologies to Display'), - '#description' => t('List the sequence ontologies for which cvterms should be displayed (if present)') . t(' on the biomaterial page. Ontologies should be separated by a space or newline.'), - '#type' => 'textarea', - '#default_value' => variable_get('chado_biomaterial_ontologies_to_display'), - ]; - - return system_settings_form($form); -} - -/** - * Landing page for administration. Ensures Views are enabled and if not, - * provides links to do so. - * - * @return - * An HTML string that provides a link to enable the view. - * - * @ingroup tripal_biomaterial - */ -function tripal_biomaterial_admin_biomaterial_view() { - $output = ''; - - // Set the breadcrumbs. - $breadcrumb = []; //*** update this for tripal - $breadcrumb[] = l('Home', ''); - $breadcrumb[] = l('Administration', 'admin'); - $breadcrumb[] = l('Tripal', 'admin/tripal'); - $breadcrumb[] = l('Extensions', 'admin/tripal/extension'); - $breadcrumb[] = l('Tripal Expression', 'admin/tripal/extension/tripal_analysis_expression'); - $breadcrumb[] = l('Analysis: Expression Content Types', 'admin/tripal/extension/tripal_analysis_expression/content_types'); - $breadcrumb[] = l('Biomaterials', 'admin/tripal/extension/tripal_analysis_expression/content_types/biomaterial'); - drupal_set_breadcrumb($breadcrumb); - - // Add the view. - $view = views_embed_view('tripal_biomaterial_admin_biomaterials', 'default'); - if (isset($view)) { - $output .= $view; - } - else { - $output .= '

The Tripal Expression module uses primarily views to provide an ' . 'administrative interface. Currently one or more views needed for this this ' . 'administrative interface are disabled.
Click each of the following links to ' . 'enable the pertinent views:'; //*** fix this wording - $output .= '

'; - } - return $output; -} - - - - diff --git a/tripal_biomaterial/includes/tripal_biomaterial.chado_node.inc b/tripal_biomaterial/includes/tripal_biomaterial.chado_node.inc deleted file mode 100644 index f0e01b15..00000000 --- a/tripal_biomaterial/includes/tripal_biomaterial.chado_node.inc +++ /dev/null @@ -1,585 +0,0 @@ -type; - } - - if ($node_type == 'chado_biomaterial') { - if ($op == 'create') { - if (!user_access('create chado_biomaterial content', $account)) { - return NODE_ACCESS_DENY; - } - return NODE_ACCESS_ALLOW; - } - if ($op == 'update') { - if (!user_access('edit chado_biomaterial content', $account)) { - return NODE_ACCESS_DENY; - } - } - if ($op == 'delete') { - if (!user_access('delete chado_biomaterial content', $account)) { - return NODE_ACCESS_DENY; - } - } - if ($op == 'view') { - if (!user_access('access chado_biomaterial content', $account)) { - return NODE_ACCESS_DENY; - } - } - return NODE_ACCESS_IGNORE; - } -} - -/** - * Implements hook_form() - * - * When editing or create a new node of type 'chado_biomaterial' we need - * a form. This function creates the form that will be used for this. - * - * @ingroup tripal_biomaterial - */ -function chado_biomaterial_form($node, $form_state) { - $form = []; - - // Not sure what this is for. Is this line necessary? - $form['#attribute']['enctype'] = 'multipart/form-data'; - - if (property_exists($node, 'biomaterial')) { - $biomaterial = $node->biomaterial; - - // Fill out the form. *** change title in protocl - $biomaterial_name = property_exists($node, 'biomaterial_name') ? property_exists($node, 'biomaterial_name') : $biomaterial->name; - $description = property_exists($node, 'description') ? property_exists($node, 'description') : $biomaterial->description; - - // The conditional here is required because this field is chosen by an optional select. - if ($biomaterial->biosourceprovider_id != NULL) { - $biosourceprovider_id = property_exists($node, 'biosourceprovider_id') ? property_exists($node, 'biosourceprovider_id') : $biomaterial->biosourceprovider_id->contact_id; - } - else { - $biosourceprovider_id = NULL; - } - - // The conditional here is required because this field is chosen by an optional select. - if ($biomaterial->taxon_id != NULL) { - $taxon_id = property_exists($node, 'taxon_id') ? property_exists($node, 'taxon_id') : $biomaterial->taxon_id->organism_id; - } - else { - $taxon_id = NULL; - } - - // Set the biomaterial id. - $form['biomaterial_id'] = [ - '#type' => 'value', - '#value' => $biomaterial->biomaterial_id, - ]; - $biomaterial_id = $biomaterial->biomaterial_id; - } - - else { - $biomaterial_name = property_exists($node, 'biomaterial_name') ? property_exists($node, 'biomaterial_name') : ''; - $description = property_exists($node, 'description') ? property_exists($node, 'description') : ''; - $biosourceprovider_id = property_exists($node, 'biosourceprovider_id') ? property_exists($node, 'biosourceprovider_id') : ''; - $taxon_id = property_exists($node, 'taxon_id') ? property_exists($node, 'taxon_id') : ''; - - $biomaterial_id = NULL; - } - - $form['biomaterial_name'] = [ - '#type' => 'textfield', - '#title' => t('Biomaterial Name (must be unique)'), - '#required' => TRUE, - '#default_value' => $biomaterial_name, - ]; - $form['description'] = [ - '#type' => 'textarea', - '#rows' => 8, - '#title' => t('Biomaterial Description'), - '#default_value' => $description, - ]; - - // Obtain the list of contacts from the chado contact table. - $sql = 'SELECT - contact_id, name - FROM {contact} - ORDER BY name'; - $results = chado_query($sql); - $contacts = []; - while ($contact = $results->fetchObject()) { - $contacts[$contact->contact_id] = $contact->name; - } - - $form['choose_contact'] = [ - '#type' => 'value', - '#value' => $contacts, - ]; - - $lt_message = tripal_set_message(t('If the contact who provided the biomaterial is not present in the dropdown list, ') . l(t('add a new contact.'), 'node/add/chado-contact') . t(' A biomaterial provider contact is not required.'), TRIPAL_INFO, ['return_html' => TRUE]); - - $form['biosourceprovider_id'] = [ - '#title' => t('Biomaterial Provider'), - '#type' => 'select', - '#empty_value' => '', - '#description' => t('The contact who provided the biomaterial.'), - '#default_value' => $biosourceprovider_id, - '#options' => $form['choose_contact']['#value'], - '#suffix' => $lt_message, - ]; - - $sql = 'SELECT - organism_id, genus, species, common_name - FROM {organism} - ORDER BY genus'; - $results = chado_query($sql); - $organisms = []; - while ($organism = $results->fetchObject()) { - $organisms[$organism->organism_id] = $organism->genus . ' ' . $organism->species . ' (' . $organism->common_name . ')'; - } - - $form['choose_organism'] = [ - '#type' => 'value', - '#value' => $organisms, - ]; - - $lt_message = tripal_set_message(t('If the organism does not appear in this list, ') . l(t('add a new organism.'), 'node/add/chado-organism') . t(' A organism is not required.'), TRIPAL_INFO, ['return_html' => TRUE]); - - $form['taxon_id'] = [ - '#title' => t('Organism'), - '#type' => 'select', - '#empty_value' => '', - '#description' => t('The organism from which the biomaterial was collected.'), - '#options' => $form['choose_organism']['#value'], - '#default_value' => $taxon_id, - '#suffix' => $lt_message, - ]; - - // PROPERTIES FORM - //--------------------------------------------- - $prop_cv = tripal_get_default_cv('biomaterialprop', 'type_id'); - $cv_id = $prop_cv ? $prop_cv->cv_id : NULL; - $details = [ - 'property_table' => 'biomaterialprop', - // the name of the prop table - 'chado_id' => $biomaterial_id, - // the value of feature_id for this record - 'cv_id' => $cv_id - // the cv.cv_id of the cv governing featureprop.type_id - ]; - chado_add_node_form_properties($form, $form_state, $details); - - // ADDITIONAL DBXREFS FORM - //--------------------------------------------- - $details = [ - 'linking_table' => 'biomaterial_dbxref', - // the name of the _dbxref table - 'base_foreign_key' => 'biomaterial_id', - // the name of the key in your base chado table - 'base_key_value' => $biomaterial_id - // the value of feature_id for this record - ]; - chado_add_node_form_dbxrefs($form, $form_state, $details); //*** need to add templates for this add the relationshiops - - // TODO: For some reason adding a relationship to the form breaks AJAX - // for features (works for other node type)... need to debug - - // RELATIONSHIPS FORM - //--------------------------------------------- - $relationship_cv = tripal_get_default_cv('biomaterial_relationship', 'type_id'); - $cv_id = $relationship_cv ? $relationship_cv->cv_id : NULL; - $details = [ - 'relationship_table' => 'biomaterial_relationship', - 'base_table' => 'biomaterial', - 'base_foreign_key' => 'biomaterial_id', - 'base_key_value' => $biomaterial_id, - 'base_name_field' => 'name', - 'nodetype' => 'biomaterial', - 'cv_id' => $cv_id, - ]; - chado_add_node_form_relationships($form, $form_state, $details); - - return $form; -} - -/** - * Implements hook_validate(). - * - * @ingroup tripal_biomaterial - */ -function chado_biomaterial_validate($node, $form, &$form_state) { - // Don't validate if a delete. - if ($node->op == 'Delete') { - return; - } - - // We are syncing if there is an biomaterial_id but no node ID. In this case a - // validation is not required. - if (is_null($node->nid) and property_exists($node, 'biomaterial_id') and $node->biomaterial_id != 0) { - return; - } - - // Remove white space around field values. - $node->biomaterial_name = trim($node->biomaterial_name); - $node->description = trim($node->description); - - // Validate for an update. - if (property_exists($node, 'biomaterial_id')) { - $sql = " - SELECT * - FROM {biomaterial} - WHERE - name = :name AND NOT - biomaterial_id = :biomaterial_id - "; - $args = [ - ':name' => $node->biomaterial_name, - ':biomaterial_id' => $node->biomaterial_id, - ]; - $result = chado_query($sql, $args)->fetchObject(); - if ($result) { - form_set_error('name', t("Update cannot proceed. The biomaterial - '$node->biomaterial_name' is already present in the database.")); - tripal_report_error('tripal_analysis_expression', TRIPAL_WARNING, 'Update biomaterial: name already exists: %value', ['%value' => "name = $node->biomaterial_name"]); - } - } - // Validate for an insert. - else { - $value = [ - 'name' => $node->biomaterial_name, - ]; - $biomaterial = chado_select_record('biomaterial', ['biomaterial_id'], $value); - if (sizeof($biomaterial) > 0) { - form_set_error('biomaterial_title', 'Cannot add the biomaterial with this name. - The biomaterial already exists.'); - tripal_report_error('tripal_analysis_expression', TRIPAL_WARNING, 'Insert biomaterial: name already exists: %value', ['%value' => "name = $node->biomaterial_name"]); - } - } -} - -/** - * Implements hook_insert(). - * - * When the new chado_biomaterial is created we also need to add information - * to the chado_biomaterial table. This function is called on insert of a new - * node of type 'chado_biomaterial' and inserts the necessary information. - * - * @ingroup tripal_biomaterial - */ -function chado_biomaterial_insert($node) { - - // Remove white space around field values. - $node->biomaterial_name = trim($node->biomaterial_name); - $node->description = trim($node->description); - - // Check to see if the node is already associated with a chado record. - if (!property_exists($node, 'biomaterial_id')) { - $values = [ - 'name' => $node->biomaterial_name, - 'description' => $node->description, - // 'biosourceprovider_id' => $node->biosourceprovider_id, - // 'taxon_id' => $node->taxon_id, - ]; - - if ($node->biosourceprovider_id) { - $values['biosourceprovider_id'] = $node->biosourceprovider_id; - } - - if ($node->taxon_id) { - $values['taxon_id'] = $node->taxon_id; - } - - $biomaterial = chado_insert_record('biomaterial', $values); - if (!$biomaterial) { - drupal_set_message(t('Unable to add biomaterial.'), 'warning'); - tripal_report_error('tripal_analysis_expression', TRIPAL_ERROR, 'Insert Biomaterial: Unable to create biomaterial where values: %values', ['%values' => print_r($values, TRUE)]); - return; - } - $biomaterial_id = $biomaterial['biomaterial_id']; - // * Properties Form * - $details = [ - 'property_table' => 'biomaterialprop', - // the name of the prop table - 'base_table' => 'biomaterial', - // the name of your chado base table - 'foreignkey_name' => 'biomaterial_id', - // the name of the key in your base table - 'foreignkey_value' => $biomaterial_id - // the value of the biomaterial_id key - ]; - chado_update_node_form_properties($node, $details); - - // * Additional DBxrefs Form * - $details = [ - 'linking_table' => 'biomaterial_dbxref', - // the name of your _dbxref table - 'foreignkey_name' => 'biomaterial_id', - // the name of the key in your base table - 'foreignkey_value' => $biomaterial_id - // the value of the biomaterial_id key - ]; - chado_update_node_form_dbxrefs($node, $details); - } - else { - $biomaterial_id = $node->biomaterial_id; - } - - // Check to see if the chado entry has a corresponding chado_biomaterial entry. - // Add if no corresponding entry exists in the chado_biomaterial table. - $check_org_id = chado_get_id_from_nid('biomaterial', $node->nid); - if (!$check_org_id) { - $record = new stdClass(); - $record->nid = $node->nid; - $record->vid = $node->vid; - $record->biomaterial_id = $biomaterial_id; - drupal_write_record('chado_biomaterial', $record); - } -} - -/** - * Implements hook_load(). - * - * When a node is requested by the user this function is called to allo us - * to add auxiliary data to the node object. - * - * @ingroup tripal_biomaterial - */ -function chado_biomaterial_load($nodes) { - - foreach ($nodes as $nid => $node) { - // Find the biomaterial nodes and add details. - $biomaterial_id = chado_get_id_from_nid('biomaterial', $nid); - - // Ignore orphaned nodes. - if (!$biomaterial_id) { - continue; - } - - // Build the biomaterial variable. - $values = ['biomaterial_id' => $biomaterial_id]; - $biomaterial = chado_generate_var('biomaterial', $values); - - // Add the description field, - //$arraydesign = chado_expand_var($arraydesign, 'field', 'arraydesign.description'); - $nodes[$nid]->biomaterial = $biomaterial; - - // Get title the node title. - $node->title = chado_get_node_title($node); - } -} - -/** - * Implements [content_type]_chado_node_default_title_format(). - * - * Defines a default title format for the Chado Node API to set the titles on - * chado_arraydesign nodes based on chado fields. - */ -function chado_biomaterial_chado_node_default_title_format() { - return '[biomaterial.name]'; -} - -/** - * Implements hook_chado_node_default_url_format(). - * - * Defines a default URL format for arraydesign nodes. - */ -function chado_biomaterial_chado_node_default_url_format() { - return '/biomaterial/[biomaterial.name]'; -} - -/** - * Implements hook_node_insert(). - * Acts on all content types. - * - * @ingroup tripal_biomaterial - */ -function tripal_biomaterial_node_insert($node) { - - switch ($node->type) { - case 'chado_biomaterial': - - // Find the a biomaterial and add details. - $biomaterial_id = chado_get_id_from_nid('biomaterial', $node->nid); - $values = ['biomaterial_id' => $biomaterial_id]; - $biomaterial = chado_generate_var('biomaterial', $values); - $node->biomaterial = $biomaterial; - - // Set the node title. - $node->title = chado_get_node_title($node); - - // Set the URL path. - chado_set_node_url($node); - - break; - } -} - -/** - * Implements hook_node_update(). - * Acts on all content types. - * - * @ingroup tripal_biomaterial - */ -function tripal_biomaterial_node_update($node) { - - switch ($node->type) { - case 'chado_biomaterial': - - // Set the node title. - $node->title = chado_get_node_title($node); - - // Set the URL path. - chado_set_node_url($node); - - break; - } -} - -/** - * Implements hook_update(). - * - * @ingroup tripal_biomaterial - */ -function chado_biomaterial_update($node) { - - // Remove white space around field values. - $node->biomaterial_name = trim($node->biomaterial_name); - $node->description = trim($node->description); - - $biomaterial_id = chado_get_id_from_nid('biomaterial', $node->nid); - - if ($node->revision) { - // Chado does not do revisions but following the example of prior modules - // keep this here for when/if revisions are addressed in the future. - } - $match = [ - 'biomaterial_id' => $biomaterial_id, - ]; - - if ($node->biosourceprovider_id == "") { - $biosourceprovider_id = NULL; - } - else { - $biosourceprovider_id = $node->biosourceprovider_id; - } - - if ($node->taxon_id == "") { - $taxon_id = NULL; - } - else { - $taxon_id = $node->taxon_id; - } - - $values = [ - 'name' => $node->biomaterial_name, - 'description' => $node->description, - 'biosourceprovider_id' => $biosourceprovider_id, - 'taxon_id' => $taxon_id, - ]; - - /* if ($node->biosourceprovider_id) { - $values['biosourceprovider_id'] = $node->biosourceprovider_id; - } - - if ($node->taxon_id) { - $values['taxon_id'] = $node->taxon_id; - } */ - - $status = chado_update_record('biomaterial', $match, $values); - - if (!$status) { - drupal_set_message(t('Unable to update biomaterial.'), 'warning'); - tripal_report_error('tripal_analysis_expression', TRIPAL_WARNING, 'Update biomaterial: Unable to update biomaterial where values: %values', ['%values' => print_r($values, TRUE)]); - } - - // * Properties Form * - $details = [ - 'property_table' => 'biomaterialprop', - // the name of the prop table - 'base_table' => 'biomaterial', - // the name of your chado base table - 'foreignkey_name' => 'biomaterial_id', - // the name of the key in your base table - 'foreignkey_value' => $biomaterial_id - // the value of the biomaterial_id key - ]; - chado_update_node_form_properties($node, $details); - - // * Additional DBxrefs Form * - $details = [ - 'linking_table' => 'biomaterial_dbxref', - // the name of your _dbxref table - 'foreignkey_name' => 'biomaterial_id', - // the name of the key in your base table - 'foreignkey_value' => $biomaterial_id - // the value of the biomaterial_id key - ]; - chado_update_node_form_dbxrefs($node, $details); -} - -/** - * Implements hook_delete(). - * - * Delete biomaterial from both drupal and chado databases. Check dependencies - * before deleting from chado. - * - * @ingroup tripal_biomaterial - */ -function chado_biomaterial_delete($node) { - $biomaterial_id = chado_get_id_from_nid('biomaterial', $node->nid); - - // If there is no biomaterial for this node, this is not the correct type or the chado - // entry is lost. - if (!$biomaterial_id) { - return; - } - - // Remove data from drupal tables including chado_biomaterial, node, and node_revisions - $sql_del = "DELETE FROM {chado_biomaterial} WHERE nid = :nid AND vid = :vid"; - db_query($sql_del, [':nid' => $node->nid, ':vid' => $node->vid]); - $sql_del = "DELETE FROM {node} WHERE nid = :nid AND vid = :vid"; - db_query($sql_del, [':nid' => $node->nid, ':vid' => $node->vid]); - $sql_del = "DELETE FROM {node_revision} WHERE nid = :nid AND vid = :vid"; - db_query($sql_del, [':nid' => $node->nid, ':vid' => $node->vid]); - - // Check for dependencies before deleting from the chado database. - // A dependency is the element table. More dependencies may need to be checked - // in the future if functionality is extended. - - $check_assay_biomaterial = chado_query('SELECT assay_biomaterial_id FROM {assay_biomaterial} WHERE biomaterial_id = :biomaterial_id', [':biomaterial_id' => $biomaterial_id])->fetchObject(); - $check_biomaterialprop = chado_query('SELECT biomaterialprop_id FROM {biomaterialprop} WHERE biomaterial_id = :biomaterial_id', [':biomaterial_id' => $biomaterial_id])->fetchObject(); - - if (!$check_assay_biomaterial or !$check_biomaterialprop) { - chado_delete_record('biomaterial', ['biomaterial_id' => $biomaterial_id]); - } - else { - drupal_set_message(t("Warning: other data depends on this biomaterial. The biomaterial page was removed from this site but the biomaterial record was not removed from Chado."), 'warning'); - } -} - diff --git a/tripal_biomaterial/tripal_biomaterial.module b/tripal_biomaterial/tripal_biomaterial.module index e19b00f6..a2882011 100644 --- a/tripal_biomaterial/tripal_biomaterial.module +++ b/tripal_biomaterial/tripal_biomaterial.module @@ -12,8 +12,6 @@ * the Analysis module. * @} */ -require_once "includes/tripal_biomaterial.chado_node.inc"; -require_once "includes/tripal_biomaterial.admin.inc"; require_once "includes/tripal_biomaterial.fields.inc"; require_once "theme/tripal_biomaterial.theme.inc"; require_once "api/tripal_biomaterial.api.inc"; @@ -36,7 +34,7 @@ function tripal_biomaterial_help($path, $arg) { $ret_val .= "

" . l(t("Biomaterial Administrative Pages"), "admin/tripal/extension/tripal_biomaterial/content_types/biomaterial"); $ret_val .= "
" . l(t("Biomaterial Help"), "admin/tripal/extension/tripal_biomaterial/content_types/biomaterial/help"); $ret_val .= "
" . l(t("Biomaterial Loader"), "admin/tripal/loaders/chado_biosample_loader"); - $ret_val .= "
". l(t("BioSample submission template"), "https://submit.ncbi.nlm.nih.gov/biosample/template/"); + $ret_val .= "
" . l(t("BioSample submission template"), "https://submit.ncbi.nlm.nih.gov/biosample/template/"); return $ret_val; break; } @@ -46,33 +44,11 @@ function tripal_biomaterial_help($path, $arg) { /** * Implements hook_permission(). * - * TODO: are the permissions relevant for Tripal 3? * * @ingroup tripal_biomaterial */ function tripal_biomaterial_permission() { - return [ - 'access chado_biomaterial content' => [ - 'title' => t('View Biomaterials'), - 'description' => t('Allow users to view biomaterial pages.'), - ], - 'create chado_biomaterial content' => [ - 'title' => t('Create Biomaterials'), - 'description' => t('Allow users to create new biomaterial pages.'), - ], - 'delete chado_biomaterial content' => [ - 'title' => t('Delete Biomaterials'), - 'description' => t('Allow users to delete biomaterial pages.'), - ], - 'edit chado_biomaterial content' => [ - 'title' => t('Edit Biomaterials'), - 'description' => t('Allow users to edit biomaterial pages.'), - ], - 'administer tripal biomaterial' => [ - 'title' => t('Administer Biomaterials'), - 'description' => t('Allow users to administer all biomaterials.'), - ], - ]; + } /** diff --git a/tripal_protocol/includes/tripal_arraydesign.admin.inc b/tripal_protocol/includes/tripal_arraydesign.admin.inc deleted file mode 100644 index d2f1cfcc..00000000 --- a/tripal_protocol/includes/tripal_arraydesign.admin.inc +++ /dev/null @@ -1,87 +0,0 @@ - 'tripal_analysis_expression', - 'content_type' => 'chado_arraydesign', - 'options' => [ - '[arraydesign.name]' => 'Array Design Only', - ], - 'unique_option' => '[arraydesign.name]', - ]; - chado_add_admin_form_set_title($form, $form_state, $details); - - $details = [ - 'module' => 'tripal_analysis_expression', - 'content_type' => 'chado_arraydesign', - // *** fix these. - 'options' => [ - '/arraydesign/[arraydesign.arraydesign_id]' => 'Array Design ID', - '/arraydesign/[arraydesign.name]' => 'Array Design Name', - ], - ]; - chado_add_admin_form_set_url($form, $form_state, $details); - - return system_settings_form($form); -} - -/** - * Landing page for administration. - * - * Ensures Views are enabled and if not, provides links to do so. - * - * @return string - * An HTML string that provides a link to enable the view. - * - * @ingroup tripal_arraydesign - */ -function tripal_arraydesign_admin_arraydesign_view() { - - $output = ''; - - // Set the breadcrumbs. - // *** update this for tripal. - $breadcrumb = []; - $breadcrumb[] = l(t('Home'), ''); - $breadcrumb[] = l(t('Administration'), 'admin'); - $breadcrumb[] = l(t('Tripal'), 'admin/tripal'); - $breadcrumb[] = l(t('Extensions'), 'admin/tripal/extension'); - $breadcrumb[] = l(t('Tripal Expression'), 'admin/tripal/extension/tripal_analysis_expression'); - $breadcrumb[] = l(t('Analysis: Expression Content Types'), 'admin/tripal/extension/tripal_analysis_expression/content_types'); - $breadcrumb[] = l(t('Array Design'), 'admin/tripal/extension/tripal_analysis_expression/content_types/arraydesign'); - drupal_set_breadcrumb($breadcrumb); - - // Add the view. - $view = views_embed_view('tripal_arraydesign_admin_arraydesigns', 'default'); - if (isset($view)) { - $output .= $view; - } - else { - $output .= '

The Tripal Expression module uses primarily views to provide an ' . 'administrative interface. Currently one or more views needed for this this ' . 'administrative interface are disabled.
Click each of the following links to ' // *** fix this wording. - . 'enable the pertinent views:'; - $output .= '

    '; - $output .= '
  • ' . l(t('Arraydesign View'), 'admin/tripal/extension/tripal_analysis_expression/content_type/arraydesign/views/arraydesigns/enable') . '
  • '; - $output .= '
'; - } - return $output; -} diff --git a/tripal_protocol/includes/tripal_protocol.admin.inc b/tripal_protocol/includes/tripal_protocol.admin.inc deleted file mode 100644 index 6b5783c0..00000000 --- a/tripal_protocol/includes/tripal_protocol.admin.inc +++ /dev/null @@ -1,85 +0,0 @@ - 'tripal_analysis_expression', - 'content_type' => 'chado_protocol', - 'options' => [ - '[protocol.name]' => 'Protocol Only', - ], - 'unique_option' => '[protocol.name]' //*** fix me - ]; - chado_add_admin_form_set_title($form, $form_state, $details); - - $details = [ - 'module' => 'tripal_analysis_expression', - 'content_type' => 'chado_protocol', - 'options' => [ //*** fix these - '/protocol/[protocol.protocol_id]' => 'Protocol ID', - '/protocol/[protocol.name]' => 'Protocol Name', - ], - ]; - chado_add_admin_form_set_url($form, $form_state, $details); - - return system_settings_form($form); -} - -/** - * Landing page for administration. Ensures Views are enabled and if not, - * provides links to do so. - * - * @return - * An HTML string that provides a link to enable the view. - * - * @ingroup tripal_protocol - */ -function tripal_protocol_admin_protocol_view() { - $output = ''; - - // Set the breadcrumbs. - $breadcrumb = []; //*** update this for tripal - $breadcrumb[] = l('Home', ''); - $breadcrumb[] = l('Administration', 'admin'); - $breadcrumb[] = l('Tripal', 'admin/tripal'); - $breadcrumb[] = l('Extensions', 'admin/tripal/extension'); - $breadcrumb[] = l('Tripal Expression', 'admin/tripal/extension/tripal_analysis_expression'); - $breadcrumb[] = l('Analysis: Expression Content Types', 'admin/tripal/extension/tripal_analysis_expression/content_types'); - $breadcrumb[] = l('Protocols', 'admin/tripal/extension/tripal_analysis_expression/content_types/protocol'); - drupal_set_breadcrumb($breadcrumb); - - // Add the view. - $view = views_embed_view('tripal_protocol_admin_protocols', 'default'); - if (isset($view)) { - $output .= $view; - } - else { - $output .= '

The Tripal Expression module uses primarily views to provide an ' . 'administrative interface. Currently one or more views needed for this this ' . 'administrative interface are disabled.
Click each of the following links to ' . 'enable the pertinent views:'; //*** fix this wording - $output .= '

    '; - $output .= '
  • ' . l('Protocol View', 'admin/tripal/extension/tripal_analysis_expression/content_types/protocol/views/protocols/enable') . '
  • '; - $output .= '
'; - } - return $output; -} - - - - diff --git a/tripal_protocol/tripal_protocol.info b/tripal_protocol/tripal_protocol.info index c89352be..f62e0cf2 100644 --- a/tripal_protocol/tripal_protocol.info +++ b/tripal_protocol/tripal_protocol.info @@ -1,11 +1,10 @@ name = Tripal Protocols description = A module to support Protocols core = 7.x -version = 7.x-0.1-dev +version = 7.x-3.0 project = tripal_analysis_expression package = Tripal Extensions configure = admin/tripal/extension/tripal_protocol dependencies[] = tripal dependencies[] = tripal_chado -//contact is in chado diff --git a/tripal_protocol/tripal_protocol.module b/tripal_protocol/tripal_protocol.module index 4e29889f..1274c9e4 100644 --- a/tripal_protocol/tripal_protocol.module +++ b/tripal_protocol/tripal_protocol.module @@ -13,8 +13,6 @@ * @} */ -require_once "includes/tripal_protocol.admin.inc"; -require_once "includes/tripal_arraydesign.admin.inc"; require_once "theme/tripal_protocol.theme.inc"; require_once "api/tripal_arraydesign.api.inc"; require_once "api/tripal_protocol.api.inc"; From e9527907e40b0a6b692f88b738bef64c7a8c973e Mon Sep 17 00:00:00 2001 From: bradfordcondon Date: Wed, 13 Dec 2017 15:04:47 -0500 Subject: [PATCH 2/2] final versioning --- tripal_biomaterial/tripal_biomaterial.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripal_biomaterial/tripal_biomaterial.info b/tripal_biomaterial/tripal_biomaterial.info index a3b77c39..edc457dc 100644 --- a/tripal_biomaterial/tripal_biomaterial.info +++ b/tripal_biomaterial/tripal_biomaterial.info @@ -1,7 +1,7 @@ name = Tripal Biomaterials description = A module to support Biomaterials core = 7.x -version = 7.x-0.1-dev +version = 7.x-3.0 project = tripal_analysis_expression package = Tripal Extensions configure = admin/tripal/extension/tripal_biomaterial