]> gitweb.fluxo.info Git - drupal/calendario.git/commitdiff
Implementing calendario_taxonomy_term_uri()
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 8 Aug 2012 23:30:15 +0000 (20:30 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 8 Aug 2012 23:30:15 +0000 (20:30 -0300)
calendario.module

index 95038cf93fab5194194391a68351bef88b951aec..aa33dfd5e36afbdff9b06b7c7b9632d98533f9a3 100644 (file)
@@ -19,17 +19,9 @@ function calendario_theme($existing, $type, $theme, $path) {
 
 /**
  * Implements hook_entity_info_alter()
- *
- * @todo
- *   Change 'uri callback' from taxonomy terms to point to calendars.
  */
 function calendario_entity_info_alter(&$entity_info) {
-  // Set the controller class for nodes to an alternate implementation of the
-  // DrupalEntityController interface.
-  /*
-   *$entity_info['node']['controller class'] = 'MyCustomNodeController';
-   */
-  /* Your code here */
+  $entity_info['taxonomy_term']['uri callback'] = 'calendario_taxonomy_term_uri';
 }
 
 /**
@@ -76,3 +68,12 @@ function calendario_views_post_render(&$view, &$output, &$cache) {
     $output .= calendario_widget($view);
   }
 }
+
+/**
+ * Entity uri callback.
+ */
+function calendario_taxonomy_term_uri($term) {
+  return array(
+    'path' => 'taxonomy/term/' . $term->tid,
+  );
+}