diff --git a/tode.module b/tode.module index ffa20d47..943c7540 100644 --- a/tode.module +++ b/tode.module @@ -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; } + + diff --git a/views/tode.views.inc b/views/tode.views.inc new file mode 100644 index 00000000..bd1a6724 --- /dev/null +++ b/views/tode.views.inc @@ -0,0 +1,33 @@ + 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', + ), + ); +} \ No newline at end of file diff --git a/views/tode_views_handler_parent_filter.inc b/views/tode_views_handler_parent_filter.inc new file mode 100644 index 00000000..e69de29b