Mail Utilities - Version 0.2
=============================

This plugin is intended to create a sub-menu for those
Utilities that need their own page (like Bug, and Fetch),
so that the menu bar doesn't get too crowded.

It is a simple plugin that will only be useful if other
plugin developers use it (or if to hack the other
plugins as outlined below).

Suggestions (recommendations, corrections) welcome.

Erin Schnabel
sizzle@haaser.com


Installation notes:
====================

As with other plugins, just uncompress the archive in the plugins
directory, go back to the main directory, run configure and add the plugin.

config.php contains settings to turn included sample plugins on (1) or off (0).


Plugin Usage notes:
===================
The Mail Utilities plugin is only useful if exploited by
other plugins, preferably more than one. ;-)

To use this plugin, add the following to setup.php:

1. Initialization (squirrelmail_plugin_init)

In the squirrelmail_plugin_init method (in setup.php), add
the following to include a link in the Utilities sub-menu.
If the utilities plugin doesn't exist, put it on the menuline
(or in Options) as before.

    function squirrelmail_plugin_init_plugin_name() {
        ...
       global $plugins;
       if ( in_array('mail_utilities', $plugins ) ) {
          include_once(SM_PATH . 'plugins/mail_utilities/functions.php');

          // This one is required - adds a link to the Utilities menu
          mail_utilities_add_menu_hook('plugin_name','plugin_name_link_function');

          // This one is optional. If you have a shortcut kind of function,
          // i.e. if they can select something before going to the page,
          // or if they can enter initial search terms, etc. You can add this.
          // The Shortcut Title will appear in a section header that is
          // drawn for you.
          mail_utilities_add_shortcut('plugin_name',
                                      'Shortcut Title',
                                      'plugin_name_shortcut_function');

        } else {
           global $squirrelmail_plugin_hooks;
           $squirrelmail_plugin_hooks['menuline']['plugin_name'] = 'plugin_name_link';
        }
         ...
    }

   /*
    * note this is the same function for the menuline or the Mail
    * Utilities link..
    */
    function plugin_name_link_function() {
        displayInternalLink('plugins/plugin_name/target.php', _("Link name"), '');
        echo '&nbsp;&nbsp;';
    }

   /*
    * This function provides a shortcut to the main page. It
    * could be an initial form (a selection box), or some
    * other initial link or action. Think of this as a one-liner..
    * the shortcut should be short, and it should lead to the plugin's
    * more informative main page.
    *
    * Shortcuts will be displayed within a table that spans (most)
    * of the width of the page.
    */
    function plugin_name_shortcut_function() {

    }

2. Use in a separate plugin page:

After your plugin is registered as a hook with Mail utilities,
add the following to your target page (target.php in example above) just
after the call to displayPageHeader:

    global $plugins;
    if ( in_array('mail_utilities', $plugins) ) {
        include_once(SM_PATH . 'plugins/mail_utilities/functions.php');
        mail_utilities_display_menubar($color);
    }

It is important to pass the global $color to
mail_utilities_display_menubar(..).

That's it.

Plugins that can exploit utilities:
  Mailbox Import      (mbox_import)
  Add Virtual Users   (add_mysqluser)


Change Log:
=================

Version 0.3 2003/01/27 ebullient@haaser.com
Use SM_PATH For 1.3.x/1.4 compatibility.

Version 0.2 2002/09/08 sizzle@haaser.com
Housekeeping updates
register_globals=off updates.
Due to recent changes in the dev stream, 
this version of the plugin won't work with 1.3.2 CVS..
(I'll get to it.. <sighs>)

Version 0.1 2002/08/20 sizzle@haaser.com  
Initial plugin Release



