Theme defference between Drupal5 and Drupal4
menu_primary_links() and menu_secondary_links() now return structured links
menu_primary_links() and menu_secondary_links() now return structured links. No longer is a an array of l()s returned, but rather a structured array of links. When you loop through these links in $primary_links or $secondary_links in a phpTemplate theme (or menu_primary_links() and menu_secondary_links() respectively), you must build your l() by passing in the values.
4.7.x themes:
<?php
print '<ul>';
foreach ($primary_links as $link) {
print '<li>'. $link .'</li>';
}
print '</ul>';
?>
5.x themes:
<?php
print theme('links', $primary_links);
?>
or doing it your self:
<?php
print '<ul>';
foreach ($primary_links as $link) {
print '<li>'. l($link['title'], $link['href'],
$link['attributes'], $link['query'],
$link['fragment'], FALSE, $link['html']) .’</li>’;
}
print ‘</ul>’;
?>
drupal_add_css
4.7.x
<?php
theme('stylesheet_import', base_path() . path_to_theme() . '/extra_stylesheet.css') or theme_add_style($themes[$theme]->filename);
?>
5.x
<?php
drupal_add_css($path = NULL, $type = 'module', $media = 'all');
?>
clear-block
4.7.x
<div>
Some text here.
<br class="clear" />
</div>
5.x
<div class="clear-block">
Some text here.
</div>
_phptemplate_callback
4.7.x
<?php
function _phptemplate_callback($hook, $variables = array(), $file = NULL) {
?>
5.x
<?php
/**
* Execute a template engine call.
*
* Each call to the template engine has two parts. Namely preparing
* the variables, and then doing something with them.
*
* The first step is done by all template engines / themes, the second
* step is dependent on the engine used.
*
* @param $hook
* The name of the theme function being executed.
* @param $variables
* A sequential array of variables passed to the theme function.
* @param $suggestions
* An array of suggested template files to use. If none of the files are found, the
* default $hook.tpl.php will be used.
* @return
* The HTML generated by the template system.
*/
function _phptemplate_callback($hook, $variables = array(), $suggestions = array()) {
?>