X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffortune%2Fsetup.php;h=1a521e71d0abfcc35f611def46ad12137bf4cca3;hp=dbdc7b109853f30650bddcb04eeeae6c1e908f75;hb=8ab3c1bd38409d09e1c336107ebee474b5a7dd39;hpb=a9e1e670fab4399260e0790e018393c7dcefcecc
diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php
index dbdc7b10..1a521e71 100644
--- a/plugins/fortune/setup.php
+++ b/plugins/fortune/setup.php
@@ -1,14 +1,9 @@
\n".
- "\n".
- "\n";
- echo '';
- if (!$exist) {
- echo "$fortune_location" . _(" not found.");
- } else {
- echo "" . _("Today's Fortune") . "
";
- htmlspecialchars(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';
}
/**
- * Get fortune prefs
- * @access private
+ * Call fortune display function
+ * @access private
*/
-function fortune_load() {
- global $username, $data_dir, $fortune_visible;
-
- $fortune_visible = getPref($data_dir, $username, 'fortune_visible');
+function fortune() {
+ include_once(SM_PATH . 'plugins/fortune/functions.php');
+ return fortune_function();
}
/**
- * Add fortune options
- * @access private
+ * 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();
}
/**
- * Save fortune prefs
- * @access private
+ * Call fortune prefs load function
+ * @access private
*/
-function fortune_save() {
- global $username,$data_dir;
-
- if (sqgetGlobalVar('fortune_fortune_visible',$fortune_fortune_visible,SQ_POST)) {
- setPref($data_dir, $username, 'fortune_visible', '1');
- } else {
- setPref($data_dir, $username, 'fortune_visible', '');
- }
+function fortune_load() {
+ include_once(SM_PATH . 'plugins/fortune/functions.php');
+ fortune_function_load();
}
-
-?>