Commit 9b29e143 authored by Dries's avatar Dries

- Patch #523544 by c960657: image module clean-up.

parent 53e31e6d
......@@ -29,7 +29,14 @@ function image_menu() {
function image_theme() {
return array(
'image_style' => array(
'arguments' => array('style' => NULL, 'path' => NULL, 'alt' => '', 'title' => '', 'attributes' => array(), 'getsize' => TRUE),
'arguments' => array(
'style' => NULL,
'path' => NULL,
'alt' => '',
'title' => '',
'attributes' => array(),
'getsize' => TRUE,
),
),
);
}
......@@ -449,11 +456,11 @@ function image_style_generate_url($style_name, $path) {
// Disable page cache for this request. This prevents anonymous users from
// needlessly hitting the image generation URL when the image already exists.
$GLOBALS['conf']['cache'] = CACHE_DISABLED;
drupal_page_is_cacheable(FALSE);
// Set a cache entry to grant access to this style/image path. This will be
// checked by image_style_generate().
cache_set('access:' . $style_name . ':' . md5($path), 1, 'cache_image', time() + 600);
cache_set('access:' . $style_name . ':' . md5($path), 1, 'cache_image', REQUEST_TIME + 600);
// Generate a callback path for the image.
$url = url('image/generate/' . $style_name . '/' . $path, array('absolute' => TRUE));
......@@ -636,7 +643,7 @@ function image_effect_delete($effect) {
* @return
* TRUE on success. FALSE if unable to perform effect on image.
*/
function image_effect_apply(&$image, $effect) {
function image_effect_apply($image, $effect) {
if (drupal_function_exists($effect['effect callback'])) {
return call_user_func($effect['effect callback'], $image, $effect['data']);
}
......
......@@ -35,11 +35,11 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
protected $image_with_generated;
protected $image_without_generated;
function getInfo() {
public static function getInfo() {
return array(
'name' => t('Image styles path and URL functions'),
'description' => t('Tests functions for generating paths and URLs to image styles.'),
'group' => t('Image')
'name' => 'Image styles path and URL functions',
'description' => 'Tests functions for generating paths and URLs to image styles.',
'group' => 'Image',
);
}
......@@ -108,11 +108,11 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
* properly passing parameters to the image toolkit.
*/
class ImageEffectsUnitTest extends ImageToolkitTestCase {
function getInfo() {
public static function getInfo() {
return array(
'name' => t('Image effects'),
'description' => t('Test that the image effects pass parameters to the toolkit correctly.'),
'group' => t('Image')
'name' => 'Image effects',
'description' => 'Test that the image effects pass parameters to the toolkit correctly.',
'group' => 'Image',
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment