Exemple #1
0
/**
 * Inserts an option block in the main SM options page
 *
 */
function demo_option_link_do()
{
    global $optpage_blocks;
    sq_change_text_domain('demo');
    $optpage_blocks[] = array('name' => _("Demo"), 'url' => sqm_baseuri() . 'plugins/demo/demo.php', 'desc' => _("This is where you would describe what your plugin does."), 'js' => FALSE);
    sq_change_text_domain('squirrelmail');
}
function logout_error($errString, $errTitle = '')
{
    global $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height, $hide_sm_attributions, $version, $squirrelmail_language, $color, $theme, $theme_default;
    $base_uri = sqm_baseuri();
    include_once SM_PATH . 'functions/page_header.php';
    if (!isset($org_logo)) {
        // Don't know yet why, but in some accesses $org_logo is not set.
        include SM_PATH . 'config/config.php';
    }
    /* Display width and height like good little people */
    $width_and_height = '';
    if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width > 0) {
        $width_and_height = " width=\"{$org_logo_width}\"";
    }
    if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height > 0) {
        $width_and_height .= " height=\"{$org_logo_height}\"";
    }
    if (!isset($frame_top) || $frame_top == '') {
        $frame_top = '_top';
    }
    // load default theme if possible
    if (!isset($color) && @file_exists($theme[$theme_default]['PATH'])) {
        @(include $theme[$theme_default]['PATH']);
    }
    if (!isset($color)) {
        $color = array();
        $color[0] = '#dcdcdc';
        /* light gray    TitleBar               */
        $color[1] = '#800000';
        /* red                                  */
        $color[2] = '#cc0000';
        /* light red     Warning/Error Messages */
        $color[4] = '#ffffff';
        /* white         Normal Background      */
        $color[7] = '#0000cc';
        /* blue          Links                  */
        $color[8] = '#000000';
        /* black         Normal text            */
    }
    $logout_link = $base_uri . 'src/login.php';
    list($junk, $errString, $errTitle, $logout_link) = do_hook('logout_error', $errString, $errTitle, $logout_link);
    if ($errTitle == '') {
        $errTitle = $errString;
    }
    set_up_language($squirrelmail_language, true);
    displayHtmlHeader($org_name . ' - ' . $errTitle, '', false);
    echo '<body text="' . $color[8] . '" bgcolor="' . $color[4] . '" link="' . $color[7] . '" vlink="' . $color[7] . '" alink="' . $color[7] . "\">\n\n" . '<center>';
    if (isset($org_logo) && $org_logo != '') {
        echo '<img src="' . $org_logo . '" alt="' . sprintf(_("%s Logo"), $org_name) . "\"{$width_and_height} /><br />\n";
    }
    echo ($hide_sm_attributions ? '' : '<small>' . sprintf(_("SquirrelMail version %s"), $version) . '<br />' . _("By the SquirrelMail Project Team") . "<br /></small>\n") . '<table cellspacing="1" cellpadding="0" bgcolor="' . $color[1] . '" width="70%">' . '<tr><td>' . '<table width="100%" border="0" bgcolor="' . $color[4] . '" align="center">' . '<tr><td bgcolor="' . $color[0] . '" align="center">' . '<font color="' . $color[2] . '"><b>' . _("ERROR") . '</b></font>' . '</td></tr>' . '<tr><td align="center">' . $errString . '</td></tr>' . '<tr><td bgcolor="' . $color[0] . '" align="center">' . '<font color="' . $color[2] . '"><b>' . '<a href="' . $logout_link . '" target="' . $frame_top . '">' . _("Go to the login page") . '</a></b></font></td></tr>' . '</table></td></tr></table></center></body></html>';
}
Exemple #3
0
/**
 * Add message details link in message view
 * @access private
 */
function show_message_details(&$links)
{
    global $passed_id, $mailbox, $passed_ent_id;
    if (strlen(trim($mailbox)) < 1) {
        $mailbox = 'INBOX';
    }
    $params = '?passed_ent_id=' . $passed_ent_id . '&mailbox=' . urlencode($mailbox) . '&passed_id=' . $passed_id;
    $url = checkForJavascript() ? 'javascript:MessageSource();' : '../plugins/message_details/message_details_main.php' . $params;
    /* Output the link. */
    $links[] = array('URL' => $url, 'Text' => _("View Message Details"));
    if (checkForJavascript()) {
        echo '<script type="text/javascript">' . "\n" . '<!--' . "\n" . "  function MessageSource() {\n" . '    window.open("' . sqm_baseuri() . 'plugins/message_details/message_details_main.php' . $params . '","MessageDetails","width=800,height=600");' . "\n" . "  }\n" . "// -->\n" . "</script>\n\n";
    }
}
function logout_error($errString, $errTitle = '')
{
    global $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height, $hide_sm_attributions, $version, $squirrelmail_language;
    $base_uri = sqm_baseuri();
    include_once SM_PATH . 'functions/page_header.php';
    if (!isset($org_logo)) {
        // Don't know yet why, but in some accesses $org_logo is not set.
        include SM_PATH . 'config/config.php';
    }
    /* Display width and height like good little people */
    $width_and_height = '';
    if (isset($org_logo_width) && is_numeric($org_logo_width) && $org_logo_width > 0) {
        $width_and_height = " WIDTH=\"{$org_logo_width}\"";
    }
    if (isset($org_logo_height) && is_numeric($org_logo_height) && $org_logo_height > 0) {
        $width_and_height .= " HEIGHT=\"{$org_logo_height}\"";
    }
    if (!isset($frame_top) || $frame_top == '') {
        $frame_top = '_top';
    }
    if (!isset($color)) {
        $color = array();
        $color[0] = '#DCDCDC';
        /* light gray    TitleBar               */
        $color[1] = '#800000';
        /* red                                  */
        $color[2] = '#CC0000';
        /* light red     Warning/Error Messages */
        $color[4] = '#FFFFFF';
        /* white         Normal Background      */
        $color[7] = '#0000CC';
        /* blue          Links                  */
        $color[8] = '#000000';
        /* black         Normal text            */
    }
    if ($errTitle == '') {
        $errTitle = $errString;
    }
    set_up_language($squirrelmail_language, true);
    displayHtmlHeader($errTitle, '', false);
    echo "<BODY TEXT=\"{$color['8']}\" BGCOLOR=\"{$color['4']}\" LINK=\"{$color['7']}\" VLINK=\"{$color['7']}\" ALINK=\"{$color['7']}\">\n\n" . '<CENTER>';
    if (isset($org_logo) && $org_logo != '') {
        echo "<IMG SRC=\"{$org_logo}\" ALT=\"" . sprintf(_("%s Logo"), $org_name) . "\"{$width_and_height}><BR>\n";
    }
    echo ($hide_sm_attributions ? '' : '<SMALL>' . sprintf(_("SquirrelMail version %s"), $version) . "<BR>\n" . '  ' . _("By the SquirrelMail Development Team") . "<BR></SMALL>\n") . "<table cellspacing=1 cellpadding=0 bgcolor=\"{$color['1']}\" width=\"70%\"><tr><td>" . "<TABLE WIDTH=\"100%\" BORDER=\"0\" BGCOLOR=\"{$color['4']}\" ALIGN=CENTER>" . "<TR><TD BGCOLOR=\"{$color['0']}\" ALIGN=\"center\">" . "<FONT COLOR=\"{$color['2']}\"><B>" . _("ERROR") . '</B></FONT></TD></TR>' . '<TR><TD ALIGN="center">' . $errString . '</TD></TR>' . "<TR><TD BGCOLOR=\"{$color['0']}\" ALIGN=\"center\">" . "<FONT COLOR=\"{$color['2']}\"><B>" . '<a href="' . $base_uri . 'src/login.php" target="' . $frame_top . '">' . _("Go to the login page") . "</a></B></FONT>" . '</TD></TR>' . '</TABLE></td></tr></table></center></body></html>';
}
Exemple #5
0
function newmail_plugin()
{
    global $username, $key, $imapServerAddress, $imapPort, $newmail_media, $newmail_enable, $newmail_popup, $newmail_popup_height, $newmail_popup_width, $newmail_recent, $newmail_changetitle, $imapConnection;
    include_once SM_PATH . 'functions/display_messages.php';
    if ($newmail_enable == 'on' || $newmail_popup == 'on' || $newmail_changetitle) {
        // open a connection on the imap port (143)
        $boxes = sqimap_mailbox_list($imapConnection);
        $delimeter = sqimap_get_delimiter($imapConnection);
        $status = 0;
        $totalNew = 0;
        for ($i = 0; $i < count($boxes); $i++) {
            $line = '';
            $mailbox = $boxes[$i]['formatted'];
            if (!isset($boxes[$i]['unseen'])) {
                $boxes[$i]['unseen'] = '';
            }
            if ($boxes[$i]['flags']) {
                $noselect = false;
                for ($h = 0; $h < count($boxes[$i]['flags']); $h++) {
                    if (strtolower($boxes[$i]["flags"][$h]) == 'noselect') {
                        $noselect = TRUE;
                    }
                }
                if (!$noselect) {
                    $status += CheckNewMailboxSound($imapConnection, $mailbox, $boxes[$i]['unformatted'], $delimeter, $boxes[$i]['unseen'], $totalNew);
                }
            } else {
                $status += CheckNewMailboxSound($imapConnection, $mailbox, $boxes[$i]['unformatted'], $delimeter, $boxes[$i]['unseen'], $totalNew);
            }
        }
        // sqimap_logout($imapConnection);
        // If we found unseen messages, then we
        // will play the sound as follows:
        if ($newmail_changetitle) {
            echo "<script language=\"javascript\" type=\"text/javascript\">\n" . "function ChangeTitleLoad() {\n";
            if ($totalNew > 1 || $totalNew == 0) {
                echo 'window.parent.document.title = "' . sprintf(_("%s New Messages"), $totalNew) . "\";\n";
            } else {
                echo 'window.parent.document.title = "' . sprintf(_("%s New Message"), $totalNew) . "\";\n";
            }
            echo "if (BeforeChangeTitle != null)\n" . "BeforeChangeTitle();\n" . "}\n" . "BeforeChangeTitle = window.onload;\n" . "window.onload = ChangeTitleLoad;\n" . "</script>\n";
        }
        if ($totalNew > 0 && $newmail_enable == 'on' && $newmail_media != '' && $newmail_media != '(none)') {
            $newmail_media = sqm_baseuri() . 'plugins/newmail/sounds/' . basename($newmail_media);
            echo '<embed src="' . htmlspecialchars($newmail_media) . "\" hidden=\"true\" autostart=\"true\" width=\"2\" height=\"2\">\n";
        }
        if ($totalNew > 0 && $newmail_popup == 'on') {
            echo "<script language=\"JavaScript\">\n" . "<!--\n" . "function PopupScriptLoad() {\n" . 'window.open("' . sqm_baseuri() . 'plugins/newmail/newmail.php?numnew=' . $totalNew . '", "SMPopup",' . "\"width=" . (int) $newmail_popup_width . ",height=" . (int) $newmail_popup_height . ",scrollbars=no\");\n" . "if (BeforePopupScript != null)\n" . "BeforePopupScript();\n" . "}\n" . "BeforePopupScript = window.onload;\n" . "window.onload = PopupScriptLoad;\n" . "// End -->\n" . "</script>\n";
        }
    }
}
/**
 * Displays error message and URL to message listing
 *
 * Fifth argument ($color array) is removed in 1.5.2.
 * @param string $message error message
 * @param string $mailbox mailbox name
 * @param integer $sort sort order
 * @param integer $startMessage first message
 * @since 1.0
 */
function error_message($message, $mailbox, $sort, $startMessage)
{
    $urlMailbox = urlencode($mailbox);
    $link = array('URL' => sqm_baseuri() . "src/right_main.php?sort={$sort}&amp;startMessage={$startMessage}&amp;mailbox={$urlMailbox}", 'TEXT' => sprintf(_("Click here to return to %s"), strtoupper($mailbox) == 'INBOX' ? _("INBOX") : sm_encode_html_special_chars(imap_utf7_decode_local($mailbox))));
    error_box($message, $link);
}
require_once SM_PATH . 'functions/html.php';
require_once SM_PATH . 'functions/global.php';
require_once SM_PATH . 'functions/imap_general.php';
require_once SM_PATH . 'functions/forms.php';
/**
 * $squirrelmail_language is set by a cookie when the user selects
 * language and logs out
 */
set_up_language($squirrelmail_language, TRUE, TRUE);
/**
 * Find out the base URI to set cookies.
 */
if (!function_exists('sqm_baseuri')) {
    require_once SM_PATH . 'functions/display_messages.php';
}
$base_uri = sqm_baseuri();
/*
 * In case the last session was not terminated properly, make sure
 * we get a new one.
 */
sqsession_destroy();
header('Pragma: no-cache');
/**
 * This detects if the IMAP server has logins disabled, and if so, 
 * squelches the display of the login form and puts up a message
 * explaining the situation.
 */
if ($imap_auth_mech == 'login') {
    $imap = sqimap_create_stream($imapServerAddress, $imapPort, $use_imap_tls);
    $logindisabled = sqimap_capability($imap, 'LOGINDISABLED');
    sqimap_logout($imap);
Exemple #8
0
" />
   <?php 
    echo '<input type="submit" value="' . _("Cancel / Done") . "\" />\n";
}
?>
</form>
</td>
<td align="right" valign="top">
<?php 
if ($spamcop_method == 'thorough_email' || $spamcop_method == 'quick_email') {
    if ($spamcop_method == 'thorough_email') {
        $report_email = 'submit.' . $spamcop_id . '@spam.spamcop.net';
    } else {
        $report_email = 'quick.' . $spamcop_id . '@spam.spamcop.net';
    }
    $form_action = sqm_baseuri() . 'src/compose.php';
    ?>
  <form method="post" action="<?php 
    echo $form_action;
    ?>
">
  <input type="hidden" name="mailbox" value="<?php 
    echo htmlspecialchars($mailbox);
    ?>
" />
  <input type="hidden" name="spamcop_is_composing" value="<?php 
    echo htmlspecialchars($passed_id);
    ?>
" />
  <input type="hidden" name="send_to" value="<?php 
    echo htmlspecialchars($report_email);
Exemple #9
0
$media_popup = getPref($data_dir, $username, 'newmail_popup');
$media_allbox = getPref($data_dir, $username, 'newmail_allbox');
$media_recent = getPref($data_dir, $username, 'newmail_recent');
$media_changetitle = getPref($data_dir, $username, 'newmail_changetitle');
$newmail_popup_height = getPref($data_dir, $username, 'newmail_popup_height', 130);
$newmail_popup_width = getPref($data_dir, $username, 'newmail_popup_width', 200);
$media = getPref($data_dir, $username, 'newmail_media', '(none)');
// Set $allowsound to false if you don't want sound files available
$allowsound = "true";
echo html_tag('table', '', 'center', $color[0], 'width="95%" cellpadding="1" cellspacing="0" border="0"') . "\n" . html_tag('tr') . "\n" . html_tag('td', '', 'center') . '<b>' . _("Options") . ' - ' . _("New Mail Notification") . "</b><br />\n" . html_tag('table', '', '', '', 'width="100%" cellpadding="5" cellspacing="0" border="0"') . "\n" . html_tag('tr') . "\n" . html_tag('td', '', 'left', $color[4]) . "<br />\n";
echo html_tag('p', sprintf(_("The %s option will check ALL of your folders for unseen mail, not just the inbox for notification."), '&quot;' . _("Check all boxes, not just INBOX") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Selecting the %s option will enable the showing of a popup window when unseen mail is in your folders (requires JavaScript)."), '&quot;' . _("Show popup window on new mail") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Use the %s option to only check for messages that are recent. Recent messages are those that have just recently showed up and have not been \"viewed\" or checked yet. This can prevent being continuously annoyed by sounds or popups for unseen mail."), '&quot;' . _("Count only messages that are RECENT") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Selecting the %s option will change the title in some browsers to let you know when you have new mail (requires JavaScript). This will always tell you if you have new mail, even if you have %s enabled."), '&quot;' . _("Change title on supported browsers") . '&quot;', '&quot;' . _("Count only messages that are RECENT") . '&quot;')) . "\n";
if ($allowsound == "true") {
    echo html_tag('p', sprintf(_("Select %s to turn on playing a media file when unseen mail is in your folders. When enabled, you can specify the media file to play in the provided file box."), '&quot;' . _("Enable Media Playing") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Select from the list of %s the media file to play when new mail arrives. If no file is specified, %s, no sound will be used."), '&quot;' . _("Select server file") . '&quot;', '&quot;' . _("(none)") . '&quot;')) . "\n";
}
echo '</td></tr>' . html_tag('tr') . html_tag('td', '', 'center', $color[4]) . "\n" . '<hr style="width: 25%; height: 1px;" />' . "\n";
echo '<form action="' . sqm_baseuri() . 'src/options.php" method="post">' . "\n" . html_tag('table', '', '', '', 'width="100%" cellpadding="5" cellspacing="0" border="0"') . "\n";
// Option: media_allbox
echo html_tag('tr') . html_tag('td', _("Check all boxes, not just INBOX") . ':', 'right', '', 'nowrap') . html_tag('td', '', 'left') . '<input type="checkbox" ';
if ($media_allbox == 'on') {
    echo 'checked="checked" ';
}
echo 'name="media_allbox" /></td></tr>' . "\n";
// Option: media_recent
echo html_tag('tr') . html_tag('td', _("Count only messages that are RECENT") . ':', 'right', '', 'nowrap') . html_tag('td', '', 'left') . '<input type="checkbox" ';
if ($media_recent == 'on') {
    echo 'checked="checked" ';
}
echo 'name="media_recent" /></td></tr>' . "\n";
// Option: media_changetitle
echo html_tag('tr') . html_tag('td', _("Change title on supported browsers") . ':', 'right', '', 'nowrap') . html_tag('td', '', 'left') . '<input type="checkbox" ';
if ($media_changetitle == 'on') {
Exemple #10
0
if ($aMailbox['EXISTS'] > 0) {
    $aTemplateVars = showMessagesForMailbox($imapConnection, $aMailbox, $aProps, $iError);
    if ($iError) {
    }
    foreach ($aTemplateVars as $k => $v) {
        $oTemplate->assign($k, $v);
    }
    /*
     * TODO: To many config related vars. We should move all config related vars to
     * one single associative array and assign that to the template
     */
    $oTemplate->assign('page_selector', $page_selector);
    $oTemplate->assign('page_selector_max', $page_selector_max);
    $oTemplate->assign('compact_paginator', $compact_paginator);
    $oTemplate->assign('javascript_on', checkForJavascript());
    $oTemplate->assign('base_uri', sqm_baseuri());
    $oTemplate->assign('enablesort', isset($aProps['config']['enablesort']) ? $aProps['config']['enablesort'] : false);
    $oTemplate->assign('icon_theme_path', $icon_theme_path);
    $oTemplate->assign('aOrder', array_keys($aColumns));
    $oTemplate->assign('alt_index_colors', isset($alt_index_colors) ? $alt_index_colors : false);
    $oTemplate->assign('color', $color);
    $oTemplate->assign('align', $align);
    $oTemplate->assign('checkall', $checkall);
    $oTemplate->assign('preselected', $preselected);
    global $show_personal_names;
    $oTemplate->assign('show_personal_names', $show_personal_names);
    global $accesskey_mailbox_toggle_selected, $accesskey_mailbox_thread;
    $oTemplate->assign('accesskey_mailbox_toggle_selected', $accesskey_mailbox_toggle_selected);
    $oTemplate->assign('accesskey_mailbox_thread', $accesskey_mailbox_thread);
    $oTemplate->display('message_list.tpl');
} else {
Exemple #11
0
/**
 * Detects used media type and creates all need tags
 * @param string $newmail_media
 * @return string html tags with media objects
 */
function newmail_create_media_tags($newmail_media)
{
    global $newmail_mmedia, $newmail_userfile_type;
    if (preg_match("/^mmedia_+/", $newmail_media)) {
        $ret_media = "<!-- newmail mmedia option -->\n";
        // remove mmedia key
        $newmail_mmedia_short = preg_replace("/^mmedia_/", '', $newmail_media);
        // check if media option is not removed
        if (isset($newmail_mmedia[$newmail_mmedia_short])) {
            $ret_media .= newmail_media_objects($newmail_mmedia_short, $newmail_mmedia[$newmail_mmedia_short]['types'], sqm_baseuri() . 'plugins/newmail/media/', $newmail_mmedia[$newmail_mmedia_short]['args']);
        }
        $ret_media .= "<!-- end of newmail mmedia option -->\n";
    } elseif ($newmail_media == '(userfile)') {
        $ret_media = "<!-- newmail usermedia option -->\n";
        $ret_media .= newmail_media_objects('loadfile.php', array($newmail_userfile_type), sqm_baseuri() . 'plugins/newmail/', array('width' => 0, 'height' => 0), '', false);
        $ret_media .= "<!-- end of newmail usermedia option -->\n";
    } else {
        $ret_media = "<!-- newmail sounds from sounds/*.wav -->\n";
        $ret_media .= newmail_media_objects(basename($newmail_media), array(SM_NEWMAIL_FILETYPE_WAV), sqm_baseuri() . 'plugins/newmail/sounds/', array('width' => 0, 'height' => 0), '', false);
        $ret_media .= "<!-- end of newmail sounds from sounds/*.wav -->\n";
    }
    return $ret_media;
}
Exemple #12
0
/**
 * This function converts cid: url's into the ones that can be viewed in
 * the browser.
 *
 * @param  $message  the message object
 * @param  $id       the message id
 * @param  $cidurl   the cid: url.
 * @param  $mailbox  the message mailbox
 * @return           a string with a http-friendly url
 */
function sq_cid2http($message, $id, $cidurl, $mailbox)
{
    /**
     * Get rid of quotes.
     */
    $quotchar = substr($cidurl, 0, 1);
    if ($quotchar == '"' || $quotchar == "'") {
        $cidurl = str_replace($quotchar, "", $cidurl);
    } else {
        $quotchar = '';
    }
    $cidurl = substr(trim($cidurl), 4);
    $match_str = '/\\{.*?\\}\\//';
    $str_rep = '';
    $cidurl = preg_replace($match_str, $str_rep, $cidurl);
    $linkurl = find_ent_id($cidurl, $message);
    /* in case of non-safe cid links $httpurl should be replaced by a sort of
       unsafe link image */
    $httpurl = '';
    /**
     * This is part of a fix for Outlook Express 6.x generating
     * cid URLs without creating content-id headers. These images are
     * not part of the multipart/related html mail. The html contains
     * <img src="cid:{some_id}/image_filename.ext"> references to
     * attached images with as goal to render them inline although
     * the attachment disposition property is not inline.
     */
    if (empty($linkurl)) {
        if (preg_match('/{.*}\\//', $cidurl)) {
            $cidurl = preg_replace('/{.*}\\//', '', $cidurl);
            if (!empty($cidurl)) {
                $linkurl = find_ent_id($cidurl, $message);
            }
        }
    }
    if (!empty($linkurl)) {
        $httpurl = $quotchar . sqm_baseuri() . 'src/download.php?absolute_dl=true&amp;' . "passed_id={$id}&amp;mailbox=" . urlencode($mailbox) . '&amp;ent_id=' . $linkurl . $quotchar;
    } else {
        /**
         * If we couldn't generate a proper img url, drop in a blank image
         * instead of sending back empty, otherwise it causes unusual behaviour
         */
        $httpurl = $quotchar . SM_PATH . 'images/blank.png' . $quotchar;
    }
    return $httpurl;
}
Exemple #13
0
</b></div>
   </td></tr></table>

   <p><?php 
echo _("Your server options are as follows:");
?>
</p>

   <ul>
<?php 
translate_showtrad();
?>
   </ul>
   <p>
<?php 
echo _("You also decide if you want the translation box displayed, and where it will be located.") . '<form action="' . sqm_baseuri() . 'src/options.php" method="post">' . '<input type="hidden" name="optmode" value="submit" />' . '<input type="hidden" name="optpage" value="translate" />' . '<table border="0" cellpadding="0" cellspacing="2">' . '<tr><td align="right" style="white-space: nowrap;">' . _("Select your translator:") . '</td>' . '<td><select name="translate_translate_server">';
translate_showoption();
echo '</select>' . '</td></tr>' . '<tr>' . html_tag('td', _("When reading:"), 'right', '', 'style="white-space: nowrap;"') . '<td><input type="checkbox" name="translate_translate_show_read"';
if ($translate_show_read) {
    echo ' checked="checked"';
}
echo ' /> - ' . _("Show translation box") . ' <select name="translate_translate_location">';
translate_showoption_internal('location', 'left', _("to the left"));
translate_showoption_internal('location', 'center', _("in the center"));
translate_showoption_internal('location', 'right', _("to the right"));
echo '</select><br />' . '<input type="checkbox" name="translate_translate_same_window"';
if ($translate_same_window) {
    echo ' checked="checked"';
}
echo ' /> - ' . _("Translate inside the SquirrelMail frames") . "</td></tr>\n";
if (!$disable_compose_translate) {
Exemple #14
0
global $plugins;
if (!in_array('newmail', $plugins)) {
    exit;
}
/** Plugin functions (also loads plugin's config) */
include_once SM_PATH . 'plugins/newmail/functions.php';
include_once SM_PATH . 'functions/forms.php';
displayPageHeader($color);
//FIXME: Remove all HTML from core - put this all into a template file
echo html_tag('table', '', 'center', $color[0], 'width="95%" cellpadding="1" cellspacing="0" border="0"') . "\n" . html_tag('tr') . "\n" . html_tag('td', '', 'center') . '<b>' . _("Options") . ' - ' . _("New Mail Notification") . "</b><br />\n" . html_tag('table', '', '', '', 'width="100%" cellpadding="5" cellspacing="0" border="0"') . "\n" . html_tag('tr') . "\n" . html_tag('td', '', 'left', $color[4]) . "<br />\n";
echo html_tag('p', sprintf(_("Based on the Folder Preferences option %s, you can be notified when new messages arrive in your account."), '&quot;' . _("Enable Unread Message Notification") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Selecting the %s option will enable the showing of a popup window when unseen mail is in one of your folders (requires JavaScript)."), '&quot;' . _("Show popup window on new mail") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Use the %s option to only check for messages that are recent. Recent messages are those that have just recently showed up and have not been \"viewed\" or checked yet. This can prevent being continuously annoyed by sounds or popups for unseen mail."), '&quot;' . _("Count only messages that are RECENT") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Selecting the %s option will change the browser title bar to let you know when you have new mail (requires JavaScript and may only work in some browsers). This will always tell you if you have new mail, even if you have %s enabled."), '&quot;' . _("Change title on supported browsers") . '&quot;', '&quot;' . _("Count only messages that are RECENT") . '&quot;')) . "\n";
if ($newmail_allowsound) {
    echo html_tag('p', sprintf(_("Select %s to turn on playing a media file when unseen mail is in your folders. When enabled, you can specify the media file to play in the provided file box."), '&quot;' . _("Enable Media Playing") . '&quot;')) . "\n" . html_tag('p', sprintf(_("Select from the list of %s the media file to play when new mail arrives. If no file is specified, %s, no sound will be used."), '&quot;' . _("Select server file") . '&quot;', '&quot;' . _("(none)") . '&quot;')) . "\n";
}
echo '</td></tr>' . html_tag('tr') . html_tag('td', '', 'center', $color[4]) . "\n" . '<hr style="width: 25%; height: 1px;" />' . "\n";
echo '<form action="' . sqm_baseuri() . 'src/options.php" method="post" enctype="multipart/form-data">' . "\n" . '<input type="hidden" name="smtoken" value="' . sm_generate_security_token() . '">' . "\n" . html_tag('table', '', '', '', 'width="100%" cellpadding="5" cellspacing="0" border="0"') . "\n";
/* newmail_unseen_notify */
$newmail_unseen_opts = array(0 => _("Follow folder preferences"), SMPREF_UNSEEN_INBOX => _("INBOX"), SMPREF_UNSEEN_ALL => _("All folders"), SMPREF_UNSEEN_SPECIAL => _("Special folders"), SMPREF_UNSEEN_NORMAL => _("Regular folders"));
echo html_tag('tr', html_tag('td', _("Check for new messages in:"), 'right', '', 'style="white-space: nowrap;"') . html_tag('td', addSelect('newmail_unseen_notify', $newmail_unseen_opts, $newmail_unseen_notify, true), 'left'));
// Option: media_recent
echo html_tag('tr') . html_tag('td', '<label for="media_recent">' . _("Count only messages that are RECENT") . ':</label>', 'right', '', 'style="white-space: nowrap;"') . html_tag('td', '', 'left') . '<input type="checkbox" ';
if ($newmail_recent == 'on') {
    echo 'checked="checked" ';
}
echo 'name="media_recent" id="media_recent" /></td></tr>' . "\n";
// Option: media_changetitle
echo html_tag('tr') . html_tag('td', '<label for="media_changetitle">' . _("Change title on supported browsers") . ':</label>', 'right', '', 'style="white-space: nowrap;"') . html_tag('td', '', 'left') . '<input type="checkbox" ';
if ($newmail_changetitle == 'on') {
    echo 'checked="checked" ';
}
echo 'name="media_changetitle" id="media_changetitle" />&nbsp;<small><label for="media_changetitle">(' . _("requires JavaScript to work") . ')</label></small></td></tr>' . "\n";
Exemple #15
0
/**
 * Build a page (pagination) link for use with the address book list page
 *
 * @param int    $page_number       The page number for the link
 * @param string $text              The link text
 * @param array  $current_page_args All known query string arguments
 *                                  for the current page request; structured
 *                                  as an associative array of key/value pairs
 *
 */
function make_abook_paginator_link($page_number, $text, $current_page_args)
{
    $uri = sqm_baseuri() . 'src/addressbook.php';
    $current_page_args['page_number'] = $page_number;
    $uri = set_uri_vars($uri, $current_page_args, FALSE);
    return create_hyperlink($uri, $text);
}