You are here

class activity_views_handler_argument_access in Activity 6.2

@file Argument handler for access control.

Hierarchy

Expanded class hierarchy of activity_views_handler_argument_access

1 string reference to 'activity_views_handler_argument_access'
activity_views_data in views/activity.views.inc
Implementation of hook_views_data().

File

views/activity_views_handler_argument_access.inc, line 7
Argument handler for access control.

View source
class activity_views_handler_argument_access extends views_handler_argument {
  function option_definition() {
    $options = parent::option_definition();
    $options['realm'] = array(
      'default' => '',
    );
    return $options;
  }

  /**
   * Override the options_form().
   */
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $info = activity_get_module_info($this->definition['module']);
    $realms = $info->realms;
    $options = array();
    foreach ($realms as $realm => $title) {
      $options[$realm] = t($title);
    }
    $form['realm'] = array(
      '#type' => 'radios',
      '#title' => t('Specific Relationship'),
      '#options' => $options,
      '#default_value' => $this->options['realm'],
      '#required' => TRUE,
    );
  }
  function query() {
    $this
      ->ensure_my_table();
    $realm = $this->options['realm'];
    $this->query
      ->add_where(NULL, "({$this->table_alias}.realm='%s' AND {$this->table_alias}.{$this->real_field} = %d)", $this->options['realm'], $this->argument);
  }

}

Members