Created
November 29, 2010 05:42
-
-
Save k4ml/719621 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
function modulename_theme($existing, $type, $theme, $path) { | |
return array( | |
'formtemplate_horizontal' => array( | |
'arguments' => array('form' => NULL), | |
), | |
); | |
} | |
function theme_formtemplate_horizontal($form) { | |
$output = '<table class="formtemplate-horizontal"><tr>'; | |
foreach (element_children($form) as $key) { | |
if (in_array($form[$key]['#type'], array('submit', 'button'))) { | |
$output .= '<td class="valign-middle">'; | |
} | |
else { | |
$output .= '<td>'; | |
} | |
$output .= drupal_render($form[$key]) .'</td>'; | |
} | |
$output .= '</tr></table>'; | |
return $output; | |
} | |
/* | |
css | |
table.formtemplate-horizontal { | |
width: 0; | |
border-collapse: none; | |
} | |
table.formtemplate-horizontal .valign-middle { | |
vertical-align: middle; | |
} | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment