Răsfoiți Sursa

Merge branch '7.x-2.x' of git.drupal.org:sandbox/spficklin/1337878 into 7.x-2.x

Lacey Sanderson 11 ani în urmă
părinte
comite
afba7f9fba

+ 11 - 4
tripal_core/theme/css/tripal.css

@@ -176,13 +176,20 @@
   */ 
  
 .tripal-site-admin-only {
-   background-image: url("../images/TripalLogo-sm.png");
-   background-repeat: no-repeat;
-   background-color: #BBBBFF;
+  background-image: url("../images/TripalLogo-sm.png");
+  background-repeat: no-repeat;
+  background-color: #cce3ff;
 }
 
 .tripal-site-admin-message {
    padding: 10px 10px 10px 55px;
    font-style: italic;
 }
-
+/**
+ * When when no tripal logo image is wanted 
+ */
+.tripal-site-admin-only-noimg {
+  background-image: none;
+  background-color: #cce3ff;
+  color: black;
+}

+ 15 - 16
tripal_core/tripal_core.module

@@ -534,6 +534,7 @@ function tripal_core_views_api() {
   );
 }
 
+
 /**
  * After the node is built, we want to add instructions to each
  * content section letting the administrator know which template
@@ -543,28 +544,26 @@ function tripal_core_views_api() {
  */
 function tripal_core_node_view_alter(&$build) {
   global $theme;
-  
 
   $cache = cache_get("theme_registry:$theme", 'cache');
-  $paths = array();
+  $node = $build['#node'];
+  
   foreach ($build as $key => $value) {
+    // for tripal templates do some customizations
     if (preg_match('/^tripal_/', $key)) {
+      
+      // add in some default div's, id's and classes
+      // that can be consistent regardless of customizations to templates
+      //$build[$key]['#value'] = "<div id=\"$key-block\" class=\"tripal-info-box\">" . $build[$key]['#value'] . '</div>';
+
+      // get the template path
+      $path = '';
       if (array_key_exists($key, $cache->data)) {
-        $paths[$key] = $cache->data[$key]['path'];
+        $path = $cache->data[$key]['path'];
       }
     }
   }
-  if (count($paths) > 0) {
-    $message = '<p>The content displayed on this page is provided by the following templates: <ul>';
-    foreach ($paths as $template => $path) {
-      $message .= "<li>$key: $path</li>";
-    }
-    $message .= "</ul>";
-    $build['tripal_template_paths']['#value'] = theme(
-      'theme_tripal_admin_message',
-      array('message' => $message)
-    );
-  }
-//  dpm($build);
-//  dpm($cache);
+
+  //dpm($build);
+  //dpm($cache);
 }

+ 16 - 0
tripal_organism/theme/tripal_organism/tripal_organism_base.tpl.php

@@ -61,6 +61,22 @@ $organism = tripal_core_expand_chado_vars($organism,'field','organism.comment');
     ),
     $organism->abbreviation
   );
+  
+  // allow site admins to see the organism ID
+  if (user_access('access administration pages')) {
+    // Organism ID
+    $rows[] = array(
+      array(
+        'data' => 'Organism ID',
+        'header' => TRUE,
+        'class' => 'tripal-site-admin-only-noimg'
+      ),
+      array(
+        'data' => $organism->organism_id,
+        'class' => 'tripal-site-admin-only-noimg'
+      ),
+    );
+  }
 
   // the $table array contains the headers and rows array as well as other
   // options for controlling the display of the table.  Additional