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

Contents of /contributions/modules/viewfield/includes/viewfield.views.inc

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


Revision 1.1 - (show annotations) (download) (as text)
Tue Apr 7 18:42:31 2009 UTC (7 months, 2 weeks ago) by darrenoh
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
by Darren Oh: Reverted previous commit.
  Arguments would not display on the field settings page when force default was
  on.
#386430 by Darren: Reverted patch.
  Patch prevented nodes from overriding default values.
by Darren Oh: Organized code and fixed coding standards compliance.
by Darren Oh: Fixed more error notices.
by Darren Oh: Added translation template.
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Views functions.
7 */
8
9 /**
10 * Implementation of hook_views_query_alter().
11 *
12 * Prevent views from loading the node containing the view.
13 */
14 function viewfield_views_query_alter(&$view, &$query) {
15 global $_viewfield_stack;
16 if ((!empty($_viewfield_stack)) && (in_array('node', $query->table_queue))) {
17 $placeholders = array_fill(0, count($_viewfield_stack), '%d');
18 $query->add_where(0, 'node.nid NOT IN ('. implode(',', $placeholders) .')', $_viewfield_stack);
19 }
20 }

  ViewVC Help
Powered by ViewVC 1.1.2