adding two hooks that allow integrating third party address book backends
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 31 Mar 2004 15:10:32 +0000 (15:10 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 31 Mar 2004 15:10:32 +0000 (15:10 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6982 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
doc/plugin.txt
functions/addressbook.php

index 124a090..d720764 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@ Version 1.5.1 -- CVS
   - Add functions for building HTML forms (functions/forms.php).
   - Moved javascript_on to session (from prefs). Centralized javascript detection
     in prefs.php method checkForJavascript.
   - Add functions for building HTML forms (functions/forms.php).
   - Moved javascript_on to session (from prefs). Centralized javascript detection
     in prefs.php method checkForJavascript.
+  - Added abook_init and abook_add_class hooks
 
 Version 1.5.0
 --------------------
 
 Version 1.5.0
 --------------------
index 9f5f9a7..1536889 100644 (file)
@@ -233,6 +233,8 @@ but may be out of date soon thereafter.  You never know.  ;-)
 
   Hook Name                      Found In                        Called With(#)
   ---------                      --------                        --------------
 
   Hook Name                      Found In                        Called With(#)
   ---------                      --------                        --------------
+  abook_init                     functions/addressbook.php       do_hook
+  abook_add_class                functions/addressbook.php       do_hook
   loading_constants              functions/constants.php         do_hook
   logout_error                   functions/display_messages.php  do_hook
   error_box                      functions/display_messages.php  concat_hook
   loading_constants              functions/constants.php         do_hook
   logout_error                   functions/display_messages.php  do_hook
   error_box                      functions/display_messages.php  concat_hook
@@ -1092,10 +1094,10 @@ files.
 
          # Copyright (c) 1999-2003 The Squirrelmail Development Team
          # Roland Bauerschmidt <rb@debian.org>, 1999.
 
          # Copyright (c) 1999-2003 The Squirrelmail Development Team
          # Roland Bauerschmidt <rb@debian.org>, 1999.
+         # $Id$
          msgid ""
          msgstr ""
          msgid ""
          msgstr ""
-         "Project-Id-Version: $Id: squirrelmail.po,v 1.10 2003/06/04 15:01:59
-         philippe_mingo Exp $\n"
+         "Project-Id-Version: plugin-name version\n"
          "POT-Creation-Date: 2003-01-21 19:21+0100\n"
          "PO-Revision-Date: 2003-01-21 21:01+0100\n"
          "Last-Translator: Juergen Edner <juergen.edner@epost.de>\n"
          "POT-Creation-Date: 2003-01-21 19:21+0100\n"
          "PO-Revision-Date: 2003-01-21 21:01+0100\n"
          "Last-Translator: Juergen Edner <juergen.edner@epost.de>\n"
index f5e6351..0174f1a 100644 (file)
@@ -97,6 +97,15 @@ function addressbook_init($showerr = true, $onlylocal = false) {
                                     'table' => $addrbook_global_table));
     }
 
                                     'table' => $addrbook_global_table));
     }
 
+    /*
+     * hook allows to include different address book backends.
+     * plugins should extract $abook and $r from arguments
+     * and use same add_backend commands as above functions.
+     */
+    $hookReturn = do_hook('abook_init', $abook, $r);
+    $abook = $hookReturn[1];
+    $r = $hookReturn[2];
+    
     if ($onlylocal) {
         return $abook;
     }
     if ($onlylocal) {
         return $abook;
     }
@@ -568,5 +577,12 @@ if((isset($addrbook_dsn) && !empty($addrbook_dsn)) ||
   include_once(SM_PATH . 'functions/abook_database.php');
 }
 
   include_once(SM_PATH . 'functions/abook_database.php');
 }
 
+/*
+ * hook allows adding different address book classes.
+ * class must follow address book class coding standards.
+ *
+ * see addressbook_backend class and functions/abook_*.php files.
+ */
+do_hook('abook_add_class');
 
 ?>
 
 ?>