reread what I've wrote :(
[squirrelmail.git] / doc / Development / plugin.txt
index d5266cbcd962e4aebee4fc97b1d200e9132e11f7..b5c1bac6b9c7506cf205bd138d588e9616fde25a 100644 (file)
@@ -282,6 +282,8 @@ but may be out of date soon thereafter.  You never know.  ;-)
   error_box                      functions/display_messages.php  concat_hook
   get_pref_override              functions/file_prefs.php        hook_func
   get_pref                       functions/file_prefs.php        hook_func
+& options_identities_process     functions/identity.php          do_hook
+&% options_identities_renumber   functions/identity.php          do_hook
   special_mailbox                functions/imap_mailbox.php      hook_func
 % rename_or_delete_folder        functions/imap_mailbox.php      hook_func
   mailbox_index_before           functions/mailbox_display.php   do_hook
@@ -314,7 +316,8 @@ but may be out of date soon thereafter.  You never know.  ;-)
   left_main_after                src/left_main.php               do_hook
   login_cookie                   src/login.php                   do_hook
   login_top                      src/login.php                   do_hook
-  login_form                     src/login.php                   do_hook
+  login_form                     src/login.php                   concat_hook
+    (was do_hook before 1.5.1)
   login_bottom                   src/login.php                   do_hook
 * optpage_set_loadinfo           src/options.php                 do_hook
 * optpage_loadhook_personal      src/options.php                 do_hook
@@ -339,9 +342,7 @@ but may be out of date soon thereafter.  You never know.  ;-)
 * options_folder_bottom          src/options.php                 do_hook
 * options_order_bottom           src/options.php                 do_hook
 * options_highlight_bottom       src/options_highlight.php       do_hook
-& options_identities_process     src/options_identities.php      do_hook
 & options_identities_top         src/options_identities.php      do_hook
-&% options_identities_renumber   src/options_identities.php      do_hook
 & options_identities_table       src/options_identities.php      concat_hook
 & options_identities_buttons     src/options_identities.php      concat_hook
   message_body                   src/printer_friendly_bottom.php do_hook
@@ -353,7 +354,6 @@ but may be out of date soon thereafter.  You never know.  ;-)
   read_body_bottom               src/read_body.php               do_hook
   login_before                   src/redirect.php                do_hook
   login_verified                 src/redirect.php                do_hook
-  generic_header                 src/right_main.php              do_hook
   right_main_after_header        src/right_main.php              do_hook
   right_main_bottom              src/right_main.php              do_hook
   search_before_form             src/search.php                  do_hook
@@ -393,6 +393,7 @@ options_identities_process
    for each identity or catch any custom submit buttons that you may
    have added to the identities page.  The arguments to this hook are:
 
+    (SquirrelMail 1.4.4 or older and 1.5.0)
       [0] = hook name (always "options_identities_process")
       [1] = should I run the SaveUpdateFunction() (alterable)
 
@@ -400,6 +401,15 @@ options_identities_process
    trigger SaveUpdateFunction() after the hook is finished - by default,
    it will not be called.
 
+    (SquirrelMail 1.4.6+ or 1.5.1+)
+      [0] = hook name (always "options_identities_process")
+      [1] = action (hook is used only in 'update' action and any custom 
+            action added to form with option_identities_table and 
+            option_identities_buttons hooks)
+      [2] = processed identity number
+
+   Hook is not available in SquirrelMail 1.4.5.
+
 options_identities_renumber
 
    This hook is called when one of the identities is being renumbered,
@@ -412,13 +422,17 @@ options_identities_renumber
       [1] = being renumbered from ('default' or 1 through (# idents) - 1)
       [2] = being renumbered to ('default' or 1 through (# idents) - 1)
 
+   Hook is not available in SquirrelMail 1.4.5. Renumbering order differs
+   in 1.4.5+ and 1.5.1+.
+
 options_identities_table
 
    This hook allows you to insert additional rows into the table that
    holds each identity.  The arguments to this hook are:
 
-      [0] = color of table (use it like this in your plugin:
-               <tr bgcolor="<?php echo $info[1]; ?>">
+      [0] = additional html attributes applied to table row.
+            use it like this in your plugin:
+               <tr "<?php echo $args[0]; ?>">
       [1] = is this an empty section (the one at the end of the list)?
       [2] = what is the 'post' value? (ident # or empty string if default)
 
@@ -431,6 +445,10 @@ options_identities_table
               . 'YOUR CODE HERE' . '</td></tr>' . "\n";
       }
 
+   First hook argument was modified in 1.4.5/1.5.1. In SquirrelMail 1.4.1-1.4.4 
+   and 1.5.0 argument contains only background color. You should use 
+   <tr bgcolor="<?php echo $args[0]; ?>"> in these SquirrelMail versions.
+
 options_identities_buttons
 
    This hook allows you to add a button (or other HTML) to the row of
@@ -448,6 +466,16 @@ options_identities_buttons
               . '" value="Press Me" />';
       }
 
+   Input element should use 'smaction[action_name][identity_no]' value in 
+   'name' attribute, if you want to process your button actions in
+   SquirrelMail 1.4.6+ and 1.5.1+ options_identity_process hook.
+
+
+See sample implementation of identity hooks in SquirrelMail demo plugin.
+
+  cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/squirrelmail \
+    co plugins/demo
+
 
 (^) Attachment Hooks
 --------------------