From: kink Date: Sun, 10 Dec 2006 20:19:45 +0000 (+0000) Subject: make spamcop plugin work again X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=7dc06407b2f39bd3b18495185a9f3c05f6c3ae0c;ds=sidebyside make spamcop plugin work again git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11997 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/spamcop/functions.php b/plugins/spamcop/functions.php index a36ac3ce..d53f299b 100644 --- a/plugins/spamcop/functions.php +++ b/plugins/spamcop/functions.php @@ -59,7 +59,7 @@ function spamcop_load_function() { * @since 1.5.1 * @access private */ -function spamcop_show_link_function() { +function spamcop_show_link_function(&$links) { global $spamcop_enabled, $spamcop_method, $spamcop_quick_report,$javascript_on; if (! $spamcop_enabled) @@ -79,8 +79,6 @@ function spamcop_show_link_function() { $passed_ent_id = 0; } - echo "
\n"; - /* Catch situation when user uses quick_email and does not update preferences. User gets web_form link. If prefs are set to @@ -90,19 +88,24 @@ function spamcop_show_link_function() { $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) { -?> - - +// document.write(''); +//document.write(""); +//document.write(""); +// + + + $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' && $javascript_on ) { + $url .= '&js_web=1'; } + + $links[] = array ( 'URL' => $url, + 'Text' => _("Report as Spam") + ); } /** diff --git a/plugins/spamcop/setup.php b/plugins/spamcop/setup.php index 1c8ce71f..2647cc82 100755 --- a/plugins/spamcop/setup.php +++ b/plugins/spamcop/setup.php @@ -41,9 +41,9 @@ function spamcop_load() { * Shows spamcop link on the read-a-message screen * @access private */ -function spamcop_show_link() { +function spamcop_show_link(&$links) { include_once(SM_PATH . 'plugins/spamcop/functions.php'); - spamcop_show_link_function(); + spamcop_show_link_function($links); } /**