function views_handler_argument::default_actions

Same name in other branches
  1. 7.x-3.x handlers/views_handler_argument.inc \views_handler_argument::default_actions()

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

Override this method to provide additional (or fewer) default behaviors.

10 calls to views_handler_argument::default_actions()
views_handler_argument::default_action in handlers/views_handler_argument.inc
Handle the default action, which means our argument wasn't present.
views_handler_argument::has_default_argument in handlers/views_handler_argument.inc
Determine if the argument is set to provide a default argument.
views_handler_argument::needs_style_plugin in handlers/views_handler_argument.inc
Determine if the argument needs a style plugin.
views_handler_argument::options_form in handlers/views_handler_argument.inc
views_handler_argument::uses_breadcrumb in handlers/views_handler_argument.inc
Determine if the argument can generate a breadcrumb

... See full list

3 methods override views_handler_argument::default_actions()
views_handler_argument_comment_user_uid::default_actions in modules/comment/views_handler_argument_comment_user_uid.inc
Provide a list of default behaviors for this argument if the argument is not present.
views_handler_argument_null::default_actions in handlers/views_handler_argument_null.inc
Override default_actions() to remove actions that don't make sense for a null argument.
views_handler_argument_term_node_tid_depth::default_actions in modules/taxonomy/views_handler_argument_term_node_tid_depth.inc
Override default_actions() to remove summary actions.

File

handlers/views_handler_argument.inc, line 309

Class

views_handler_argument
Base class for arguments.

Code

function default_actions($which = NULL) {
    $defaults = array(
        'ignore' => array(
            'title' => t('Display all values'),
            'method' => 'default_ignore',
            'breadcrumb' => TRUE,
        ),
        'not found' => array(
            'title' => t('Hide view / Page not found (404)'),
            'method' => 'default_not_found',
            'hard fail' => TRUE,
        ),
        'empty' => array(
            'title' => t('Display empty text'),
            'method' => 'default_empty',
            'breadcrumb' => TRUE,
        ),
        'summary asc' => array(
            'title' => t('Summary, sorted ascending'),
            'method' => 'default_summary',
            'method args' => array(
                'asc',
            ),
            'style plugin' => TRUE,
            'breadcrumb' => TRUE,
        ),
        'summary desc' => array(
            'title' => t('Summary, sorted descending'),
            'method' => 'default_summary',
            'method args' => array(
                'desc',
            ),
            'style plugin' => TRUE,
            'breadcrumb' => TRUE,
        ),
        'summary asc by count' => array(
            'title' => t('Summary, sorted by number of records ascending'),
            'method' => 'default_summary',
            'method args' => array(
                'asc',
                'num_records',
            ),
            'style plugin' => TRUE,
            'breadcrumb' => TRUE,
        ),
        'summary desc by count' => array(
            'title' => t('Summary, sorted by number of records descending'),
            'method' => 'default_summary',
            'method args' => array(
                'desc',
                'num_records',
            ),
            'style plugin' => TRUE,
            'breadcrumb' => TRUE,
        ),
        'default' => array(
            'title' => t('Provide default argument'),
            'method' => 'default_default',
            'form method' => 'default_argument_form',
            'has default argument' => TRUE,
            'default only' => TRUE,
        ),
    );
    if ($which) {
        if (!empty($defaults[$which])) {
            return $defaults[$which];
        }
    }
    else {
        return $defaults;
    }
}