Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
8e93aade
Commit
8e93aade
authored
Sep 11, 2010
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#875326
by effulgentsia: add hook_image_effect_info_alter().
parent
dde18582
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
modules/image/image.api.php
modules/image/image.api.php
+16
-0
modules/image/image.module
modules/image/image.module
+1
-0
No files found.
modules/image/image.api.php
View file @
8e93aade
...
...
@@ -29,6 +29,8 @@
* $form array providing a configuration form for this image effect.
* - "summary theme": (optional) The name of a theme function that will output
* a summary of this image effect's configuration.
*
* @see hook_image_effect_info_alter()
*/
function
hook_image_effect_info
()
{
$effects
=
array
();
...
...
@@ -44,6 +46,20 @@ function hook_image_effect_info() {
return
$effects
;
}
/**
* Alter the information provided in hook_image_effect_info().
*
* @param $effects
* The array of image effects, keyed on the machine-readable effect name.
*
* @see hook_image_effect_info()
*/
function
hook_image_effect_info_alter
(
&
$effects
)
{
// Override the Image module's crop effect with more options.
$effect
[
'image_crop'
][
'effect callback'
]
=
'mymodule_crop_effect'
;
$effect
[
'image_crop'
][
'form callback'
]
=
'mymodule_crop_form'
;
}
/**
* Respond to image style updating.
*
...
...
modules/image/image.module
View file @
8e93aade
...
...
@@ -912,6 +912,7 @@ function image_effect_definitions() {
}
}
uasort
(
$effects
,
'_image_effect_definitions_sort'
);
drupal_alter
(
'image_effect_info'
,
$effects
);
cache_set
(
"image_effects:
$langcode
"
,
$effects
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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