Browse Source

unlocked all fields... need to revisit that. Fixed bug with theming legacy templaates

Stephen Ficklin 8 years ago
parent
commit
43b73641c2

+ 0 - 33
tripal/tripal.module

@@ -162,18 +162,6 @@ function tripal_menu() {
 //     'weight' => -100,
 //   );
 
-
-/*
-  $items['admin/tripal/setup/customize'] = array(
-    'title' => 'Customize Tripal',
-    'description' => t('Information on how to customize tripal'),
-    'page callback' => 'theme',
-    'page arguments' => array('tripal_customize'),
-    'access arguments' => array('administer tripal'),
-    'weight' => 10
-  );
-*/
-
   // Jobs Management
   $items['admin/tripal/tripal_jobs'] = array(
     'title' => 'Jobs',
@@ -326,27 +314,6 @@ function tripal_permission() {
  */
 function tripal_theme($existing, $type, $theme, $path) {
   $themes = array(
-    'tripal_customize' => array(
-      'arguments' => array('job_id' => NULL),
-      'template' => 'tripal_customize',
-      'path' => "$path/theme/templates"
-    ),
-    'theme_file_upload_combo' => array(
-      'render element' => 'element',
-    ),
-    'theme_sequence_combo' => array(
-      'render element' => 'element',
-    ),
-    'tripal_jobs_help' => array(
-      'template' => 'tripal_jobs_help',
-      'variables' =>  array(NULL),
-      'path' => "$path/theme/templates"
-    ),
-    'tripal_customtables_help' => array(
-      'template' => 'tripal_customtables_help',
-      'variables' =>  array(NULL),
-      'path' => "$path/theme/templates"
-    ),
     // Admin messages theme
     'tripal_admin_message' => array(
       'function' => 'theme_tripal_admin_message',

+ 0 - 17
tripal_chado/includes/TripalFields.old/chado_base__dbxref_id.inc

@@ -78,20 +78,9 @@ class chado_base__dbxref_id extends TripalField {
     $options = tripal_get_db_select_options();
 
     //$widget['#element_validate'] = array('chado_base__dbxref_id_widget_validate');
-    $widget['#theme'] = 'chado_base__dbxref_id_widget';
     $widget['#prefix'] =  "<span id='$field_name-dbxref--db-id'>";
     $widget['#suffix'] =  "</span>";
 
-    // A temporary element used for theming the fieldset.
-    $widget['#theme_settings'] = array(
-      '#title' => $element['#title'],
-      '#description' =>  $element['#description'],
-      '#weight' => isset($element['#weight']) ? $element['#weight'] : 0,
-      '#theme' => 'chado_base__dbxref_id_widget',
-      //'#collapsible' => TRUE,
-      //'#collapsed' => $collapsed,
-    );
-
     $widget['value'] = array(
       '#type' => 'value',
       '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
@@ -336,12 +325,6 @@ function theme_chado_base__dbxref_id_widget($variables) {
       </div>
     ";
 
-  //   $classes = array();
-  //   $classes[] = 'collapsible';
-  //   $theme_settings = $element['#theme_settings'];
-  //   if ($theme_settings['#collapsed'] == FALSE) {
-  //     $classes[] = 'collapsed';
-  //   }
   $fieldset = array(
     '#title' => $element['#title'],
     '#value' => '',

+ 2 - 2
tripal_chado/includes/TripalFields/ChadoField.inc

@@ -25,7 +25,7 @@ class ChadoField extends TripalField {
   // If you override this variable in a child class be sure to replicate the
   // term_name, term_vocab, term_accession and term_fixed keys as these are
   // required for all TripalFields.
-  public static $default_instance_settings  = array(
+  public static $default_instance_settings = array(
     // The short name for the vocabulary (e.g. shcema, SO, GO, PATO, etc.).
     'term_vocabulary' => 'schema',
     // The name of the term.
@@ -38,7 +38,7 @@ class ChadoField extends TripalField {
     'term_fixed' => FALSE,
     // The table in Chado that the instance maps to.
     'chado_table' => '',
-    // The primary key column of hte table in Dhado.
+    // The column of the table in Chado where the value of the field comes from.
     'chado_column' => '',
     // The base table.
     'base_table' => '',

+ 0 - 16
tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc

@@ -50,16 +50,6 @@ class data__accession_widget extends ChadoFieldWidget {
     $widget['#prefix'] =  "<span id='$field_name-dbxref--db-id'>";
     $widget['#suffix'] =  "</span>";
 
-    // A temporary element used for theming the fieldset.
-    $widget['#theme_settings'] = array(
-      '#title' => $element['#title'],
-      '#description' =>  $element['#description'],
-      '#weight' => isset($element['#weight']) ? $element['#weight'] : 0,
-//      '#theme' => 'data__accession_widget',
-      //'#collapsible' => TRUE,
-      //'#collapsed' => $collapsed,
-    );
-
     $widget['value'] = array(
       '#type' => 'value',
       '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
@@ -174,12 +164,6 @@ class data__accession_widget extends ChadoFieldWidget {
       </div>
     ";
 
-    //   $classes = array();
-    //   $classes[] = 'collapsible';
-    //   $theme_settings = $element['#theme_settings'];
-    //   if ($theme_settings['#collapsed'] == FALSE) {
-    //     $classes[] = 'collapsed';
-    //   }
     $fieldset = array(
       '#title' => $element['#title'],
       '#value' => '',

+ 0 - 6
tripal_chado/includes/TripalFields/uo__unit/uo__unit.inc

@@ -35,12 +35,6 @@ class uo__unit extends ChadoField {
   public static $default_formatter = 'UO__unit_formatter';
 
 
-  /**
-   * @see TripalField::validate()
-   */
-  public function validate($entity_type, $entity, $field, $items, &$errors) {
-  }
-
   /**
    * @see TripalField::load()
    */

+ 22 - 22
tripal_chado/includes/tripal_chado.fields.inc

@@ -92,7 +92,7 @@ function tripal_chado_bundle_create_fields_base(&$info, $details, $entity_type,
       'field_name' => $field_name,
       'type' => '',
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -188,7 +188,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -204,7 +204,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -219,7 +219,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -234,7 +234,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -249,7 +249,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -264,7 +264,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -280,7 +280,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -295,7 +295,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
 //       'field_name' => $field_name,
 //       'type' => $field_type,
 //       'cardinality' => 1,
-//       'locked' => TRUE,
+//       'locked' => FALSE,
 //       'storage' => array(
 //         'type' => 'field_chado_storage',
 //       ),
@@ -312,7 +312,7 @@ function tripal_chado_bundle_create_fields_custom(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -342,7 +342,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -358,7 +358,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' =>  $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -374,7 +374,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -389,7 +389,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -404,7 +404,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -420,7 +420,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -436,7 +436,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -475,7 +475,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -492,7 +492,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -509,7 +509,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -525,7 +525,7 @@ function tripal_chado_bundle_create_fields_linker(&$info, $details, $entity_type
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => FIELD_CARDINALITY_UNLIMITED,
-      'locked' => TRUE,
+      'locked' => FALSE,
       'storage' => array(
         'type' => 'field_chado_storage',
       ),
@@ -733,7 +733,7 @@ function tripal_chado_bundle_create_instances_base(&$info, $entity_type, $bundle
     //
     elseif ($table_name == 'analysis' and $column_name == 'program') {
       $base_info['description'] = 'The program name (e.g. blastx, blastp, sim4, genscan. If the analysis was not derived from a software package then provide a very brief description of the pipeline, workflow or method.';
-      $base_info['label'] = 'Program, Pipeline, Workflow or Method Name.';
+      $base_info['label'] = 'Program, Pipeline, Workflow or Method Name';
     }
     elseif ($table_name == 'analysis' and $column_name == 'sourceuri') {
       $base_info['widget_type'] = 'text_textfield';

+ 2 - 39
tripal_chado/tripal_chado.module

@@ -616,43 +616,6 @@ function tripal_chado_permission() {
 function tripal_chado_theme($existing, $type, $theme, $path) {
   $themes = array(
 
-    // Theme fields.
-     'data__accession_widget' => array(
-       'render element' => 'element',
-       'file' => 'includes/TripalFields/data__accession/data__accession_widget.inc',
-     ),
-     'sbo__database_cross_reference_widget' => array(
-       'render element' => 'element',
-       'file' => 'includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc',
-     ),
-//     'chado_linker__cvterm_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__cvterm.inc',
-//     ),
-     'schema__alternate_name_widget' => array(
-       'render element' => 'element',
-       'file' => 'includes/TripalFields/schema__alternate_name/schema__alternate_name_widget.inc',
-     ),
-//     'chado_linker__relationship_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__relationship.inc',
-//     ),
-//     'chado_linker__relationship_instance_settings' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__relationship.inc',
-//     ),
-//     'chado_linker__pub_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__pub.inc',
-//     ),
-//     'chado_linker__contact_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__contact.inc',
-//     ),
-//     'chado_linker__prop_adder_widget' => array(
-//       'render element' => 'element',
-//       'file' => 'includes/TripalFields/chado_linker__prop_adder.inc',
-//     ),
     'tripal_chado_date_combo' => array(
       'render element' => 'element',
       'file' => 'theme/tripal_chado.theme.inc',
@@ -681,7 +644,7 @@ function tripal_chado_theme($existing, $type, $theme, $path) {
       ->execute();
 
     // Iterate through all of the TripalEntity bundles and see which ones
-    // map to tables that used had Tripal v2 nodes.  For those, if the
+    // map to tables that used to have Tripal v2 nodes.  For those, if the
     // legacy support is turned on then we want to use the legacy template.
     while ($bundle = $bundles->fetchObject()) {
       $term = tripal_load_term_entity(array('term_id' => $bundle->term_id));
@@ -694,7 +657,7 @@ function tripal_chado_theme($existing, $type, $theme, $path) {
 
       // Do not proceed if there is not a mapped_table
       if (!$mapped_table) {
-        return;
+        continue;
       }
 
       $chado_table = $mapped_table->chado_table;