From 6b6381715922c24dc8664cc62464096814d6a291 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Sun, 30 Jul 2000 15:06:26 +0000 Subject: [PATCH] - added more hooks - updated documentation on plugins to include a list of hooks - added info in plugin.txt on how to use "options" in your plugins git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@651 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 11 +++--- doc/plugin.txt | 63 +++++++++++++++++++++++++++++++++++ functions/mailbox_display.php | 3 ++ functions/plugin.php | 8 +++-- src/left_main.php | 2 +- src/load_prefs.php | 3 ++ src/options.php | 6 ++++ 7 files changed, 87 insertions(+), 9 deletions(-) diff --git a/config/conf.pl b/config/conf.pl index 1808c2b7..6cb6038f 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -38,11 +38,11 @@ if ( -e "config.php") { if ($config_version ne $conf_pl_version) { system "clear"; print $WHT."WARNING:\n".$NRM; - print " The file \"config.php\" was found, but it is for an older version of\n"; + print " The file \"config/config.php\" was found, but it is for an older version of\n"; print " SquirrelMail. It is possible to still read the defaults from this file\n"; print " but be warned that many preferences change between versions. It is\n"; print " recommended that you start with a clean config.php for each upgrade that\n"; - print " you do. To do this, just move config.php out of the way.\n\n"; + print " you do. To do this, just move config/config.php out of the way.\n\n"; print "Continue loading with the old config.php [y/n]? "; $ctu = ; if (($ctu =~ /^n\n/i) || ($ctu =~ /^\n/)) { @@ -1335,9 +1335,10 @@ sub save_data { print FILE " + + + + + + + +
+ YOUR OPTIONS NAME +
+ YOUR DESCRIPTION +
+ "; @@ -334,5 +335,7 @@ echo "" . _("Next") . "\n"; } echo ""; /** End of message-list table */ + + do_hook("mailbox_index_after"); } ?> diff --git a/functions/plugin.php b/functions/plugin.php index 696cab5c..cb845ea9 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -19,9 +19,11 @@ // This function adds a plugin function use_plugin ($name) { - include ('../plugins/'.$name.'/setup.php'); - $function = 'squirrelmail_plugin_init_'.$name; - $function(); + if (file_exists('../plugins/'.$name.'/setup.php')) { + include ('../plugins/'.$name.'/setup.php'); + $function = 'squirrelmail_plugin_init_'.$name; + $function(); + } } // This function executes a hook diff --git a/src/left_main.php b/src/left_main.php index 91d2bcc0..112ad87b 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -148,7 +148,7 @@ } echo "\n$line
\n"; } - sqimap_logout($imapConnection); + do_hook("left_main_after"); ?> diff --git a/src/load_prefs.php b/src/load_prefs.php index 94b05e35..0cceee3f 100644 --- a/src/load_prefs.php +++ b/src/load_prefs.php @@ -14,6 +14,8 @@ include("../config/config.php"); if (!isset($prefs_php)) include("../functions/prefs.php"); + if (!isset($plugin_php)) + include("../functions/plugin.php"); $load_prefs_php = true; checkForPrefs($data_dir, $username); @@ -153,4 +155,5 @@ $message_highlight_list[$i]["match_type"] = $ary[3]; } + do_hook("loading_prefs"); ?> diff --git a/src/options.php b/src/options.php index df5ed332..e32ef0dd 100644 --- a/src/options.php +++ b/src/options.php @@ -89,7 +89,10 @@ setPref($data_dir, $username, "unseen_type", $unseentype); echo "
"._("Successfully saved folder preferences!")."
"; echo ""._("Refresh Folders")."

"; + } else { + do_hook("options_save"); } + ?> @@ -149,4 +152,7 @@ + -- 2.25.1