X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Ffortune%2Fsetup.php;h=67e3b7f17e7664a1a793670e273f41faa9872793;hb=6c84ba1ec45ab854c37b6f65c5b4d84ab1c7aad4;hp=d3073e1a4dd16bf5a2e4ba52e9e281b90fc75666;hpb=6a85a764b1f36c8689597cf67d6f7ce71a2c8e81;p=squirrelmail.git diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php index d3073e1a..67e3b7f1 100644 --- a/plugins/fortune/setup.php +++ b/plugins/fortune/setup.php @@ -1,73 +1,58 @@
"; - echo '
'; - if (!$exist) { - echo "$fortune_location not found."; - } else { - echo "
Today's Fortune
";
-        system($fortune_location);
-    } 
-  
-    echo '
'; + $squirrelmail_plugin_hooks['mailbox_index_before']['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'); + fortune_function(); } +/** + * Call fortune option display function + * @access private + */ function fortune_options() { - global $fortune_visible; - - echo "Fortunes:\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(); } - -?> +?> \ No newline at end of file