Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
9b29e143
Commit
9b29e143
authored
Jul 19, 2009
by
Dries Buytaert
Browse files
- Patch
#523544
by c960657: image module clean-up.
parent
53e31e6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/image/image.module
View file @
9b29e143
...
...
@@ -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'
]);
}
...
...
modules/image/image.test
View file @
9b29e143
...
...
@@ -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'
,
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment