You are here

function dna_handler_arg_realm in Devel 5

1 string reference to 'dna_handler_arg_realm'
devel_node_access_views_arguments in ./devel_node_access.module

File

./devel_node_access.module, line 581
This module gives developers feedback as to what their node_access table contains, and which nodes are protected or visible to the public.

Code

function dna_handler_arg_realm($op, &$query, $argtype, $arg = '') {
  switch ($op) {
    case 'summary':
      $query
        ->ensure_table('node_access', true);
      $query
        ->add_field('realm', 'node_access');
      $fieldinfo['field'] = 'realm';
      $query
        ->add_orderby('node_access', 'realm', 'ASC');
      return $fieldinfo;
      break;
    case 'filter':
      $query
        ->ensure_table('node_access');
      if ($arg == 'NULL') {
        $query
          ->add_where("node_access.realm IS NULL");
      }
      else {
        $query
          ->add_where("node_access.realm = '{$arg}'");
      }
      break;
    case 'link':
      if ($query->realm) {
        return l($query->realm, "{$arg}/{$query->realm}");
      }
      else {
        return l('NULL', "{$arg}/NULL");
      }
      break;
    case 'title':
      return $query;
      break;
  }
}