You are here

function image_handler_argument_image_node_image_size::default_actions in Image 7

Same name and namespace in other branches
  1. 6 views/image_handler_argument_image_node_image_size.inc \image_handler_argument_image_node_image_size::default_actions()

Provide a list of default behaviors for this argument if the argument is not present.

Override the parent method to provide only the behaviours that make sense.

Overrides views_handler_argument::default_actions

File

views/image_handler_argument_image_node_image_size.inc, line 29
Provide an argument to set the image size of an Image node image field.

Class

image_handler_argument_image_node_image_size
@file

Code

function default_actions($which = NULL) {
  $defaults = array(
    'ignore' => array(
      'title' => t('Ignore and use the field setting'),
      'method' => 'default_ignore',
      // generate a breadcrumb to here
      'breadcrumb' => TRUE,
    ),
    'not found' => array(
      'title' => t('Hide view / Page not found (404)'),
      'method' => 'default_not_found',
      // This is a hard fail condition.
      'hard fail' => TRUE,
    ),
    'empty' => array(
      'title' => t('Display empty text'),
      'method' => 'default_empty',
      // generate a breadcrumb to here
      'breadcrumb' => TRUE,
    ),
    'default' => array(
      'title' => t('Provide default argument'),
      'method' => 'default_default',
      'form method' => 'default_argument_form',
      'has default argument' => TRUE,
      // this can only be used for missing argument, not validation failure
      'default only' => TRUE,
    ),
  );
  if ($which) {
    if (!empty($defaults[$which])) {
      return $defaults[$which];
    }
  }
  else {
    return $defaults;
  }
}