/[drupal]/contributions/modules/views/includes/view.inc
ViewVC logotype

Diff of /contributions/modules/views/includes/view.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.151.2.16 by merlinofchaos, Mon Nov 2 23:34:26 2009 UTC revision 1.151.2.17 by merlinofchaos, Tue Nov 10 23:20:05 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: view.inc,v 1.151.2.15 2009/09/15 21:34:25 merlinofchaos Exp $  // $Id: view.inc,v 1.151.2.16 2009/11/02 23:34:26 merlinofchaos Exp $
3  /**  /**
4   * @file view.inc   * @file view.inc
5   * Provides the view object type and associated methods.   * Provides the view object type and associated methods.
# Line 51  class view extends views_db_object { Line 51  class view extends views_db_object {
51    
52    // Used to store views that were previously running if we recurse.    // Used to store views that were previously running if we recurse.
53    var $old_view = array();    var $old_view = array();
54    
55      // Where the $query object will reside:
56      var $query = NULL;
57    /**    /**
58     * Constructor     * Constructor
59     */     */
60    function view() {    function __construct() {
61      parent::init();      parent::init();
62      // Make sure all of our sub objects are arrays.      // Make sure all of our sub objects are arrays.
63      foreach ($this->db_objects() as $object) {      foreach ($this->db_objects() as $object) {
64        $this->$object = array();        $this->$object = array();
65      }      }
   
     $this->query = new stdClass();  
66    }    }
67    
68    /**    /**
# Line 474  class view extends views_db_object { Line 475  class view extends views_db_object {
475          }          }
476          else {          else {
477            $arg_title = $argument->get_title();            $arg_title = $argument->get_title();
478            $argument->query();            $argument->query($this->display_handler->use_group_by());
479          }          }
480    
481          // Add this argument's substitution          // Add this argument's substitution
# Line 525  class view extends views_db_object { Line 526  class view extends views_db_object {
526     * Do some common building initialization.     * Do some common building initialization.
527     */     */
528    function init_query() {    function init_query() {
529        if (!empty($this->query)) {
530          $class = get_class($this->query);
531          if ($class && $class != 'stdClass') {
532            // return if query is already initialized.
533            return;
534          }
535        }
536    
537      // Create and initialize the query object.      // Create and initialize the query object.
538      $views_data = views_fetch_data($this->base_table);      $views_data = views_fetch_data($this->base_table);
539      $this->base_field = $views_data['table']['base']['field'];      $this->base_field = $views_data['table']['base']['field'];
# Line 629  class view extends views_db_object { Line 638  class view extends views_db_object {
638      }      }
639    
640      // Allow display handler to affect the query:      // Allow display handler to affect the query:
641      $this->display_handler->query();      $this->display_handler->query($this->display_handler->use_group_by());
642    
643      // Allow style handler to affect the query:      // Allow style handler to affect the query:
644      $this->style_plugin->query();      $this->style_plugin->query($this->display_handler->use_group_by());
645    
646      if (variable_get('views_sql_signature', FALSE)) {      if (variable_get('views_sql_signature', FALSE)) {
647        $this->query->add_signature($this);        $this->query->add_signature($this);
# Line 668  class view extends views_db_object { Line 677  class view extends views_db_object {
677            }            }
678          }          }
679          $handlers[$id]->set_relationship();          $handlers[$id]->set_relationship();
680          $handlers[$id]->query();          $handlers[$id]->query($this->display_handler->use_group_by());
681        }        }
682      }      }
683    }    }

Legend:
Removed from v.1.151.2.16  
changed lines
  Added in v.1.151.2.17

  ViewVC Help
Powered by ViewVC 1.1.3