X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Ffortune%2Fsetup.php;h=f99f4e0c4c35aabb90383ae087d1021003748c9f;hb=ae5dddc065f9501f267c4edaf68a066835da915f;hp=d3073e1a4dd16bf5a2e4ba52e9e281b90fc75666;hpb=6a85a764b1f36c8689597cf67d6f7ce71a2c8e81;p=squirrelmail.git diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php index d3073e1a..f99f4e0c 100644 --- a/plugins/fortune/setup.php +++ b/plugins/fortune/setup.php @@ -1,73 +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 "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(); } - -?>