? flag_page-1017484.patch
Index: flag_page.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag_page/flag_page.module,v
retrieving revision 1.1.4.1
diff -u -p -r1.1.4.1 flag_page.module
--- flag_page.module	6 Oct 2010 15:03:44 -0000	1.1.4.1
+++ flag_page.module	7 Jan 2011 09:35:05 -0000
@@ -121,6 +121,16 @@ function flag_create_lazy_page_link($fla
 }
 
 function flag_page_flag_link($flag, $action, $content_id) {
+	
+  // If link_type is  being provided other modules , call hook_flag_link of the corresponding module and return the link
+  $link_types = flag_get_link_types();
+  if (isset($flag->link_type) && isset($link_types[$flag->link_type])) {
+     $link_object = $link_types[$flag->link_type];
+     $flag_link = module_invoke($link_types[$flag->link_type]['module'], 'flag_link',$flag, $action, $content_id);
+     if (isset($flag_link['href'])) return $flag_link;
+  }
+
+  // When other modules donot provide any custom menu callbacks
   $title = isset($_GET['title']) ? $_GET['title'] : drupal_get_title();
   $token = flag_get_token($content_id);
 
