Created
May 20, 2010 16:02
-
-
Save jimshreds/407736 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sets the body-tag class attribute. | |
* | |
* Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed. | |
*/ | |
function phptemplate_body_class($left, $right) { | |
if ($left != '' && $right != '') { | |
$class = 'sidebars'; | |
} | |
else { | |
if ($left != '') { | |
$class = 'sidebar-left'; | |
} | |
if ($right != '') { | |
$class = 'sidebar-right'; | |
} | |
} | |
if (isset($class)) { | |
print ' class="'. $class .'"'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment