- Fix error with SpamCop reporting plugin not being able to send report as
[squirrelmail.git] / plugins / spamcop / options.php
index fb904df4fe75a2faf847234ce9571baa7e7d8ced..77a55f54771924c0fe27095e2111a198f42352d8 100755 (executable)
@@ -1,23 +1,24 @@
 <?php
 
 /**
- *  options.php -- SpamCop options page
+ * options.php -- SpamCop options page
  *
- * @copyright (c) 1999-2005 The SquirrelMail Project Team
+ * @copyright 1999-2010 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage spamcop
  */
 
-/** @ignore */
-define('SM_PATH','../../');
-/* SquirrelMail functions */
-require_once(SM_PATH . 'include/validate.php');
+
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../../include/init.php');
 /* plugin functions */
 include_once(SM_PATH . 'plugins/spamcop/functions.php');
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 /** is spamcop plugin disabled */
 // option changes do nothing, if read_body_header_right hook is not active.
@@ -25,7 +26,6 @@ displayPageHeader($color, 'None');
 /* globals */
 sqgetGlobalVar('action', $action);
 sqgetGlobalVar('meth', $meth);
-sqgetGlobalVar('type', $type);
 sqgetGlobalVar('ID' , $ID);
 
 sqgetGlobalVar('username', $username, SQ_SESSION);
@@ -57,11 +57,6 @@ 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);
@@ -79,9 +74,9 @@ spamcop_load_function();
       <br />
       <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
       <tr><td bgcolor="<?php echo $color[0]; ?>">
-        <center><b>
+        <div style="text-align: center;"><b>
         <?php echo _("Options") . " - " . _("Spam reporting"); ?>
-        </b></center>
+        </b></div>
       </td></tr></table>
       <br />
 
@@ -122,19 +117,19 @@ spamcop_load_function();
                     echo ">"._("Quick email-based reporting");
                     echo '</option>';
                 }
-              ?>
-              <option value="thorough_email"
-                <?php
-                  if ($spamcop_method == 'thorough_email') echo ' selected="selected"';
-                  echo ">"._("Thorough email-based reporting");
-                ?>
-              </option>
-              <option value="web_form"
-                <?php
-                  if ($spamcop_method == 'web_form') echo ' selected="selected"';
-                  echo ">"._("Web-based form");
-                ?>
-              </option>
+                   $selected = '';
+                   if ($spamcop_method == 'thorough_email') {
+                       $selected = ' selected';
+                   }
+                   echo sprintf('            <option value="thorough_email"%s>%s</option>',$selected, _("Through email-based reporting"));
+                   
+                   $selected = '';
+                   if ($spamcop_method == 'web_form') {
+                       $selected = ' selected';
+                   }
+                   echo sprintf('            <option value="web_form"%s>%s</option>', $selected, _("Web-based form"));
+                
+            ?>
             </select>
             <input type="hidden" name="action" value="meth" />
             <?php
@@ -142,32 +137,6 @@ spamcop_load_function();
             ?>
           </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="selected"';
-                  echo ">"._("Free reporting");
-                ?>
-              </option>
-              <option value="member"
-                <?php
-                  if ($spamcop_type == 'member') echo ' selected="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 />" .
@@ -225,4 +194,4 @@ echo '<p><b>' . _("More information") . '</b><br />';
 printf(_("For more information about SpamCop, it's services, spam in general, and many related topics, try reading through SpamCop's %sHelp and Feedback%s section."), '<a href="http://spamcop.net/help.shtml">', '</a>');
 echo "</p>\n";
 ?>
-</body></html>
\ No newline at end of file
+</body></html>