* @since 1.5.1
* @access private
*/
-function spamcop_show_link_function() {
- global $spamcop_enabled, $spamcop_method, $spamcop_quick_report,$javascript_on;
+function spamcop_show_link_function(&$links) {
+ global $spamcop_enabled, $spamcop_method, $spamcop_quick_report;
if (! $spamcop_enabled)
return;
$passed_ent_id = 0;
}
- echo "<br />\n";
-
/*
Catch situation when user uses quick_email and does not update
preferences. User gets web_form link. If prefs are set to
$spamcop_method = 'web_form';
}
- // Javascript is used only in web based reporting
- // don't insert javascript if javascript is disabled
- if ($spamcop_method == 'web_form' && $javascript_on) {
-?><script language="javascript" type="text/javascript">
-document.write('<a href="../plugins/spamcop/spamcop.php?passed_id=<?php echo urlencode($passed_id); ?>&js_web=1&mailbox=<?php echo urlencode($mailbox); ?>&passed_ent_id=<?php echo urlencode($passed_ent_id); ?>" target="_blank">');
-document.write("<?php echo _("Report as Spam"); ?>");
-document.write("</a>");
-</script><?php
- } else {
-?><a href="../plugins/spamcop/spamcop.php?passed_id=<?php echo urlencode($passed_id); ?>&mailbox=<?php echo urlencode($mailbox); ?>&startMessage=<?php echo urlencode($startMessage); ?>&passed_ent_id=<?php echo urlencode($passed_ent_id); ?>">
-<?php echo _("Report as Spam"); ?></a>
-<?php
+// FIXME: do we need this javascript and if so, fix it
+// <script type="text/javascript">
+// document.write('<a href="../plugins/spamcop/spamcop.php?passed_id=<php echo urlencode($passed_id); >&js_web=1&mailbox=<php echo urlencode($mailbox); >&passed_ent_id=<php echo urlencode($passed_ent_id); >" target="_blank">');
+//document.write("<php echo _("Report as Spam"); >");
+//document.write("</a>");
+//</script>
+
+
+ $url = '../plugins/spamcop/spamcop.php?passed_id=' . urlencode($passed_id) .
+ '&mailbox=' . urlencode($mailbox) . '&startMessage=' . urlencode($startMessage) .
+ '&passed_ent_id=' . urlencode($passed_ent_id);
+ if ( $spamcop_method == 'web_form' && checkForJavascript() ) {
+ $url .= '&js_web=1';
}
+
+ $links[] = array ( 'URL' => $url,
+ 'Text' => _("Report as Spam")
+ );
}
/**
*/
function spamcop_while_sending_function() {
global $mailbox, $spamcop_delete, $spamcop_save, $spamcop_is_composing, $auto_expunge,
- $username, $key, $imapServerAddress, $imapPort;
+ $username, $imapServerAddress, $imapPort;
if (sqgetGlobalVar('spamcop_is_composing' , $spamcop_is_composing)) {
// delete spam message
if ($spamcop_delete) {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress,
- $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
sqimap_mailbox_select($imapConnection, $mailbox);
sqimap_msgs_list_delete($imapConnection, $mailbox, array($spamcop_is_composing));
if ($auto_expunge)
}
return $composeMessage;
}
-?>
\ No newline at end of file