X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffortune%2Fsetup.php;h=f99f4e0c4c35aabb90383ae087d1021003748c9f;hp=d1c21bccd592fc3730105de133612dd13198f7ac;hb=768c6816fba75ca42198049e0de77522912f8d00;hpb=a8a3b4411d1980cc691c4945efe07353ce34bdc1 diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php index d1c21bcc..f99f4e0c 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 (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(); } - -?> \ No newline at end of file