views integration start, not sure to keep that

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy 2012-02-07 19:46:12 +01:00
parent fbaa166db8
commit 6ab6fc916b
3 changed files with 50 additions and 0 deletions

View File

@ -33,6 +33,21 @@ function tode_menu() {
}
*/
/**
* Implements hook_views_api().
*/
/*
TODO hook_views_api().
*/
// function tode_views_api() {
// return array(
// 'api' => 3,
// 'path' => drupal_get_path('module', 'tode') . '/views',
// );
// }
/**
* Implementation of hook_theme().
*/
@ -727,3 +742,5 @@ function _tode_get_tode_fields_def($node){
return $tode_fields;
}

33
views/tode.views.inc Normal file
View File

@ -0,0 +1,33 @@
<?php
/**
* Implements hook_views_data().
*/
// function tode_views_data() {
// // Code goes here. See example at http://views.doc.logrus.com/group__views__hooks.html#g227057901681e4a33e33c199c7a8c989
//
// $data['node']['tode_parent'] = array(
// 'group' => t('tode'),
// 'title' => t('Tode'),
// 'help' => t('Filtrer with tode parent term.'), // The help that appears on the UI,
// // 'real field' => 'field_pv_value',
// 'filter' => array(
// 'handler' => 'tode_views_handler_parent_filter',
// ),
// );
//
// }
function tode_views_data_alter(&$data) {
$data['tid']['tode_parent'] = array(
'title' => t('Tode parent'),
'group' => 'Tode',
'help' => t('Parent term of tode field'),
'real field' => 'field_tode_program',
'filter' => array(
'handler' => 'tode_views_handler_parent_filter',
),
);
}