Some plugins to rg=0: bug_report message_details newmail sent_subfolders spamcop...
[squirrelmail.git] / plugins / spamcop / setup.php
index b8e7058deadf4d8762214a8147424a8dd384b360..6c523a4219a0459e68c5b27b7b1da33710cfbda9 100755 (executable)
@@ -1,17 +1,26 @@
 <?php
-
+   /** 
+    **  setup.php -- SpamCop plugin           
+    **
+    **  Copyright (c) 1999-2002 The SquirrelMail development team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **  
+    **  $Id$                                                         
+    **/
 
 /* Initialize the plugin */
 function squirrelmail_plugin_init_spamcop() {
    global $squirrelmail_plugin_hooks, $data_dir, $username,
       $spamcop_is_composing;
 
-   $squirrelmail_plugin_hooks['options_register']['spamcop'] =
+   $squirrelmail_plugin_hooks['optpage_register_block']['spamcop'] =
       'spamcop_options';
    $squirrelmail_plugin_hooks['loading_prefs']['spamcop'] =
       'spamcop_load';
    $squirrelmail_plugin_hooks['read_body_header_right']['spamcop'] =
       'spamcop_show_link';
+
+   sqextractGlobalVar('spamcop_is_composing');
       
    if (isset($spamcop_is_composing)) {
       $squirrelmail_plugin_hooks['compose_send']['spamcop'] =
@@ -44,17 +53,17 @@ function spamcop_load() {
 
 // Show the link on the read-a-message screen
 function spamcop_show_link() {
-   global $passed_id, $mailbox, $ent_num, $spamcop_enabled, $startMessage,
-      $spamcop_method;
-
-   // This was stolen from printer_friendly
-   // Do I really need/want it?
-   if (!trim($mailbox))
-      $mailbox = 'INBOX';
+   global $spamcop_enabled, $spamcop_method;
 
    if (! $spamcop_enabled)
       return;
 
+   /* GLOBALS */
+   $passed_id = $_GET['passed_id'];
+   $mailbox = $_GET['mailbox'];
+   $startMessage = $_GET['startMessage'];
+   /* END GLOBALS */
+
    echo "<br>\n";
    
    if ($spamcop_method == 'web_form') {
@@ -65,14 +74,14 @@ echo urlencode($mailbox); ?>" target="_blank">');
 document.write("<?PHP echo _("Report as Spam"); ?>");
 document.write("</a>");
 </script><noscript>
-<a href="../plugins/spamcop/spamcop_web.php?passed_id=<?PHP
+<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP
 echo urlencode($passed_id); ?>&mailbox=<?PHP
 echo urlencode($mailbox); ?>&startMessage=<?PHP
 echo urlencode($startMessage); ?>"><?PHP
 echo _("Report as Spam"); ?></a>
 </noscript><?PHP
    } else {
-?><a href="../plugins/spamcop/spamcop_web.php?passed_id=<?PHP
+?><a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP
 echo urlencode($passed_id); ?>&mailbox=<?PHP
 echo urlencode($mailbox); ?>&startMessage=<?PHP
 echo urlencode($startMessage); ?>"><?PHP
@@ -84,9 +93,9 @@ echo _("Report as Spam"); ?></a><?PHP
 // Show the link to our own custom options page
 function spamcop_options()
 {
-   global $optionpages;
+   global $optpage_blocks;
    
-   $optionpages[] = array(
+   $optpage_blocks[] = array(
       'name' => _("SpamCop - Spam Reporting"),
       'url' => '../plugins/spamcop/options.php',
       'desc' => _("Help fight the battle against unsolicited email.  SpamCop reads the spam email and determines the correct addresses to send complaints to.  Quite fast, really smart, and easy to use."),