Skip to content
Snippets Groups Projects
Commit 8a05dce6 authored by Angie Byron's avatar Angie Byron
Browse files

#563382 by eMPee584, eojthebrave, drewish: Fixed when editing image style,...

#563382 by eMPee584, eojthebrave, drewish: Fixed when editing image style, link to sample image broken
parent c5156e11
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -792,24 +792,25 @@ function theme_image_style_preview($variables) { ...@@ -792,24 +792,25 @@ function theme_image_style_preview($variables) {
$preview_attributes['style'] = 'width: ' . $preview_width . 'px; height: ' . $preview_height . 'px;'; $preview_attributes['style'] = 'width: ' . $preview_width . 'px; height: ' . $preview_height . 'px;';
// In the previews, timestamps are added to prevent caching of images. // In the previews, timestamps are added to prevent caching of images.
$output = ''; $output = '<div class="image-style-preview preview clearfix">';
$output .= '<div class="image-style-preview preview clearfix">';
// Build the preview of the original image. // Build the preview of the original image.
$original_url = file_create_url($original_path);
$output .= '<div class="preview-image-wrapper">'; $output .= '<div class="preview-image-wrapper">';
$output .= t('original') . ' (' . l(t('view actual size'), $original_path) . ')'; $output .= t('original') . ' (' . l(t('view actual size'), $original_url) . ')';
$output .= '<div class="preview-image original-image" style="' . $original_attributes['style'] . '">'; $output .= '<div class="preview-image original-image" style="' . $original_attributes['style'] . '">';
$output .= '<a href="' . url($original_path) . '?' . time() . '">' . theme('image', array('path' => $original_path . '?' . time(), 'alt' => t('Sample original image'), 'title' => '', 'attributes' => $original_attributes)) . '</a>'; $output .= '<a href="' . $original_url . '">' . theme('image', array('path' => $original_path, 'alt' => t('Sample original image'), 'title' => '', 'attributes' => $original_attributes)) . '</a>';
$output .= '<div class="height" style="height: ' . $original_height . 'px"><span>' . $original_image['height'] . 'px</span></div>'; $output .= '<div class="height" style="height: ' . $original_height . 'px"><span>' . $original_image['height'] . 'px</span></div>';
$output .= '<div class="width" style="width: ' . $original_width . 'px"><span>' . $original_image['width'] . 'px</span></div>'; $output .= '<div class="width" style="width: ' . $original_width . 'px"><span>' . $original_image['width'] . 'px</span></div>';
$output .= '</div>'; // End preview-image. $output .= '</div>'; // End preview-image.
$output .= '</div>'; // End preview-image-wrapper. $output .= '</div>'; // End preview-image-wrapper.
// Build the preview of the image style. // Build the preview of the image style.
$preview_url = file_create_url($preview_file) . '?cache_bypass=' . REQUEST_TIME;
$output .= '<div class="preview-image-wrapper">'; $output .= '<div class="preview-image-wrapper">';
$output .= check_plain($style['name']) . ' (' . l(t('view actual size'), file_create_url($preview_file) . '?' . time()) . ')'; $output .= check_plain($style['name']) . ' (' . l(t('view actual size'), file_create_url($preview_file) . '?' . time()) . ')';
$output .= '<div class="preview-image modified-image" style="' . $preview_attributes['style'] . '">'; $output .= '<div class="preview-image modified-image" style="' . $preview_attributes['style'] . '">';
$output .= '<a href="' . file_create_url($preview_file) . '?' . time() . '">' . theme('image', array('path' => file_create_url($preview_file) . '?' . time(), 'alt' => t('Sample modified image'), 'title' => '', 'attributes' => $preview_attributes)) . '</a>'; $output .= '<a href="' . file_create_url($preview_file) . '?' . time() . '">' . theme('image', array('path' => $preview_url, 'alt' => t('Sample modified image'), 'title' => '', 'attributes' => $preview_attributes)) . '</a>';
$output .= '<div class="height" style="height: ' . $preview_height . 'px"><span>' . $preview_image['height'] . 'px</span></div>'; $output .= '<div class="height" style="height: ' . $preview_height . 'px"><span>' . $preview_image['height'] . 'px</span></div>';
$output .= '<div class="width" style="width: ' . $preview_width . 'px"><span>' . $preview_image['width'] . 'px</span></div>'; $output .= '<div class="width" style="width: ' . $preview_width . 'px"><span>' . $preview_image['width'] . 'px</span></div>';
$output .= '</div>'; // End preview-image. $output .= '</div>'; // End preview-image.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment