| 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. |
| 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 |
/** |
/** |
| 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 |
| 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']; |
| 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); |
| 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 |
} |
} |