|
@@ -5,141 +5,126 @@ $organism = $variables['node']->organism;
|
|
|
|
|
|
|
|
|
|
|
|
-$allowed_types = variable_get('chado_browser_feature_types', 'gene mRNA');
|
|
|
+$allowed_types = variable_get('chado_browser_feature_types');
|
|
|
$allowed_types = preg_replace("/[\s\n\r]+/", " ", $allowed_types);
|
|
|
$so_terms = explode(' ', $allowed_types);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-$element = 0;
|
|
|
-$num_per_page = 25;
|
|
|
-$values = array(
|
|
|
- 'organism_id' => $organism->organism_id,
|
|
|
- 'type_id' => array(
|
|
|
- 'name' => $so_terms
|
|
|
- ),
|
|
|
-);
|
|
|
-$columns = array('feature_id');
|
|
|
-$options = array(
|
|
|
- 'pager' => array(
|
|
|
- 'limit' => $num_per_page,
|
|
|
- 'element' => $element
|
|
|
- ),
|
|
|
- 'order_by' => array('name' => 'ASC'),
|
|
|
-);
|
|
|
-$results = chado_select_record('feature', $columns, $values, $options);
|
|
|
+
|
|
|
+if (count($so_terms) > 0) {
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-$features = array();
|
|
|
-foreach ($results as $result) {
|
|
|
- $values = array('feature_id' => $result->feature_id);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $element = 0;
|
|
|
+ $num_per_page = 25;
|
|
|
+ $values = array(
|
|
|
+ 'organism_id' => $organism->organism_id,
|
|
|
+ 'type_id' => array(
|
|
|
+ 'name' => $so_terms
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ $columns = array('feature_id');
|
|
|
$options = array(
|
|
|
- 'include_fk' => array(
|
|
|
- 'type_id' => 1
|
|
|
- )
|
|
|
+ 'pager' => array(
|
|
|
+ 'limit' => $num_per_page,
|
|
|
+ 'element' => $element
|
|
|
+ ),
|
|
|
+ 'order_by' => array('name' => 'ASC'),
|
|
|
);
|
|
|
- $features[] = chado_generate_var('feature', $values, $options);
|
|
|
-}
|
|
|
+ $results = chado_select_record('feature', $columns, $values, $options);
|
|
|
|
|
|
-if (count($features) > 0) { ?>
|
|
|
- <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors. Use the searching mechanism to find specific features.</div> <?php
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $features = array();
|
|
|
+ foreach ($results as $result) {
|
|
|
+ $values = array('feature_id' => $result->feature_id);
|
|
|
+ $options = array(
|
|
|
+ 'include_fk' => array(
|
|
|
+ 'type_id' => 1
|
|
|
+ )
|
|
|
+ );
|
|
|
+ $features[] = chado_generate_var('feature', $values, $options);
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $headers = array('Feature Name' ,'Unique Name', 'Type');
|
|
|
+ if (count($features) > 0) { ?>
|
|
|
+ <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors. Use the searching mechanism to find specific features.</div> <?php
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $rows = array();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $headers = array('Feature Name' ,'Unique Name', 'Type');
|
|
|
|
|
|
-
|
|
|
- print tripal_set_message("Administrators, you can specify the feature types ".
|
|
|
- "that should appear in this browser or remove it from the list of resources ".
|
|
|
- "by navigating to the ".
|
|
|
- l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank'))),
|
|
|
- TRIPAL_INFO,
|
|
|
- array('return_html' => 1)
|
|
|
- );
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $rows = array();
|
|
|
+
|
|
|
+
|
|
|
+ print tripal_set_message("Administrators, you can specify the feature types ".
|
|
|
+ "that should appear in this browser or remove it from the list of resources ".
|
|
|
+ "by navigating to the ".
|
|
|
+ l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank'))),
|
|
|
+ TRIPAL_INFO,
|
|
|
+ array('return_html' => 1)
|
|
|
+ );
|
|
|
|
|
|
- foreach ($features as $feature){
|
|
|
- $fname = $feature->name;
|
|
|
- if (property_exists($feature, 'nid')) {
|
|
|
- $fname = l($fname, "node/$feature->nid", array('attributes' => array('target' => '_blank')));
|
|
|
+ foreach ($features as $feature){
|
|
|
+ $fname = $feature->name;
|
|
|
+ if (property_exists($feature, 'nid')) {
|
|
|
+ $fname = l($fname, "node/$feature->nid", array('attributes' => array('target' => '_blank')));
|
|
|
+ }
|
|
|
+ $rows[] = array(
|
|
|
+ $fname,
|
|
|
+ $feature->uniquename,
|
|
|
+ $feature->type_id->name
|
|
|
+ );
|
|
|
}
|
|
|
- $rows[] = array(
|
|
|
- $fname,
|
|
|
- $feature->uniquename,
|
|
|
- $feature->type_id->name
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $table = array(
|
|
|
+ 'header' => $headers,
|
|
|
+ 'rows' => $rows,
|
|
|
+ 'attributes' => array(
|
|
|
+ 'id' => 'tripal_organism-table-features',
|
|
|
+ 'class' => 'tripal-data-table'
|
|
|
+ ),
|
|
|
+ 'sticky' => FALSE,
|
|
|
+ 'caption' => '',
|
|
|
+ 'colgroups' => array(),
|
|
|
+ 'empty' => '',
|
|
|
);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $table = array(
|
|
|
- 'header' => $headers,
|
|
|
- 'rows' => $rows,
|
|
|
- 'attributes' => array(
|
|
|
- 'id' => 'tripal_organism-table-features',
|
|
|
- 'class' => 'tripal-data-table'
|
|
|
- ),
|
|
|
- 'sticky' => FALSE,
|
|
|
- 'caption' => '',
|
|
|
- 'colgroups' => array(),
|
|
|
- 'empty' => '',
|
|
|
- );
|
|
|
-
|
|
|
-
|
|
|
- print theme_table($table);
|
|
|
+
|
|
|
+
|
|
|
+ print theme_table($table);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $pager = array(
|
|
|
- 'tags' => array(),
|
|
|
- 'element' => $element,
|
|
|
- 'parameters' => array(
|
|
|
- 'block' => 'feature_browser'
|
|
|
- ),
|
|
|
- 'quantity' => $num_per_page,
|
|
|
- );
|
|
|
- print theme_pager($pager);
|
|
|
-}
|
|
|
-else { ?>
|
|
|
- <p>There are no results.</p><?php
|
|
|
- print tripal_set_message("
|
|
|
- Administrators, perform the following to show features in this browser:
|
|
|
- <ul>
|
|
|
- <li>Load features for this organism using the " .
|
|
|
- l("FASTA loader", 'admin/tripal/loaders/fasta_loader') . ", ".
|
|
|
- l("GFF Loader", 'admin/tripal/loaders/gff3_load') . " or ".
|
|
|
- l("Bulk Loader", 'admin/tripal/loaders/bulk'). "</li>
|
|
|
- <li>Sync the features that should have pages using the ".
|
|
|
- l("Sync features page", 'admin/tripal/chado/tripal_feature/sync'). "</li>
|
|
|
- <li>Return to this page to browse features.</li>
|
|
|
- <li>Ensure the user " .
|
|
|
- l("has permission", 'admin/people/permissions') . " to view the feature content</li>
|
|
|
- </ul>
|
|
|
- <br>
|
|
|
- <br>
|
|
|
- You can specify the feature types
|
|
|
- that should appear in this browser or remove it from the list of resources by navigating to the " .
|
|
|
- l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank'))) . "
|
|
|
- The feature browser will not appear to site visitors unless features are present. ",
|
|
|
- TRIPAL_INFO,
|
|
|
- array('return_html' => 1));
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $pager = array(
|
|
|
+ 'tags' => array(),
|
|
|
+ 'element' => $element,
|
|
|
+ 'parameters' => array(
|
|
|
+ 'block' => 'feature_browser'
|
|
|
+ ),
|
|
|
+ 'quantity' => $num_per_page,
|
|
|
+ );
|
|
|
+ print theme_pager($pager);
|
|
|
|
|
|
+ print tripal_set_message("
|
|
|
+ Administrators, please note that the feature browser will be retired in
|
|
|
+ a future version of Tripal.",
|
|
|
+ TRIPAL_INFO,
|
|
|
+ array('return_html' => 1));
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
|