removing double spaces and html formating fixes
[squirrelmail.git] / plugins / spamcop / options.php
index 8c4c1e0e070cd2cb52efc8ed6662475fb5389240..a64e304da99907dd47f16ad15cd43b8d4c426d8a 100755 (executable)
@@ -1,20 +1,25 @@
 <?php
 
-   /**
-    **  options.php -- SpamCop options page
-    **
-    **  Copyright (c) 1999-2003 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  $Id$
-    * @package plugins
-    * @subpackage spamcop
-    **/
+/**
+ *  options.php -- SpamCop options page
+ *
+ * @copyright (c) 1999-2004 The SquirrelMail development team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage spamcop
+ */
 
 /** @ignore */
 define('SM_PATH','../../');
 require_once(SM_PATH . 'include/validate.php');
 
+/**
+ * Internal spamcop plugin function.
+ *
+ * It is used to display similar action links.
+ * @access private
+ */
 function spamcop_enable_disable($option,$disable_action,$enable_action) {
     if ($option) { 
        $ret= _("Enabled") . "(<a href=\"options.php?action=$disable_action\">" . _("Disable it") . "</a>)\n";
@@ -29,6 +34,7 @@ displayPageHeader($color, 'None');
 /* globals */
 sqgetGlobalVar('action', $action);
 sqgetGlobalVar('meth', $meth);
+sqgetGlobalVar('type', $type);
 sqgetGlobalVar('ID' , $ID);
 
 sqgetGlobalVar('username', $username, SQ_SESSION);
@@ -54,6 +60,11 @@ switch ($action) {
             setPref($data_dir, $username, 'spamcop_method', $meth);
         }
         break;
+    case 'type':
+        if (isset($type)) {
+            setPref($data_dir, $username, 'spamcop_type', $type);
+        }
+       break;
     case 'save_id':
         if (isset($ID)) {
             $ID = trim($ID);
@@ -71,7 +82,9 @@ spamcop_load();
       <br />
       <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
       <tr><td bgcolor="<?php echo $color[0]; ?>">
-         <center><b><?php echo _("Options") . " - " . _("Spam reporting"); ?></b></center>
+         <center><b>
+        <?php echo _("Options") . " - " . _("Spam reporting"); ?>
+        </b></center>
       </td></tr></table>
       <br />
       
@@ -85,7 +98,7 @@ spamcop_load();
         <tr>
          <?php
          echo html_tag('td',_("Delete spam when reported:") . "<br />\n" .
-         '<font size="-2">(' . _("Only works with email-based reporting") . ')</font>',
+         '<small>(' . _("Only works with email-based reporting") . ')</small>',
          'right','','valign="top"');
          echo html_tag('td', spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
          ?>
@@ -94,8 +107,8 @@ spamcop_load();
          <?php
          echo html_tag('td',_("Spam Reporting Method:"),'right');
          ?>
-         <form method="post" action="options.php">
          <td>
+         <form method="post" action="options.php">
            <select name="meth">
                <?php
                    if ($spamcop_quick_report) {
@@ -118,20 +131,50 @@ spamcop_load();
                ?>
              </option>
            </select>
-           <input type="hidden" name="action" value="meth">
-           <input type="submit" value="<?php echo _("Save Method"); ?>">
-         </td></form>
+           <input type="hidden" name="action" value="meth" />
+           <?php
+               echo '<input type="submit" value="' . _("Save Method") . "\" />\n";
+           ?>
+         </form></td>
+       </tr>
+       <tr>
+           <?php
+               echo html_tag('td',_("Spam Service Type:"),'right');
+           ?>
+         <td>
+         <form method="post" action="options.php">
+           <select name="type">
+             <option value="free"
+               <?php
+                 if ($spamcop_type == 'free') echo ' selected';
+                 echo ">"._("Free reporting");
+               ?>
+             </option>
+             <option value="member"
+               <?php
+                 if ($spamcop_type == 'member') echo ' selected';
+                 echo ">"._("Member services");
+               ?>
+             </option>
+           </select>
+           <?php
+           echo '<input type="hidden" name="action" value="type" />' .
+                '<input type="submit" value="' . _("Save Service Type") . "\" />\n";
+           ?>
+          </form></td>
        </tr>
        <tr>
          <?php
            echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
-           '<font size="-2">(' . _("see below") . ')</font>','right','','valign="top"');
+           '<small>(' . _("see below") . ')</small>','right','','valign="top"');
          ?>
-         <form method="post" action="options.php"><td valign="top">
+         <td valign="top"><form method="post" action="options.php">
            <input type="text" size="30" name="ID" value="<?php echo htmlspecialchars($spamcop_id) ?>" />
            <input type="hidden" name="action" value="save_id" />
-           <input type="submit" value="<?php echo _("Save ID"); ?>" />
-         </td></form>
+           <?php
+               echo '<input type="submit" value="' . _("Save ID") . "\" />\n";
+           ?>
+         </form></td>
        </tr>
       </table>
 <?php
@@ -148,16 +191,16 @@ echo _("<b>Before you sign up, be warned:</b> Some users have reported that the
 echo "</p>\n";
 
 echo "<p>";
-echo _("Once you have signed up with SpamCop and have received your SpamCop authorization code, you need to enable this plugin -- just click the link above.  Once enabled, you go about your normal life.  If you encounter a spam message in your mailbox, just view it.  On the right-hand side, near the top of where the message is displayed, you will see a link to report this message as spam.  Clicking on it brings you to a confirmation page. Confirming that you want the spam report sent will do different things with different reporting methods.");
+echo _("Once you have signed up with SpamCop and have received your SpamCop authorization code, you need to enable this plugin -- just click the link above. Once enabled, you go about your normal life. If you encounter a spam message in your mailbox, just view it. On the right-hand side, near the top of where the message is displayed, you will see a link to report this message as spam. Clicking on it brings you to a confirmation page. Confirming that you want the spam report sent will do different things with different reporting methods.");
 echo "</p>\n";
 
 echo "<p><b>" . _("Email-based Reporting") . "</b><br />";
-echo _("Pressing the button forwards the message to the SpamCop service and will optionally delete the message.  From there, you just need to go to your INBOX and quite soon a message should appear from SpamCop.  (It gets sent to the account you registered with, so make sure that your mail forwarder works!) Open it up, click on the appropriate link at the top, and a new browser window will open.");
+echo _("Pressing the button forwards the message to the SpamCop service and will optionally delete the message. From there, you just need to go to your INBOX and quite soon a message should appear from SpamCop. (It gets sent to the account you registered with, so make sure that your mail forwarder works!) Open it up, click on the appropriate link at the top, and a new browser window will open.");
 echo "</p>";
 
 if ($spamcop_quick_report) {
 echo "<p>";
-echo _("Currently, the quick reporting just forwards the request to the thorough reporting.  Also, it appears that this is for members (non-free) only. Hopefully this will change soon.");
+echo _("Currently, the quick reporting just forwards the request to the thorough reporting. Also, it appears that this is for members (non-free) only. Hopefully this will change soon.");
 echo "</p>\n";
 }
 
@@ -166,7 +209,11 @@ echo _("When you press the button on the confirmation page, this will pop open a
 echo "</p>\n";
 
 echo "<p>";
-echo _("The SpamCop service will display information as it finds it, so scroll down until you see a form button.  It might pause a little while it is looking up information, so be a little patient.  Read what it says, and submit the spam.  Close the browser window.  Press Cancel or click on the appropriate mail folder to see messages and/or delete the spam.");
+echo _("The SpamCop service will display information as it finds it, so scroll down until you see a form button. It might pause a little while it is looking up information, so be a little patient. Read what it says, and submit the spam. Close the browser window. Press Cancel or click on the appropriate mail folder to see messages and/or delete the spam.");
+echo "</p>\n";
+
+echo "<p><b>". _("Spamcop Service Type") . "</b><br />\n";
+echo _("Service type option allows selecting which spamcop services you are using. Member services use different web reporting forms and does not display nags. You can purchase these services, if you want to support SpamCop.");
 echo "</p>\n";
 
 echo "<p>";