| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: content_plugin_display_simple.inc,v 1.1.2.5 2010/06/09 04:10:25 karens Exp $ 3 4 /** 5 * @file 6 * Handler for 'content_simple' display. 7 */ 8 class content_plugin_display_simple extends views_plugin_display { 9 function execute() { 10 return $this->view->render($this->display->id); 11 } 12 13 function render() { 14 return !empty($this->view->result) || !empty($this->view->style_plugin->definition['even empty']) ? $this->view->style_plugin->render($this->view->result) : ''; 15 } 16 17 function uses_exposed() { 18 return FALSE; 19 } 20 } 21 22 class content_plugin_display_references extends content_plugin_display_simple { 23 function query() { 24 $options = $this->get_option('content_options'); 25 26 if ($options['string'] !== '') { 27 $like = $GLOBALS["db_type"] == 'pgsql' ? "ILIKE" : "LIKE"; 28 $match_clauses = array( 29 'contains' => "$like '%%%s%%'", 30 'equals' => "= '%s'", 31 'starts_with' => "$like '%s%%'", 32 ); 33 $clause = isset($match_clauses[$options['match']]) ? $match_clauses[$options['match']] : $match_clauses['contains']; 34 $alias = $this->view->query->ensure_table($options['table']); 35 $this->view->query->add_where(NULL, "$alias.$options[field_string] $clause", $options['string']); 36 } 37 elseif ($options['ids']) { 38 $alias = $this->view->query->ensure_table($options['table']); 39 $this->view->query->add_where(NULL, "$alias.$options[field_id] IN (" . db_placeholders($options['ids']) . ')', $options['ids']); 40 } 41 } 42 } 43
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |