Added the theme_is_<themeid> template boolean value to allow conditional template code depending on theme ID (in shared templates, sidebar blocks, etc.)
authorDan
Mon, 07 Jul 2008 02:41:50 -0400
changeset 598 4e5985fffc4d
parent 597 c4ae0d8e260f
child 599 52bffa6c499f
Added the theme_is_<themeid> template boolean value to allow conditional template code depending on theme ID (in shared templates, sidebar blocks, etc.)
includes/template.php
--- a/includes/template.php	Mon Jul 07 02:37:12 2008 -0400
+++ b/includes/template.php	Mon Jul 07 02:41:50 2008 -0400
@@ -1008,6 +1008,9 @@
     $this->tpl_bool['stupid_mode'] = false;
     $this->tpl_bool['in_admin'] = ( ( $local_page_id == 'Administration' && $local_namespace == 'Special' ) || $local_namespace == 'Admin' );
     
+    // allows conditional testing of the theme ID (a bit crude, came from my NSIS days)
+    $this->tpl_bool["theme_is_{$this->theme}"] = true;
+    
     $p = ( isset($_GET['printable']) ) ? '/printable' : '';
     
     // Add the e-mail address client code to the header