Now that we have gone through the changes in the major Drupal templates and covered the major changes related to JavaScript and CSS, let's look into the changes to the actual theme API. These functions are implemented within your theme's template.php
file and give you immense control over the presentation of elements within your site.
The first thing you will notice when you try to upgrade your Drupal 6 theme to Drupal 7 is that all functions now take a $variables
array rather than a list of parameters in the method signature. This allows for consistent pre-processing of variables and makes coding easier. Unless noted otherwise later in this chapter, all parameters that used to be passed to a theme function are now available within the variables array using the original parameter name. For example, in Drupal 6, the theme_date
method was implemented as follows:
function theme_date($element) { return theme('form_element', $element, '<div class="container...