-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwurfl_imagecache.api.php
More file actions
65 lines (61 loc) · 1.97 KB
/
wurfl_imagecache.api.php
File metadata and controls
65 lines (61 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
// $Id: wurfl_imagecache.api.php,v 1.2 2009/02/17 21:36:18 drewish Exp $
/**
* @file
* Hooks provided by the wurfl_ImageCache module.
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Inform wurfl_ImageCache about actions that can be performed on an image.
*
* @return array
* An array of information on the actions implemented by a module. The array
* contains a sub-array for each action node type, with the machine-readable
* action name as the key. Each sub-array has up to 3 attributes. Possible
* attributes:
* "name": the human-readable name of the action. Required.
* "description": a brief description of the action. Required.
* "file": the name of the include file the action can be found
* in relative to the implementing module's path.
*/
function hook_wurfl_imagecache_actions() {
$actions = array(
'wurfl_imagecache_resize' => array(
'name' => 'Resize',
'description' => 'Resize an image to an exact set of dimensions, ignoring aspect ratio.',
),
);
}
/**
* Provides default wurfl_ImageCache presets that can be overridden by site
* administrators.
*
* @return array
* An array of wurfl_imagecache preset definitions. Each definition can be
* generated by exporting a preset from the database. Each preset
* definition should be keyed on its presetname (for easier interaction
* with drupal_alter) and have the following attributes:
* "presetname": the wurfl_imagecache preset name. Required.
* "actions": an array of action defintions for this preset. Required.
*/
function hook_wurfl_imagecache_default_presets() {
$presets = array();
$presets['thumbnail'] = array (
'presetname' => 'thumbnail',
'actions' => array (
0 => array (
'weight' => '0',
'module' => 'wurfl_imagecache',
'action' => 'wurfl_imagecache_scale_and_crop',
'data' => array (
'width' => '60',
'height' => '60',
),
),
),
);
return $presets;
}