You are here

class notifications_views_handler_argument_autocomplete in Notifications 6.2

Same name and namespace in other branches
  1. 7 notifications_views/includes/notifications_views_handler_argument_autocomplete.inc \notifications_views_handler_argument_autocomplete

Argument handler to accept the first part of a string and complete the rest. See views_handler_filter_string.

Hierarchy

Expanded class hierarchy of notifications_views_handler_argument_autocomplete

1 string reference to 'notifications_views_handler_argument_autocomplete'
notifications_views_views_data_alter in notifications_views/notifications_views.module

File

notifications_views/notifications_views_handler_argument_autocomplete.inc, line 5

View source
class notifications_views_handler_argument_autocomplete extends views_handler_argument {
  function query() {
    $this
      ->ensure_my_table();
    $this->query
      ->add_where(0, "{$this->table_alias}.{$this->real_field} LIKE '%s%%'", $this->argument);
  }
  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,
      ),
      '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;
    }
  }
  function option_definition() {
    $options = parent::option_definition();
    $options['wildcard'] = array(
      'default' => '*',
    );
  }

}

Members