X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffortune%2Fsetup.php;h=78890fb4253f5f92b04f8149ea958dc5755891b9;hp=92646e717da60502d76dc3fc6f45fc47cf968c96;hb=e7d5ff29db69101e42cd491d2fa42d4f83cd35a4;hpb=0fe5da5017c46edee1031a31b14369db8861e33c
diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php
index 92646e71..78890fb4 100644
--- a/plugins/fortune/setup.php
+++ b/plugins/fortune/setup.php
@@ -1,14 +1,9 @@
";
- 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';
}
/**
- * 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 (isset($_POST['fortune_fortune_visible'])) {
- 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();
}
-
-?>
\ No newline at end of file