From c05f2181dc8556cb6700e8c6bb6e6ded43273192 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 9 Oct 2009 01:00:08 +0000 Subject: - Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot. --- modules/system/system.module | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index 4464e6c54..c3477faf7 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1465,10 +1465,10 @@ function system_preprocess_page(&$variables) { list($version, ) = explode('.', VERSION); // Emit the META tag in the HTML HEAD section - theme('meta_generator_html', $version); + theme('meta_generator_html', array('version' => $version)); // Emit the HTTP Header too - theme('meta_generator_header', $version); + theme('meta_generator_header', array('version' => $version)); $variables['head'] = drupal_get_html_head(); } @@ -1592,7 +1592,7 @@ function system_block_configure($delta = '') { $form['wrapper']['preview'] = array( '#type' => 'item', '#title' => 'Preview', - '#markup' => theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system'), array('class' => array('powered-by-preview')), FALSE), + '#markup' => theme('image', array('path' => $image_path, 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system'), 'attributes' => array('class' => array('powered-by-preview')), 'getsize' => FALSE)), ); return $form; } @@ -1625,7 +1625,7 @@ function system_block_view($delta = '') { case 'powered-by': $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png'; $block['subject'] = NULL; - $block['content'] = theme('system_powered_by', $image_path); + $block['content'] = theme('system_powered_by', array('image_path' => $image_path)); return $block; case 'help': $block['subject'] = NULL; @@ -2691,8 +2691,8 @@ function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_t * * @ingroup themeable */ -function theme_system_powered_by($image_path) { - $image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system')); +function theme_system_powered_by($variables) { + $image = theme('image', array('path' => $variables['image_path'], 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system'))); return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE)); } @@ -2719,8 +2719,8 @@ function theme_system_compact_link() { * * @ingroup themeable */ -function theme_meta_generator_html($version = VERSION) { - drupal_add_html_head(''); +function theme_meta_generator_html($variables) { + drupal_add_html_head(''); } /** @@ -2728,8 +2728,8 @@ function theme_meta_generator_html($version = VERSION) { * * @ingroup themeable */ -function theme_meta_generator_header($version = VERSION) { - drupal_add_http_header('X-Generator', 'Drupal ' . $version . ' (http://drupal.org)'); +function theme_meta_generator_header($variables) { + drupal_add_http_header('X-Generator', 'Drupal ' . $variables['version'] . ' (http://drupal.org)'); } /** @@ -2798,7 +2798,7 @@ function system_page_build(&$page) { ), ), // Trigger cron run for clients not supporting JavaScript (fall-back). - '#markup' => theme('system_run_cron_image', 'system/run-cron-image'), + '#markup' => theme('system_run_cron_image', array('image_path' => 'system/run-cron-image')), ); } @@ -2893,7 +2893,7 @@ function system_run_cron_image_access() { * @see system_run_cron_image() * @ingroup themeable */ -function theme_system_run_cron_image($image_path) { - return ''; +function theme_system_run_cron_image($variables) { + return ''; } -- cgit v1.2.3