diff --git a/includes/common.inc b/includes/common.inc index b6ea297..611a3b3 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -6415,7 +6415,7 @@ function drupal_common_theme() { // - http://dev.w3.org/html5/spec/Overview.html#alt // The title attribute is optional in all cases, so it is omitted by // default. - 'variables' => array('path' => NULL, 'width' => NULL, 'height' => NULL, 'alt' => '', 'title' => NULL, 'attributes' => array()), + 'variables' => array('uri' => NULL, 'width' => NULL, 'height' => NULL, 'alt' => '', 'title' => NULL, 'attributes' => array()), ), 'breadcrumb' => array( 'variables' => array('breadcrumb' => NULL), diff --git a/includes/theme.inc b/includes/theme.inc index 9bd7062..03112c6 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1489,7 +1489,7 @@ function theme_links($variables) { * * @param $variables * An associative array containing: - * - path: Either the path of the image file (relative to base_path()) or a + * - uri: Either the path of the image file (relative to base_path()) or a * full URL. * - width: The width of the image (if known). * - height: The height of the image (if known). @@ -1509,11 +1509,11 @@ function theme_links($variables) { */ function theme_image($variables) { $attributes = $variables['attributes']; - $attributes['src'] = file_create_url($variables['path']); + $attributes['src'] = file_create_url($variables['uri']); + // The standard image attributes are only used if they arn't empty. foreach (array('width', 'height', 'alt', 'title') as $key) { - - if (isset($variables[$key])) { + if (isset($variables[$key]) && !empty($variables[$key])) { $attributes[$key] = $variables[$key]; } } @@ -1760,10 +1760,10 @@ function theme_table($variables) { */ function theme_tablesort_indicator($variables) { if ($variables['style'] == "asc") { - return theme('image', array('path' => 'misc/arrow-asc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort ascending'), 'title' => t('sort ascending'))); + return theme('image', array('uri' => 'misc/arrow-asc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort ascending'), 'title' => t('sort ascending'))); } else { - return theme('image', array('path' => 'misc/arrow-desc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort descending'), 'title' => t('sort descending'))); + return theme('image', array('uri' => 'misc/arrow-desc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort descending'), 'title' => t('sort descending'))); } } @@ -1876,7 +1876,7 @@ function theme_more_help_link($variables) { */ function theme_feed_icon($variables) { $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title'])); - if ($image = theme('image', array('path' => 'misc/feed.png', 'width' => 16, 'height' => 16, 'alt' => $text))) { + if ($image = theme('image', array('uri' => 'misc/feed.png', 'width' => 16, 'height' => 16, 'alt' => $text))) { return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text))); } } diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc index cffd1c3..73babd5 100644 --- a/modules/aggregator/aggregator.parser.inc +++ b/modules/aggregator/aggregator.parser.inc @@ -36,7 +36,7 @@ function aggregator_aggregator_parse($feed) { } if (!empty($image['link']) && !empty($image['url']) && !empty($image['title'])) { - $image = l(theme('image', array('path' => $image['url'], 'alt' => $image['title'])), $image['link'], array('html' => TRUE)); + $image = l(theme('image', array('uri' => $image['url'], 'alt' => $image['title'])), $image['link'], array('html' => TRUE)); } else { $image = ''; diff --git a/modules/color/color.module b/modules/color/color.module index ff6c70e..04c7f2e 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -62,7 +62,7 @@ function _color_theme_select_form_alter(&$form, &$form_state) { foreach (element_children($form) as $theme) { if ($screenshot = variable_get('color_' . $theme . '_screenshot')) { if (isset($form[$theme]['screenshot'])) { - $form[$theme]['screenshot']['#markup'] = theme('image', array('path' => $screenshot, 'title' => '', 'attributes' => array('class' => array('screenshot')))); + $form[$theme]['screenshot']['#markup'] = theme('image', array('uri' => $screenshot, 'title' => '', 'attributes' => array('class' => array('screenshot')))); } } } diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index d72fdf4..ecd5364 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -796,7 +796,7 @@ function theme_image_style_preview($variables) { $output .= '
'; $output .= t('original') . ' (' . l(t('view actual size'), $original_url) . ')'; $output .= '
'; - $output .= '' . theme('image', array('path' => $original_path, 'alt' => t('Sample original image'), 'title' => '', 'attributes' => $original_attributes)) . ''; + $output .= '' . theme('image', array('uri' => $original_path, 'alt' => t('Sample original image'), 'title' => '', 'attributes' => $original_attributes)) . ''; $output .= '
' . $original_image['height'] . 'px
'; $output .= '
' . $original_image['width'] . 'px
'; $output .= '
'; // End preview-image. @@ -807,7 +807,7 @@ function theme_image_style_preview($variables) { $output .= '
'; $output .= check_plain($style['name']) . ' (' . l(t('view actual size'), file_create_url($preview_file) . '?' . time()) . ')'; $output .= ''; // End preview-image. diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index 07cc1e0..d79ef85 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -522,27 +522,19 @@ function image_field_formatter_view($entity_type, $entity, $field, $instance, $l * An associative array containing: * - item: An array of image data. * - image_style: An optional image style. - * - path: An array containing the link 'path' and link 'options'. + * - path: An optional array containing the link 'path' and link 'options'. * * @ingroup themeable */ function theme_image_formatter($variables) { $item = $variables['item']; - $image = array( - 'path' => $item['uri'], - 'alt' => $item['alt'], - ); - // Do not output an empty 'title' attribute. - if (drupal_strlen($item['title']) > 0) { - $image['title'] = $item['title']; - } if ($variables['image_style']) { - $image['style_name'] = $variables['image_style']; - $output = theme('image_style', $image); + $item['style_name'] = $variables['image_style']; + $output = theme('image_style', $item); } else { - $output = theme('image', $image); + $output = theme('image', $item); } if ($variables['path']) { diff --git a/modules/image/image.module b/modules/image/image.module index d2d081c..667e2ba 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -1082,7 +1082,7 @@ function image_effect_apply($image, $effect) { * @param $variables * An associative array containing: * - style_name: The name of the style to be used to alter the original image. - * - path: The path of the image file relative to the Drupal files directory. + * - uri: The path of the image file relative to the Drupal files directory. * This function does not work with images outside the files directory nor * with remotely hosted images. * - alt: The alternative text for text-based browsers. @@ -1093,7 +1093,7 @@ function image_effect_apply($image, $effect) { * @ingroup themeable */ function theme_image_style($variables) { - $variables['path'] = image_style_url($variables['style_name'], $variables['path']); + $variables['uri'] = image_style_url($variables['style_name'], $variables['uri']); return theme('image', $variables); } diff --git a/modules/image/image.test b/modules/image/image.test index 00f79d8..81d914e 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -666,7 +666,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { // Test that the default formatter is being used. $image_uri = $node->{$field_name}[LANGUAGE_NONE][0]['uri']; $image_info = array( - 'path' => $image_uri, + 'uri' => $image_uri, ); $default_output = theme('image', $image_info); $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.')); @@ -711,7 +711,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { // Ensure the derivative image is generated so we do not have to deal with // image style callback paths. $this->drupalGet(image_style_url('thumbnail', $image_uri)); - $image_info['path'] = image_style_path('thumbnail', $image_uri); + $image_info['uri'] = image_style_path('thumbnail', $image_uri); $default_output = theme('image', $image_info); $this->drupalGet('node/' . $nid); $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.')); @@ -760,14 +760,14 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { // style. $node = node_load($nid, NULL, TRUE); $image_info = array( - 'path' => image_style_url('medium', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), + 'uri' => image_style_url('medium', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), ); $default_output = theme('image', $image_info); $this->assertRaw($default_output, t("Preview image is displayed using 'medium' style.")); // Add alt/title fields to the image and verify that they are displayed. $image_info = array( - 'path' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'], + 'uri' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'], 'alt' => $this->randomName(), 'title' => $this->randomName(), ); @@ -806,7 +806,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { field_info_cache_clear(); $field = field_info_field($field_name); $image = file_load($field['settings']['default_image']); - $default_output = theme('image', array('path' => $image->uri)); + $default_output = theme('image', array('uri' => $image->uri)); $this->drupalGet('node/' . $node->nid); $this->assertRaw($default_output, t('Default image displayed when no user supplied image is present.')); @@ -815,7 +815,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { $nid = $this->uploadNodeImage($images[1], $field_name, 'article'); $node = node_load($nid, NULL, TRUE); $image_info = array( - 'path' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'], + 'uri' => $node->{$field_name}[LANGUAGE_NONE][0]['uri'], ); $image_output = theme('image', $image_info); $this->drupalGet('node/' . $nid); diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc index 31d0b2c..6855f47 100644 --- a/modules/simpletest/simpletest.pages.inc +++ b/modules/simpletest/simpletest.pages.inc @@ -82,8 +82,8 @@ function theme_simpletest_test_table($variables) { // Define the images used to expand/collapse the test groups. $js = array( 'images' => array( - theme('image', array('path' => 'misc/menu-collapsed.png', 'width' => 7, 'height' => 7, 'alt' => t('Expand'), 'title' => t('Expand'))) . ' (' . t('Expand') . ')', - theme('image', array('path' => 'misc/menu-expanded.png', 'width' => 7, 'height' => 7, 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' (' . t('Collapse') . ')', + theme('image', array('uri' => 'misc/menu-collapsed.png', 'width' => 7, 'height' => 7, 'alt' => t('Expand'), 'title' => t('Expand'))) . ' (' . t('Expand') . ')', + theme('image', array('uri' => 'misc/menu-expanded.png', 'width' => 7, 'height' => 7, 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' (' . t('Collapse') . ')', ), ); @@ -426,10 +426,10 @@ function simpletest_result_status_image($status) { if (!isset($map)) { $map = array( - 'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('Pass'))), - 'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('Fail'))), - 'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Exception'))), - 'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Debug'))), + 'pass' => theme('image', array('uri' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('Pass'))), + 'fail' => theme('image', array('uri' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('Fail'))), + 'exception' => theme('image', array('uri' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Exception'))), + 'debug' => theme('image', array('uri' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Debug'))), ); } if (isset($map[$status])) { diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 92c534e..39c042e 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -154,7 +154,7 @@ function system_themes_page() { foreach (array_reverse($theme_keys) as $theme_key) { if (isset($themes[$theme_key]) && file_exists($themes[$theme_key]->info['screenshot'])) { $theme->screenshot = array( - 'path' => $themes[$theme_key]->info['screenshot'], + 'uri' => $themes[$theme_key]->info['screenshot'], 'alt' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])), 'title' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])), 'attributes' => array('class' => array('screenshot')), @@ -986,7 +986,7 @@ function _system_modules_build_row($info, $extra) { } else { $form['enable'] = array( - '#markup' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => $status_short, 'title' => $status_short)), + '#markup' => theme('image', array('uri' => 'misc/watchdog-error.png', 'alt' => $status_short, 'title' => $status_short)), ); $form['description']['#markup'] .= theme('system_modules_incompatible', array('message' => $status_long)); } diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc index 3f5933a..577e1c7 100644 --- a/modules/update/update.report.inc +++ b/modules/update/update.report.inc @@ -57,25 +57,25 @@ function theme_update_report($variables) { switch ($project['status']) { case UPDATE_CURRENT: $class = 'ok'; - $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('ok'), 'title' => t('ok'))); + $icon = theme('image', array('uri' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('ok'), 'title' => t('ok'))); break; case UPDATE_UNKNOWN: case UPDATE_FETCH_PENDING: case UPDATE_NOT_FETCHED: $class = 'unknown'; - $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning'))); + $icon = theme('image', array('uri' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning'))); break; case UPDATE_NOT_SECURE: case UPDATE_REVOKED: case UPDATE_NOT_SUPPORTED: $class = 'error'; - $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('error'), 'title' => t('error'))); + $icon = theme('image', array('uri' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('error'), 'title' => t('error'))); break; case UPDATE_NOT_CHECKED: case UPDATE_NOT_CURRENT: default: $class = 'warning'; - $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning'))); + $icon = theme('image', array('uri' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning'))); break; } diff --git a/themes/seven/template.php b/themes/seven/template.php index 4582749..5f52b96 100644 --- a/themes/seven/template.php +++ b/themes/seven/template.php @@ -88,10 +88,10 @@ function seven_tablesort_indicator($variables) { $style = $variables['style']; $theme_path = drupal_get_path('theme', 'seven'); if ($style == 'asc') { - return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending'))); + return theme('image', array('uri' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending'))); } else { - return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'width' => 13, 'height' => 13, 'title' => t('sort descending'))); + return theme('image', array('uri' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'width' => 13, 'height' => 13, 'title' => t('sort descending'))); } }