'hostname', 'title' => t('HttpBL'), 'help' => t("Cache table of IP addresses successfully blocked by HttpBL (and ProjectHoneypot.org)."), 'weight' => -10, ); // Next, describe each of the individual fields in this table to Views. For // each field, you may define what field, sort, argument, and/or filter // handlers it supports. This will determine where in the Views interface you // may use the field. // Hostname field. $data['httpbl']['hostname'] = array( 'title' => t('Hostname'), 'help' => t('Host IP in plain text.'), 'field' => array( 'handler' => 'views_handler_field', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort', ), 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), ); // Status field. $data['httpbl']['status'] = array( 'title' => t('Status'), 'help' => t('Status in a numeric field.'), 'field' => array( 'handler' => 'views_handler_field_numeric', 'click sortable' => TRUE, ), 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), 'sort' => array( 'handler' => 'views_handler_sort', ), ); // Expires timestamp field. $data['httpbl']['expire'] = array( 'title' => t('Expires'), 'help' => t('Expiration date for this item in a timestamp field.'), 'field' => array( 'handler' => 'views_handler_field_date', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_date', ), 'filter' => array( 'handler' => 'views_handler_filter_date', ), ); return $data; } /** * Implementation of hook_views_handlers(). */ function httpbl_views_handlers() { return array( 'info' => array( 'path' => drupal_get_path('module', 'httpbl') . '/includes/views/handlers', ), 'handlers' => array( // argument handlers 'httpbl_handler_argument' => array( 'parent' => 'views_handler_argument', ), 'httpbl_handler_argument_string' => array( 'parent' => 'views_handler_argument_string', ), 'httpbl_handler_argument_numeric' => array( 'parent' => 'views_handler_argument_numeric', ), 'httpbl_handler_argument_reference' => array( 'parent' => 'httpbl_handler_argument_numeric', ), 'httpbl_handler_argument_many_to_one' => array( 'parent' => 'views_handler_argument_many_to_one', ), // field handlers 'httpbl_handler_field' => array( 'parent' => 'views_handler_field_node', ), 'httpbl_handler_field_multiple' => array( 'parent' => 'httpbl_handler_field', ), // filter handlers 'httpbl_handler_filter_string' => array( 'parent' => 'views_handler_filter_string', ), 'httpbl_handler_filter_numeric' => array( 'parent' => 'views_handler_filter_numeric', ), 'httpbl_handler_filter_float' => array( 'parent' => 'views_handler_filter_float', ), 'httpbl_handler_filter_many_to_one' => array( 'parent' => 'views_handler_filter_many_to_one', ), // relationship handlers 'httpbl_handler_relationship' => array( 'parent' => 'views_handler_relationship', ), // sort handlers 'httpbl_handler_sort' => array( 'parent' => 'views_handler_sort', ), ), ); }