Hi We seem to be moving towards an overall new hook system, all based around the callbacks and alters of forms. I have worked with form api for a long enough time to say that I very much dislike it. I prefer hooks over _alter's and callbacks. Thats all.
- Not always easier to use or easier to theme. Not exactly elegant either -- often very verbose.
Theme functions in fapi have become a LOT more complex. EG: +function theme_profile_category($element) { + $output = ($element['#title'] != '') ? '<h3>'. $element['#title'] .'</h3>' : ''; + $output .= '<dl'. drupal_attributes($element['#attributes']) .'>'; + + foreach (element_children($element) as $key) { + if ($element[$key]['#title'] != '') { + $output .= '<dt'. drupal_attributes($element[$key] ['#attributes']) .'>'. $element[$key]['#title'] .'</dt>'; + unset($element[$key]['#title']); + $output .= '<dd'. drupal_attributes($element[$key] ['#attributes']) .'>' . $element[$key]['#value'] .'</dd>'; + unset($element[$key]['#value']); + } + } + $output .= '</dl>'; + return $output; +} 2 ifs, 1 foreach, 1 unset, 2 api calls and loads of complex concanations. This should not even be considered a theme function. This is business logic pur sang. Complex business logic even. Not fit for a theme. FAPI (alike code) has introduced lots of these waaaay too complex theme functions. Compare to a properly crafted theme function, wich gets prepared data: function theme_profile_category($elements) { foreach ($elements as $key => $element) { $out .= theme('profile_element', $element, $key); } return "<dl>$out</dl>"; } function theme_profile_element($element, $key) { $elements = drupal_attributes($element['#attributes']); $out .= "<dt $elements>$element['#title']</dt>"; $out .= "<dd>$element['#value']</dd>" } This latter solution is 1) cleaner, 2) gives the same power to the themer, and is 3) far easier to grok. I don't have a good feeling about this FAPI direction. not at all. Is this explanation why i dislike the fapi-concept technical enough? There, I've said it. :) Bèr -- PGP ber@webschuur.com http://www.webschuur.com/sites/webschuur.com/files/ber_webschuur.asc Nieuwsartikelen, of weblog.: http://help.sympal.nl/nieuwsartikelen_of_weblog