Hello,
I have translated this plugin to spanish. The files I have modified are:
setup.php
and
options.php
See attached files. See you.
From: "Paul Lesniewski" <paul@xxxxxxxxxxxxxxxx>
To: "Gonzalo Carmona Martinez" <maidenero@xxxxxxxxxxx>
CC: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: Serversidefilter language
Date: Mon, 13 Aug 2007 16:03:09 -0700
> Is there a spanish translation for the serversidefilter plugin? How do I
> install it?
Browsing
http://sourceforge.net/project/downloading.php?group_id=311&use_mirror=umn&filename=es_ES-1.4.9-20070106.tar.gz&7163655
I don't see one. Note that I am assuming you are using the newest
code for the plugin, available from its CVS repository at:
http://sourceforge.net/cvs/?group_id=95828
If you translate the plugin, please contribute your translation on the
squirrelmail-i18n mailing list.
Thanks,
Paul
_________________________________________________________________
Horóscopo, tarot, numerología... Escucha lo que te dicen los astros.
http://astrocentro.msn.es/
<?php
/*
* ServerSideFilter - ServerSide mail filter plugin for SquirrelMail
* By Patrick Swieskowski, Rick Sheaffer, and Jon Stroud
*/
function squirrelmail_plugin_init_serversidefilter() {
global $squirrelmail_plugin_hooks;
$squirrelmail_plugin_hooks['optpage_register_block']['serversidefilter'] =
'serversidefilter_optpage_register_block';
$squirrelmail_plugin_hooks['login_verified']['serversidefilter'] =
'check_filter';
}
function serversidefilter_optpage_register_block() {
global $optpage_blocks;
if (defined("SM_PATH")) {
bindtextdomain ('serversidefilter', SM_PATH . 'locale');
} else {
bindtextdomain ('serversidefilter', '../locale');
}
textdomain ('serversidefilter');
$optpage_blocks[] =
array(
'name' => _("Filtros de Mensajes"),
'url' => '../plugins/serversidefilter/options.php',
'desc' => _("El filtrado de mensajes permite organizar los mensajes en
carpetas automáticamente. PUEDE RALENZITAR EL ACCESO AL BUZON."),
'js' => FALSE);
if (defined("SM_PATH")) {
bindtextdomain('squirrelmail', SM_PATH . 'locale');
} else {
bindtextdomain ('squirrelmail', '../locale');
}
textdomain('squirrelmail');
}
function serversidefilter_version() {
return '1.42';
}
function check_filter() {
if (defined('SM_PATH'))
include_once(SM_PATH .
'plugins/serversidefilter/recipie_functions.php');
else
include_once('../plugins/serversidefilter/recipie_functions.php');
if ($ALWAYS_CREATE)
if (!filter_exists()) create_filter();
}
?>
<?php
/*
* ServerSideFilter - ServerSide mail filter plugin for SquirrelMail
* By Patrick Swieskowski, Rick Sheaffer, and Jon Stroud
*/
chdir('..');
if (!defined('SM_PATH')) define('SM_PATH','../');
// include compatibility plugin
//
if (defined('SM_PATH'))
include_once(SM_PATH . 'plugins/compatibility/functions.php');
else if (file_exists('../plugins/compatibility/functions.php'))
include_once('../plugins/compatibility/functions.php');
else if (file_exists('./plugins/compatibility/functions.php'))
include_once('./plugins/compatibility/functions.php');
if (compatibility_check_sm_version(1, 3))
{
include_once (SM_PATH . 'include/validate.php');
include_once (SM_PATH . 'functions/page_header.php');
include_once (SM_PATH . 'functions/imap.php');
include_once (SM_PATH . 'include/load_prefs.php');
include_once (SM_PATH . 'plugins/serversidefilter/config.php');
include_once (SM_PATH . 'plugins/serversidefilter/recipie_functions.php');
}
else
{
//include_once ('../src/validate.php');
include_once ('../functions/page_header.php');
include_once ('../functions/imap.php');
include_once ('../src/load_prefs.php');
include_once ('../plugins/serversidefilter/config.php');
include_once ('../plugins/serversidefilter/recipie_functions.php');
}
global $username, $key, $imapServerAddress, $imapPort;
global $fields, $matching, $folders, $imapConnection, $imap_stream;
global $recipies, $SPAMHEADER, $SPAMVALUE, $UNSUREVALUE;
global $spamrule_set, $unsurerule_set;
compatibility_sqextractGlobalVar('onetimepad');
compatibility_sqextractGlobalVar('delimiter');
// get global variables for versions of PHP < 4.1
//
if (!compatibility_check_php_version(4, 1)) {
global $HTTP_COOKIE_VARS, $HTTP_POST_VARS;
$_COOKIE = $HTTP_COOKIE_VARS;
$_POST = $HTTP_POST_VARS;
}
$key = $_COOKIE['key'];
$fields = array(_("From"), _("Subject"), _("To"), _("Cc"), "Para o CC",
_("Body"), _("Cabecera"), _("Cualquier campo"));
$matching = array(_("Contiene"), _("Comienza con"), _("Termina con"), _("Es
Exactamente"), _("Expresión Regular"));
$spamrule_set = false;
$unsurerule_set = false;
// figure out if we're already connected to IMAP server
//
if (!isset($imap_stream) && !isset($imapConnection)) {
$imapConnection = sqimap_login($username, $key, $imapServerAddress,
$imapPort, 0);
$previously_connected = false;
} elseif (isset($imapConnection)) {
$previously_connected = true;
} else {
$previously_connected = true;
$imapConnection = $imap_stream;
}
if (isset($ALLOW_UNSUBSCRIBED) and $ALLOW_UNSUBSCRIBED)
$boxes = sqimap_mailbox_list_all ($imapConnection);
else
$boxes = sqimap_mailbox_list($imapConnection);
if (!$previously_connected)
sqimap_logout($imapConnection);
$folders = array();
for ($i = 0; $i < count($boxes); $i++)
if (!in_array('noselect', $boxes[$i]['flags']))
array_push($folders, $boxes[$i]['unformatted']);
$recipies = array();
set_filter_app();
$file = filter_get();
read_recipies($file);
if (array_key_exists('create_x', $_POST)) {
// Create a new entry
if ($_POST['field'] == $SPAMHEADER) {
$new['field'] = $SPAMHEADER;
if ($_POST['string'] == $SPAMVALUE) {
$spamrule_set = true;
} else if ($_POST['string'] == $UNSUREVALUE) {
$unsurerule_set = true;
}
} else
$new['field'] = $fields[$_POST['field']];
$new['string'] = $_POST['string'];
if (get_magic_quotes_gpc() == 1)
$new['string'] = stripslashes($new['string']);
$new['folder'] = $folders[$_POST['folder']];
$new['action'] = $_POST['action'];
$new['matching'] = $matching[$_POST['matching']];
if (isset($_POST['toFolder']))
$new['toFolder'] = 'on';
else
$new['toFolder'] = 'off';
if (isset($_POST['toAddress']))
$new['toAddress'] = 'on';
else
$new['toAddress'] = 'off';
if ($_POST['add_string'] != null) {
$new['add_string'] = $_POST['add_string'];
if (get_magic_quotes_gpc() == 1)
$new['add_string'] = stripslashes($new['add_string']);
}
else $new['add_string'] = "";
array_push($recipies, $new);
write_recipies($file, "/tmp/filterfile.$username.tmp");
filter_put("/tmp/filterfile.$username.tmp");
} elseif (array_key_exists('modify_x', $_POST)) {
// Modify an existing entry
if ($_POST['field'] == $SPAMHEADER)
$recipies[$_POST['rule']]['field'] = $SPAMHEADER;
else
$recipies[$_POST['rule']]['field'] = $fields[$_POST['field']];
$recipies[$_POST['rule']]['string'] = $_POST['string'];
if (get_magic_quotes_gpc() == 1)
$recipies[$_POST['rule']]['string'] = stripslashes($_POST['string']);
$recipies[$_POST['rule']]['folder'] = $folders[$_POST['folder']];
$recipies[$_POST['rule']]['action'] = $_POST['action'];
$recipies[$_POST['rule']]['matching'] =
$matching[$_POST['matching']];
if (isset($_POST['toFolder']))
$recipies[$_POST['rule']]['toFolder'] = 'on';
else
$recipies[$_POST['rule']]['toFolder'] = 'off';
if (isset($_POST['toAddress']))
$recipies[$_POST['rule']]['toAddress'] = 'on';
else
$recipies[$_POST['rule']]['toAddress'] = 'off';
$recipies[$_POST['rule']]['add_string'] =
$_POST['add_string'];
write_recipies($file, "/tmp/filterfile.$username.tmp");
filter_put("/tmp/filterfile.$username.tmp");
} elseif (array_key_exists('delete_x', $_POST)) {
// Delete an entry
if ($_POST['field'] == $SPAMHEADER) {
if ($_POST['string'] == $SPAMVALUE) {
$spamrule_set = false;
} else if ($_POST['string'] == $UNSUREVALUE) {
$unsurerule_set = false;
}
}
$recipies = array_merge(array_slice($recipies, 0, $_POST['rule']),
array_slice($recipies, $_POST['rule']+1));
write_recipies($file, "/tmp/filterfile.$username.tmp");
filter_put("/tmp/filterfile.$username.tmp");
} elseif (array_key_exists('up_x', $_POST)) {
// Move an entry up
if ($_POST['rule'] > 0) {
$tmp = $recipies[$_POST['rule']];
$recipies[$_POST['rule']] = $recipies[$_POST['rule']-1];
$recipies[$_POST['rule']-1] = $tmp;
write_recipies($file, "/tmp/filterfile.$username.tmp");
filter_put("/tmp/filterfile.$username.tmp");
}
} elseif (array_key_exists('down_x', $_POST)) {
// Move an entry down
if ($_POST['rule'] < count($recipies)-1) {
$tmp = $recipies[$_POST['rule']];
$recipies[$_POST['rule']] = $recipies[$_POST['rule']+1];
$recipies[$_POST['rule']+1] = $tmp;
write_recipies($file, "/tmp/filterfile.$username.tmp");
filter_put("/tmp/filterfile.$username.tmp");
}
}
unlink($file);
$value = count($recipies);
displayPageHeader($color, 'None');
bindtextdomain('serversidefilter', SM_PATH . 'locale');
textdomain('serversidefilter');
?>
<br>
<table width="95%" align=center border=0 cellpadding=2 cellspacing=0>
<tr><td align="center" bgcolor="<?php echo $color[0] ?>">
<b><?php echo _("Opciones") . " - " . _("Filtros de Mensajes"); ?></b>
<table width="100%" border=0 cellpadding=1 cellspacing=1>
<tr><td bgcolor="<?php echo $color[4] ?>" align=center><br>
<table border=1 frame=void rules=rows noshade=0 bordercolor=<?php echo
$color[0]?> cellpadding=5 cellspacing=0>
<tr><td bgcolor="<?php echo $color[4] ?>" align=center colspan=6>
<table border=4 rules=rows noshade=0 bordercolor=<?php echo $color[0]?>
cellpadding=5 cellspacing=0>
<tr><td colspan=6 align=center><b><?php echo _("Crear Nuevo
Filtro:")?></td></tr>
<form method=post action="options.php">
<input type=hidden name="create.x" value="<?php print($value++)?>">
<tr><td align=right valign=top>
<?php
print(_("Si") . " ");
fieldDropdown('');
matchingDropdown('');
print(" <input type=text name=string size=10> " . _("entonces") . " ")
?>
<select name=action>
<option value=m><?php echo _("mover") ?></option>
<option value=c><?php echo _("copiar") ?></option>
<option value=d><?php echo _("borrar") ?></option>
</select>
a
</td><td><table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><input type=checkbox name=toFolder checked><?php echo
_("Carpeta")?> </td>
<td><?php echo folderDropdown('') ?></td>
</tr>
<tr>
<td><input type=checkbox name=toAddress><?php echo
_("Email")?> </td>
<td><input type=text name=add_string></td>
</tr>
</table>
</td>
<td align=center valign=top>
<input type=image src="images/saveas.gif" border=0 name=create alt="<?php
echo _("save new") ?>"></td>
</tr>
</form>
<?php
if (isset($SPAMFILTER) && $SPAMFILTER != '') {
if (!$spamrule_set) {
echo '<form method=post action="options.php">'
.'<input type=hidden name="create.x" value="'.$value++.'">'
.'<tr><td align=right valign=top>'
.'<input type=hidden name=field value="' . $SPAMHEADER . '">'
.'<input type=hidden name=string value="' . $SPAMVALUE . '">'
.'<input type=hidden name=matching vaule="0">'
._("si el mensaje ha sido marcado como").'
<b>'._("SPAM").'</b> '._("entonces")
.' <select name=action>'
.'<option value=m>'._("mover").'</option>'
.'<option value=c>'._("copiar").'</option>'
.'<option value=d>'._("borrar").'</option>'
.'</select>'
.' '._("a").'</td><td><table border=0 cellpadding=0
cellspacing=0>'
.'<tr><td><input type=checkbox name=toFolder checked>' .
_("Carpeta") . ' </td><td>';
folderDropdown('');
echo '</td></tr>'
.'<td><input type=checkbox name=toAddress>' ._("Email") .
' </td>'
.'<td><input type=text name=add_string></td>'
.'</tr></table></td>'
.'<td colspan=4 align=center valign=top>'
.'<input type=image src="images/saveas.gif" border=0
name=create alt="'._("save new").'"></td></tr>'
.'</form>';
}
if (!$unsurerule_set && isset($UNSUREVALUE) && $UNSUREVALUE != '' ) {
echo '<form method=post action="options.php">'
.'<input type=hidden name="create.x" value="'.$value++.'">'
.'<tr><td align=right valign=top>'
.'<input type=hidden name=field value="' . $SPAMHEADER . '">'
.'<input type=hidden name=string value="' . $UNSUREVALUE .
'">'
._("si el mensaje ha sido marcado como").'
<b>'._("UNSURE").'</b> '._("then")
.' <select name=action>'
.'<option value=m>move</option>'
.'<option value=c>copy</option>'
.'</select>'
.' '._("to").'</td><td><table border=0 cellpadding=0
cellspacing=0>'
.'<tr><td><input type=checkbox name=toFolder checked>' .
_("Carpeta") . ' </td><td>';
folderDropdown('');
echo '</td></tr>'
.'<td><input type=checkbox name=toAddress>' ._("Email") .
' </td>'
.'<td><input type=text name=add_string></td>'
.'</tr></table></td>'
.'<td colspan=4 align=center valign=top><input type=image
src="images/saveas.gif" border=0 name=create alt="save new"></td></tr>'
.'</form>';
}
}
echo "</table></td></tr>";
echo "<tr><td colspan=6 align=center><br><b>"._("Filtros
Existentes:")."</td></tr>";
print_recipies();
?>
</table>
<p><b>
<?php
echo _("Advertencia:") . "</b> " . _("El uso de estos filtros puede
impedir la lectura del correo en clientes de correo no IMAP.");
bindtextdomain('squirrelmail', SM_PATH . 'locale');
textdomain('squirrelmail');
?>
</td></tr>
</table>
</td></tr>
</table>
</body>
</html>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
--
squirrelmail-users mailing list
Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users