[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/project_issue/views/ -> project_issue.views_default.inc (source)

   1  <?php
   2  // $Id: project_issue.views_default.inc,v 1.48 2009/09/23 00:21:36 dww Exp $
   3  
   4  
   5  /**
   6   * @file
   7   * Provides default views on behalf of the project_issue module.
   8   */
   9  
  10  /**
  11   * Implementation of hook_views_default_views().
  12   */
  13  function project_issue_views_default_views() {
  14    // Search the "default_views" directory for files ending in .view.php.
  15    $files = file_scan_directory(drupal_get_path('module', 'project_issue'). '/views/default_views', 'view.php');
  16    foreach ($files as $absolute => $file) {
  17      require_once $absolute;
  18      if (isset($view)) {
  19        // $file->name has the ".php" stripped off, but still has the ".view".
  20        $view_name = substr($file->name, 0, strrpos($file->name, '.'));
  21        $views[$view_name] = $view;
  22      }
  23    }
  24    return $views;
  25  }
  26  
  27  /**
  28   * Add exposed filters for every taxonomy vocabulary for project_issue nodes.
  29   *
  30   * This is a helper function used by a few of the default view definitions.
  31   */
  32  function _project_issue_views_add_taxonomy_filters(&$filters) {
  33    if (!module_exists('taxonomy')) {
  34      return;
  35    }
  36    $issue_vocabularies = taxonomy_get_vocabularies('project_issue');
  37    $i = 0;
  38    foreach ($issue_vocabularies as $vid => $vocab) {
  39      $view_key = 'tid';
  40      if ($i) {
  41        $view_key .= "_$i";
  42      }
  43      $i++;
  44      $identifier = project_issue_views_filter_identifier($vocab->name);
  45      $filters[$view_key] = array(
  46        'operator' => 'or',
  47        'value' => '',
  48        'group' => '0',
  49        'exposed' => TRUE,
  50        'expose' => array(
  51          'use_operator' => 1,
  52          'operator' => $identifier . '_op',
  53          'identifier' => $identifier,
  54          'label' => check_plain($vocab->name),
  55          'optional' => 1,
  56          'single' => 1,
  57          'remember' => 0,
  58        ),
  59        'type' => 'textfield',
  60        'vid' => $vid,
  61        'id' => 'tid',
  62        'table' => 'term_node',
  63        'field' => 'tid',
  64        'hierarchy' => 0,
  65        'relationship' => 'none',
  66        'reduce_duplicates' => 1,
  67      );
  68    }
  69  }
  70  


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7