/[drupal]/contributions/modules/imagecache/imagecache.api.php
ViewVC logotype

Contents of /contributions/modules/imagecache/imagecache.api.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Tue Feb 17 21:36:18 2009 UTC (9 months, 1 week ago) by drewish
Branch: MAIN
CVS Tags: DRUPAL-6--2-0-BETA8, DRUPAL-6--2-0-BETA9, DRUPAL-6--2-0-BETA10, DRUPAL-6--2-0-BETA7, HEAD
Branch point for: DRUPAL-6--2
Changes since 1.1: +32 -1 lines
File MIME type: text/x-php
#255421 by yhahn: Import/export ImageCache presets.
1 <?php
2 // $Id: imagecache.api.php,v 1.1 2009/02/07 19:33:22 drewish Exp $
3
4 /**
5 * @file
6 * Hooks provided by the ImageCache module.
7 */
8
9 /**
10 * @addtogroup hooks
11 * @{
12 */
13
14 /**
15 * Inform ImageCache about actions that can be performed on an image.
16 *
17 * @return array
18 * An array of information on the actions implemented by a module. The array
19 * contains a sub-array for each action node type, with the machine-readable
20 * action name as the key. Each sub-array has up to 3 attributes. Possible
21 * attributes:
22 * "name": the human-readable name of the action. Required.
23 * "description": a brief description of the action. Required.
24 * "file": the name of the include file the action can be found
25 * in relative to the implementing module's path.
26 */
27 function hook_imagecache_actions() {
28 $actions = array(
29 'imagecache_resize' => array(
30 'name' => 'Resize',
31 'description' => 'Resize an image to an exact set of dimensions, ignoring aspect ratio.',
32 ),
33 );
34 }
35
36 /**
37 * Provides default ImageCache presets that can be overridden by site
38 * administrators.
39 *
40 * @return array
41 * An array of imagecache preset definitions. Each definition can be
42 * generated by exporting a preset from the database. Each preset
43 * definition should be keyed on its presetname (for easier interaction
44 * with drupal_alter) and have the following attributes:
45 * "presetname": the imagecache preset name. Required.
46 * "actions": an array of action defintions for this preset. Required.
47 */
48 function hook_imagecache_default_presets() {
49 $presets = array();
50 $presets['thumbnail'] = array (
51 'presetname' => 'thumbnail',
52 'actions' => array (
53 0 => array (
54 'weight' => '0',
55 'module' => 'imagecache',
56 'action' => 'imagecache_scale_and_crop',
57 'data' => array (
58 'width' => '60',
59 'height' => '60',
60 ),
61 ),
62 ),
63 );
64 return $presets;
65 }

  ViewVC Help
Powered by ViewVC 1.1.2