You are here

function hook_styles_containers in Styles 7

Same name and namespace in other branches
  1. 6.2 includes/styles.api.php \hook_styles_containers()
  2. 6 includes/styles.api.php \hook_styles_containers()
  3. 7.2 includes/styles.api.php \hook_styles_containers()

Define information about style containers provided by a module.

This hook enables modules to define style containers provided by this module.

Return value

An array of available style containers.Each container is defined as an array keyed by the field type, each containing an associative array keyed on a machine-readable style container name, with the following items:

  • "label": The human-readable name of the effect.
  • "data": An array of data that each container might require.
  • "preview theme": (optional) A theme function to call when previewing a style during administration.
  • "help": (optional) A brief description of the style container that will be displayed to the administrator when configuring styles.
1 function implements hook_styles_containers()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

file_styles_styles_containers in contrib/file_styles/file_styles.module
Implements hook_styles_containers().
1 invocation of hook_styles_containers()
styles_containers in ./styles.module
Get an array of all defined style containers.

File

./styles.api.php, line 29
Hooks available for modules to implement Styles functionality.

Code

function hook_styles_containers() {
  return array(
    'media' => array(
      'image' => array(
        'label' => t('Image Styles'),
        'data' => array(
          'streams' => array(
            'public://',
            'private://',
          ),
          'mimetypes' => array(
            'image/png',
            'image/gif',
            'image/jpeg',
          ),
        ),
        'preview theme' => 'media_styles_image_style_preview',
        'help' => t('Image Styles will transform images to your choosing, such as by scaling and cropping. You can !manage.', array(
          '!manage' => l(t('manage your image styles here'), 'admin/config/image/image-styles'),
        )),
      ),
    ),
  );
}