Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function site_form_alter(&$form, $form_state, $form_id) {
- $horizontal_form_ids = array('forward_form');
- if (in_array($form_id, $horizontal_form_ids)) {
- site_make_form_elements_hozontal(&$form);
- }
- }
- function site_make_form_elements_hozontal(&$form) {
- $horizontal_types = array('textfield', 'textarea'); // the #type attribute
- site_apply_attribute($form, $horizontal_types);
- }
- function site_apply_attribute(&$tree, $horizontal_types) {
- foreach (element_children($tree) as $key => $value) {
- if (isset($tree[$value]['#type']) && in_array($tree[$value]['#type'], $horizontal_types)) {
- dsm('apply to ' . $data['#type']);
- } else if (is_array($tree[$value])) {
- site_apply_attribute($tree, $horizontal_types);
- }
- }
- }
Add Comment
Please, Sign In to add comment