[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/project/views/plugins/ -> project_plugin_row_project_node_view.inc (source)

   1  <?php
   2  
   3  /**
   4   * Plugin which performs a node_view on the resulting object.
   5   *
   6   * Most of the code on this object is in the theme function.
   7   *
   8   */
   9  class project_plugin_row_project_node_view extends views_plugin_row {
  10    function option_definition() {
  11      $options = parent::option_definition();
  12  
  13      $options['project_teaser'] = array('default' => TRUE);
  14      if (module_exists('taxonomy')) {
  15        $options['project_term_links'] = array('default' => TRUE);
  16      }
  17      if (module_exists('project_release')) {
  18        $options['project_release_download_table'] = array('default' => TRUE);
  19        $options['project_release_download_link'] = array('default' => TRUE);
  20      }
  21      if (module_exists('project_issue')) {
  22        $options['project_issue_issues_link'] = array('default' => TRUE);
  23      }
  24      return $options;
  25    }
  26  
  27    function options_form(&$form, &$form_state) {
  28      $form['project_teaser'] = array(
  29        '#type' => 'checkbox',
  30        '#title' => t('Display only teaser instead of the full node'),
  31        '#default_value' => $this->options['project_teaser'],
  32      );
  33  
  34      if (module_exists('taxonomy')) {
  35        $form['project_term_links'] = array(
  36          '#type' => 'checkbox',
  37          '#title' => t('Display project type term links'),
  38          '#default_value' => $this->options['project_term_links'],
  39        );
  40      }
  41      if (module_exists('project_release')) {
  42        $form['project_release_download_table'] = array(
  43          '#type' => 'checkbox',
  44          '#title' => t('Display the release download table'),
  45          '#default_value' => $this->options['project_release_download_table'],
  46        );
  47        $form['project_release_download_link'] = array(
  48          '#type' => 'checkbox',
  49          '#title' => t('Display a link to a file download when the version filter is in use'),
  50          '#default_value' => $this->options['project_release_download_link'],
  51        );
  52      }
  53      if (module_exists('project_issue')) {
  54        $form['project_issue_issues_link'] = array(
  55          '#type' => 'checkbox',
  56          '#title' => t('Display a link to issues for the project'),
  57          '#default_value' => $this->options['project_issue_issues_link'],
  58        );
  59      }
  60    }
  61    
  62    /**
  63     * Determine what project type is being viewed and store it
  64     * for use later on in the rendering process.
  65     *
  66     * @param $result
  67     *   The full array of results from the query.
  68     */
  69    function pre_render($result) {
  70      if (!isset($this->view->project->project_type) && isset($this->view->args[0])) {
  71        $this->view->project->project_type = _project_views_get_project_type($this->view->args[0]);
  72      }
  73    }
  74  }
  75  


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