hook_advuser implementation

twist3r - February 22, 2009 - 16:35
Project:Advanced User
Version:5.x-2.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

hi,

very nice module, congratulation for the excellent work. I'm currently using you module in my site but I need more filters, so I wrote this tiny patch to let other modules implement a hook_advuser and extend the filters form:

--- sites/all/modules/advuser/advuser_filters.inc.orig  2009-02-22 17:05:04.000000000 +0100
+++ sites/all/modules/advuser/advuser_filters.inc       2009-02-22 17:29:16.000000000 +0100
@@ -180,6 +180,13 @@
       'EN' => 'ends with'")
     ),
   );

+  // invoke advuser API
+  foreach (module_implements('advuser') as $name) {
+    $function = $name.'_advuser';
+    $function($form);
+  }


   return $form;
}

bye,
Maurizio

#1

twist3r - February 22, 2009 - 16:45

ehm.. too much hurry :) disregard previus post, this patch should do the trick!

--- sites/all/modules/advuser/advuser_filters.inc.orig 2009-02-22 17:05:04.000000000 +0100
+++ sites/all/modules/advuser/advuser_filters.inc 2009-02-22 17:44:21.000000000 +0100
@@ -357,6 +357,13 @@
       'autocomplete' => $field->autocomplete ? $field->fid : FALSE,
     );
   }
+
+  // invoke advuser API
+  foreach (module_implements('advuser') as $name) {
+    $function = $name.'_advuser';
+    $function($filters);
+  }
+
   return $filters;
}

 
 

Drupal is a registered trademark of Dries Buytaert.