| 1 |
<?php
|
| 2 |
// $Id: ad_views.module,v 1.8 2009/07/06 13:46:43 milesgillham Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Integrate the Views module with:
|
| 7 |
* Ad Module (ad)
|
| 8 |
*/
|
| 9 |
|
| 10 |
/*
|
| 11 |
* Implements hook_views_api()
|
| 12 |
*/
|
| 13 |
|
| 14 |
function ad_views_views_api() {
|
| 15 |
return array('api' => 2);
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Theme preprocess function for ad-views-view-row-ad.tpl.php
|
| 20 |
*/
|
| 21 |
function template_preprocess_ad_views_view_row_ad(&$vars) {
|
| 22 |
// Offload to ad module for rendering, using preferred display method
|
| 23 |
$vars['content'] = ad(NULL, 1, array('nids' => $vars['row']->aid, 'ad_display' => $vars['options']['ad_display']));
|
| 24 |
}
|
| 25 |
|