X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffortune%2Fsetup.php;h=1a521e71d0abfcc35f611def46ad12137bf4cca3;hp=32d603169322157b2793f41ddfc59cdf276af531;hb=8ab3c1bd38409d09e1c336107ebee474b5a7dd39;hpb=a75e70b1b5fb3a111e84cf658cc6937a8e97dc2c
diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php
index 32d60316..1a521e71 100644
--- a/plugins/fortune/setup.php
+++ b/plugins/fortune/setup.php
@@ -1,78 +1,50 @@
";
- echo '';
- if (!$exist) {
- echo "$fortune_location" . _(" not found.");
- } else {
- echo "" . _("Today's Fortune") . "
";
- system($fortune_location);
- }
-
- echo ' |
|
|
';
+ $squirrelmail_plugin_hooks['template_construct_message_list.tpl']['fortune'] = 'fortune';
+ $squirrelmail_plugin_hooks['loading_prefs']['fortune'] = 'fortune_load';
+ $squirrelmail_plugin_hooks['optpage_loadhook_display']['fortune'] = 'fortune_options';
}
-function fortune_load() {
- global $username, $data_dir, $fortune_visible;
-
- $fortune_visible = getPref($data_dir, $username, 'fortune_visible');
+/**
+ * Call fortune display function
+ * @access private
+ */
+function fortune() {
+ include_once(SM_PATH . 'plugins/fortune/functions.php');
+ return fortune_function();
}
+/**
+ * Call fortune option display function
+ * @access private
+ */
function fortune_options() {
- global $fortune_visible;
-
- echo "" . html_tag('td',_("Fortunes:"),'right','','nowrap') . "\n";
- echo ' " . _("Show fortunes at top of mailbox") . " |
\n";
+ include_once(SM_PATH . 'plugins/fortune/functions.php');
+ fortune_function_options();
}
-function fortune_save() {
- global $username,$data_dir;
-
- if (isset($_POST['fortune_fortune_visible'])) {
- setPref($data_dir, $username, 'fortune_visible', '1');
- } else {
- setPref($data_dir, $username, 'fortune_visible', '');
- }
+/**
+ * Call fortune prefs load function
+ * @access private
+ */
+function fortune_load() {
+ include_once(SM_PATH . 'plugins/fortune/functions.php');
+ fortune_function_load();
}
-
-?>