X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Ffortune%2Fsetup.php;h=2782826864a2105d76cefc5a5d3721d040d9bb29;hb=7e77425503d3545d50a965e15df5f06b068c4e79;hp=d1c21bccd592fc3730105de133612dd13198f7ac;hpb=a8a3b4411d1980cc691c4945efe07353ce34bdc1;p=squirrelmail.git
diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php
index d1c21bcc..27828268 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