Ver código fonte

views integration start, not sure to keep that

Signed-off-by: bachy <git@g-u-i.net>
bachy 13 anos atrás
pai
commit
6ab6fc916b
3 arquivos alterados com 50 adições e 0 exclusões
  1. 17 0
      tode.module
  2. 33 0
      views/tode.views.inc
  3. 0 0
      views/tode_views_handler_parent_filter.inc

+ 17 - 0
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;
 }
+
+

+ 33 - 0
views/tode.views.inc

@@ -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',
+    ),        
+  );    
+}

+ 0 - 0
views/tode_views_handler_parent_filter.inc