/**
 * List search results
 * @param array $res Array containing results of search
 * @param bool $includesource If true, adds backend column to address listing
 */
function addr_display_result($res, $includesource = true)
{
    global $color, $javascript_on, $PHP_SELF, $squirrelmail_language;
    if (sizeof($res) <= 0) {
        return;
    }
    echo addForm($PHP_SELF, 'POST', 'addrbook') . addHidden('html_addr_search_done', 'true');
    addr_insert_hidden();
    $line = 0;
    if ($javascript_on) {
        print '<script language="JavaScript" type="text/javascript">' . "\n<!-- \n" . "function CheckAll(ch) {\n" . "   for (var i = 0; i < document.addrbook.elements.length; i++) {\n" . "       if( document.addrbook.elements[i].type == 'checkbox' &&\n" . "           document.addrbook.elements[i].name.substr(0,16) == 'send_to_search['+ch ) {\n" . "           document.addrbook.elements[i].checked = !(document.addrbook.elements[i].checked);\n" . "       }\n" . "   }\n" . "}\n" . "//-->\n" . "</script>\n";
        $chk_all = '<a href="#" onClick="CheckAll(\'T\');">' . _("All") . '</a>&nbsp;<font color="' . $color[9] . '">' . _("To") . '</font>' . '&nbsp;&nbsp;' . '<a href="#" onClick="CheckAll(\'C\');">' . _("All") . '</a>&nbsp;<font color="' . $color[9] . '">' . _("Cc") . '</font>' . '&nbsp;&nbsp;' . '<a href="#" onClick="CheckAll(\'B\');">' . _("All") . '</a>';
    } else {
        // check_all links are implemented only in JavaScript. disable links in js=off environment.
        $chk_all = '';
    }
    echo html_tag('table', '', 'center', '', 'border="0" width="98%"') . html_tag('tr', '', '', $color[9]) . html_tag('th', '&nbsp;' . $chk_all, 'left') . html_tag('th', '&nbsp;' . _("Name"), 'left') . html_tag('th', '&nbsp;' . _("E-mail"), 'left') . html_tag('th', '&nbsp;' . _("Info"), 'left');
    if ($includesource) {
        echo html_tag('th', '&nbsp;' . _("Source"), 'left', '', 'width="10%"');
    }
    echo "</tr>\n";
    foreach ($res as $row) {
        $email = AddressBook::full_address($row);
        if ($line % 2) {
            $tr_bgcolor = $color[12];
        } else {
            $tr_bgcolor = $color[4];
        }
        if ($squirrelmail_language == 'ja_JP') {
            echo html_tag('tr', '', '', $tr_bgcolor, 'nowrap') . html_tag('td', '<input type="checkbox" name="send_to_search[T' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("To") . '&nbsp;' . '<input type="checkbox" name="send_to_search[C' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("Cc") . '&nbsp;' . '<input type="checkbox" name="send_to_search[B' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("Bcc") . '&nbsp;', 'center', '', 'width="5%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap');
        } else {
            echo html_tag('tr', '', '', $tr_bgcolor, 'nowrap') . html_tag('td', addCheckBox('send_to_search[T' . $line . ']', FALSE, $email) . '&nbsp;' . _("To") . '&nbsp;' . addCheckBox('send_to_search[C' . $line . ']', FALSE, $email) . '&nbsp;' . _("Cc") . '&nbsp;' . addCheckBox('send_to_search[B' . $line . ']', FALSE, $email) . '&nbsp;' . _("Bcc") . '&nbsp;', 'center', '', 'width="5%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['name']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap');
        }
        if ($includesource) {
            echo html_tag('td', '&nbsp;' . $row['source'] . '&nbsp;', 'left', '', 'nowrap');
        }
        echo "</tr>\n";
        $line++;
    }
    if ($includesource) {
        $td_colspan = '5';
    } else {
        $td_colspan = '4';
    }
    echo html_tag('tr', html_tag('td', '<input type="submit" name="addr_search_done" value="' . _("Use Addresses") . '" /> ' . '<input type="submit" name="addr_search_cancel" value="' . _("Cancel") . '" />', 'center', '', 'colspan="' . $td_colspan . '"')) . '</table>' . addHidden('html_addr_search_done', '1') . '</form>';
}
    }
}
if ($default_sub_of_inbox == false) {
    echo '<option selected="selected" value="">[ ' . _("None") . " ]</option>\n";
} else {
    echo '<option value="">[ ' . _("None") . " ]</option>\n";
    $show_selected = array('inbox');
}
// Call sqimap_mailbox_option_list, using existing connection to IMAP server,
// the arrays of folders to include or skip (assembled above),
// use 'noinferiors' as a mailbox filter to leave out folders that can not contain other folders.
// use the long format to show subfolders in an intelligible way if parent is missing (special folder)
echo sqimap_mailbox_option_list($imapConnection, $show_selected, $skip_folders, $boxes, 'noinferiors', true);
echo "</select></tt>\n";
if ($show_contain_subfolders_option) {
    echo '<br />' . addCheckBox('contain_subs', FALSE, '1') . ' &nbsp;' . _("Let this folder contain subfolders") . '<br />';
}
echo "<input type=\"submit\" value=\"" . _("Create") . "\" />\n";
echo "</form></td></tr>\n";
echo html_tag('tr', html_tag('td', '&nbsp;', 'left', $color[4])) . "\n";
/** count special folders **/
// FIX ME, why not check if the folders are defined IMHO move_to_sent, move_to_trash has nothing todo with it
$count_special_folders = 0;
$num_max = 1;
if (strtolower($imap_server_type) == "courier" || $move_to_trash) {
    $num_max++;
}
if ($move_to_sent) {
    $num_max++;
}
if ($save_as_draft) {
Beispiel #3
0
/**
 * Returns a form to rejudge all judgings based on a (table,id)
 * pair. For example, to rejudge all for language 'java', call
 * as rejudgeForm('language', 'java').
 */
function rejudgeForm($table, $id)
{
    $ret = addForm('rejudge.php') . addHidden('table', $table) . addHidden('id', $id);
    $button = 'REJUDGE this submission';
    $question = "Rejudge submission s{$id}?";
    $disabled = false;
    $allbutton = false;
    // special case submission
    if ($table == 'submission') {
        // disable the form button if there are no valid judgings anyway
        // (nothing to rejudge) or if the result is already correct
        global $DB;
        $validresult = $DB->q('MAYBEVALUE SELECT result FROM judging WHERE
		                       submitid = %i AND valid = 1', $id);
        if (IS_ADMIN) {
            if (!$validresult) {
                $question = "Restart judging of PENDING submission s{$id}, " . 'are you sure?';
                $button = 'RESTART judging';
            } elseif ($validresult == 'correct') {
                $question = "Rejudge CORRECT submission s{$id}, " . 'are you sure?';
            }
        } else {
            if (!$validresult || $validresult == 'correct') {
                $disabled = true;
            }
        }
    } else {
        $button = "REJUDGE ALL for {$table} {$id}";
        $question = "Rejudge all submissions for this {$table}?";
        if (IS_ADMIN) {
            $allbutton = true;
        }
    }
    $ret .= '<input type="submit" value="' . htmlspecialchars($button) . '" ' . ($disabled ? 'disabled="disabled"' : 'onclick="return confirm(\'' . htmlspecialchars($question) . '\');"') . " />\n" . ($allbutton ? addCheckBox('include_all') . '<label for="include_all">include pending/correct submissions</label>' : '') . addCheckBox('full_rejudge') . '<label for="full_rejudge">create rejudging with reason: </label>' . addInput('reason', '', 0, 255) . addEndForm();
    return $ret;
}
Beispiel #4
0
<td><?php 
    echo addInputField('number', 'data[0][memlimit]', @$row['memlimit']);
    ?>
 kB (leave empty for default)</td></tr>

<tr><td><label for="data_0__outputlimit_">Output limit:</label></td>
<td><?php 
    echo addInputField('number', 'data[0][outputlimit]', @$row['outputlimit']);
    ?>
 kB (leave empty for default)</td></tr>

<tr><td><label for="data_0__problemtext_">Problem text:</label></td>
<td><?php 
    echo addFileField('data[0][problemtext]', 30, ' accept="text/plain,text/html,application/pdf"');
    if (!empty($row['problemtext_type'])) {
        echo addCheckBox('unset[0][problemtext]') . '<label for="unset_0__problemtext_">delete</label>';
    }
    ?>
</td></tr>

<tr><td><label for="data_0__special_run_">Run script:</label></td>
<td>
<?php 
    $execmap = $DB->q("KEYVALUETABLE SELECT execid,description FROM executable\n                   WHERE type = 'run' ORDER BY execid");
    $execmap = array('' => 'default') + $execmap;
    echo addSelect('data[0][special_run]', $execmap, @$row['special_run'], True);
    ?>
</td></tr>

<tr><td><label for="data_0__special_compare_">Compare script:</label></td>
<td>
Beispiel #5
0
         continue;
     }
     /* Check if this user is selected */
     $selected = in_array($row['backend'] . ':' . $row['nickname'], $defselected);
     if ($squirrelmail_language == 'ja_JP') {
         echo html_tag('tr', '', '', $tr_bgcolor);
         if ($abook->backends[$row['backend']]->writeable) {
             echo html_tag('td', '<small>' . addCheckBox('sel[' . $count . ']', $selected, $row['backend'] . ':' . $row['nickname'], ' id="' . $row['backend'] . '_' . urlencode($row['nickname']) . '"') . '</small>', 'center', '', 'valign="top" width="1%"');
         } else {
             echo html_tag('td', '&nbsp;', 'center', '', 'valign="top" width="1%"');
         }
         echo html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['nickname']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%" nowrap') . html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%" nowrap') . html_tag('td', '', 'left', '', 'valign="top" width="10%" nowrap') . '&nbsp;';
     } else {
         echo html_tag('tr', '', '', $tr_bgcolor);
         if ($abook->backends[$row['backend']]->writeable) {
             echo html_tag('td', '<small>' . addCheckBox('sel[' . $count . ']', $selected, $row['backend'] . ':' . $row['nickname'], ' id="' . $row['backend'] . '_' . urlencode($row['nickname']) . '"') . '</small>', 'center', '', 'valign="top" width="1%"');
         } else {
             echo html_tag('td', '&nbsp;', 'center', '', 'valign="top" width="1%"');
         }
         echo html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['nickname']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%" nowrap') . html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['name']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%" nowrap') . html_tag('td', '', 'left', '', 'valign="top" width="10%" nowrap') . '&nbsp;';
     }
     $email = $abook->full_address($row);
     echo addHidden($row['backend'] . ':' . $row['nickname'], rawurlencode($email)) . makeComposeLink('src/compose.php?send_to=' . rawurlencode($email), htmlspecialchars($row['email'])) . '&nbsp;</td>' . "\n" . html_tag('td', '&nbsp;<label for="' . $row['backend'] . '_' . urlencode($row['nickname']) . '">' . htmlspecialchars($row['label']) . '</label>&nbsp;', 'left', '', 'valign="top" width="10%"');
     // add extra column if third party backend needs it
     if ($abook->add_extra_field) {
         echo html_tag('td', '&nbsp;' . (isset($row['extra']) ? $row['extra'] : '') . '&nbsp;', 'left', '', 'valign="top" width="10%"');
     }
     echo "</tr>\n";
     $line++;
     $count++;
 }
/** Build the Exclude criteria checkbox
 */
function asearch_get_form_exclude($exclude, $row_num = 0)
{
    return function_exists('addCheckBox') ? addCheckBox('exclude[' . $row_num . ']', $exclude) : '<input type="checkbox" name="exclude[' . $row_num . ']"' . ($exclude ? ' checked="checked"' : '') . ' />';
}
/**
 * Displays message header row in messages list
 *
 * @param  array $aMsg contains all message related parameters
 * @return void
 */
function printMessageInfo($aMsg)
{
    // FIX ME, remove these globals as well by adding an array as argument for the user settings
    // specificly meant for header display
    global $checkall, $color, $default_use_priority, $message_highlight_list, $index_order, $truncate_sender, $email_address, $show_recipient_instead, $use_icons, $icon_theme;
    /* icons theming */
    $color_string = $color[4];
    // initialisation:
    $mailbox = $aMsg['MAILBOX'];
    $msg = $aMsg['HEADER'];
    $t = $aMsg['INDX'];
    $start_msg = $aMsg['PAGEOFFSET'];
    $last = $aMsg['LAST'];
    if (isset($aMsg['SEARCH']) && count($aMsg['SEARCH']) > 1) {
        $where = $aMsg['SEARCH'][0];
        $what = $aMsg['SEARCH'][1];
    } else {
        $where = false;
        $what = false;
    }
    $iIndent = $aMsg['INDENT'];
    $sSubject = isset($msg['SUBJECT']) && $msg['SUBJECT'] != '' ? $msg['SUBJECT'] : _("(no subject)");
    $sFrom = isset($msg['FROM']) ? $msg['FROM'] : _("Unknown sender");
    $sTo = isset($msg['TO']) ? $msg['TO'] : _("Unknown recipient");
    $sCc = isset($msg['CC']) ? $msg['CC'] : '';
    $aFlags = isset($msg['FLAGS']) ? $msg['FLAGS'] : array();
    $iPrio = isset($msg['PRIORITY']) ? $msg['PRIORITY'] : 3;
    $iSize = isset($msg['SIZE']) ? $msg['SIZE'] : 0;
    $sType0 = isset($msg['TYPE0']) ? $msg['TYPE0'] : 'text';
    $sType1 = isset($msg['TYPE1']) ? $msg['TYPE1'] : 'plain';
    if (isset($msg['INTERNALDATE'])) {
        $sDate = getDateString(getTimeStamp(explode(' ', $msg['INTERNALDATE'])));
    } else {
        $sDate = isset($msg['DATE']) ? getDateString(getTimeStamp(explode(' ', $msg['DATE']))) : '';
    }
    $iId = isset($msg['UID']) ? $msg['UID'] : false;
    if (!$iId) {
        return;
    }
    if ($GLOBALS['alt_index_colors']) {
        if (!($t % 2)) {
            if (!isset($color[12])) {
                $color[12] = '#EAEAEA';
            }
            $color_string = $color[12];
        }
    }
    $urlMailbox = urlencode($mailbox);
    // FIXME, foldertype should be set in right_main.php
    // in other words, handle as sent is obsoleted from now.
    // We replace that by providing an array to aMailbox with the to shown headers
    // that way we are free to show the user different layouts for different folders
    $bSentFolder = handleAsSent($mailbox);
    if (!$bSentFolder && $show_recipient_instead) {
        // If the From address is the same as $email_address, then handle as Sent
        $from_array = parseAddress($sFrom, 1);
        if (!isset($email_address)) {
            global $datadir, $username;
            $email_address = getPref($datadir, $username, 'email_address');
        }
        $bHandleAsSent = isset($from_array[0][0]) && $from_array[0][0] == $email_address;
    } else {
        $bHandleAsSent = $bSentFolder;
    }
    // If this is a Sent message, display To address instead of From
    if ($bHandleAsSent) {
        $sFrom = $sTo;
    }
    // Passing 1 below results in only 1 address being parsed, thus defeating the following code
    $sFrom = parseAddress($sFrom);
    /*
     * This is done in case you're looking into Sent folders,
     * because you can have multiple receivers.
     */
    $senderNames = $sFrom;
    $senderName = '';
    $senderAddress = '';
    if (sizeof($senderNames)) {
        foreach ($senderNames as $senderNames_part) {
            if ($senderName != '') {
                $senderName .= ', ';
                $senderAddress .= ', ';
            }
            $sender_address_part = htmlspecialchars($senderNames_part[0]);
            $sender_name_part = str_replace('&nbsp;', ' ', decodeHeader($senderNames_part[1]));
            if ($sender_name_part) {
                $senderName .= $sender_name_part;
                $senderAddress .= $sender_name_part . ' <' . $sender_address_part . '>';
            } else {
                $senderName .= $sender_address_part;
                $senderAddress .= $sender_address_part;
            }
        }
    }
    // If Sent, prefix with To: but only if not Sent folder
    if ($bHandleAsSent ^ $bSentFolder) {
        $senderName = _("To") . ': ' . $senderName;
        $senderAddress = _("To") . ': ' . $senderAddress;
    }
    // this is a column property which can apply to multiple columns. Do not use vars for one column
    // only. instead we should use something like this:
    // 1ed column $aMailbox['columns']['SUBJECT'] value: aray with properties ...
    // 2ed column $aMailbox['columns']['FROM'] value: aray with properties ...
    //            NB in case of the sentfolder this could be the TO field
    // properties array example:
    //      'truncate' => length (0 is no truncate)
    //      'prefix    => if (x in b then do that )
    if ($truncate_sender > 0) {
        $senderName = truncateWithEntities($senderName, $truncate_sender);
    }
    $flag = $flag_end = $bold = $bold_end = $fontstr = $fontstr_end = $italic = $italic_end = '';
    $bold = '<b>';
    $bold_end = '</b>';
    foreach ($aFlags as $sFlag => $value) {
        switch ($sFlag) {
            case '\\flagged':
                if ($value) {
                    $flag = "<font color=\"{$color['2']}\">";
                    $flag_end = '</font>';
                }
                break;
            case '\\seen':
                if ($value) {
                    $bold = '';
                    $bold_end = '';
                }
                break;
            case '\\deleted':
                if ($value) {
                    $fontstr = "<font color=\"{$color['9']}\">";
                    $fontstr_end = '</font>';
                }
                break;
        }
    }
    if ($bHandleAsSent) {
        $italic = '<i>';
        $italic_end = '</i>';
    }
    if ($where && $what) {
        $searchstr = '&amp;where=' . $where . '&amp;what=' . $what;
    } else {
        $searchstr = '';
    }
    /*
     *  Message highlight code
     */
    $matches = array('TO' => 'sTo', 'CC' => 'sCc', 'FROM' => 'sFrom', 'SUBJECT' => 'sSubject');
    if (is_array($message_highlight_list) && count($message_highlight_list)) {
        $sTo = parseAddress($sTo);
        $sCc = parseAddress($sCc);
        foreach ($message_highlight_list as $message_highlight_list_part) {
            if (trim($message_highlight_list_part['value']) != '') {
                $high_val = strtolower($message_highlight_list_part['value']);
                $match_type = strtoupper($message_highlight_list_part['match_type']);
                if ($match_type == 'TO_CC') {
                    $match = array('TO', 'CC');
                } else {
                    $match = array($match_type);
                }
                foreach ($match as $match_type) {
                    switch ($match_type) {
                        case 'TO':
                        case 'CC':
                        case 'FROM':
                            foreach (${$matches}[$match_type] as $address) {
                                $address[0] = decodeHeader($address[0], true, false);
                                $address[1] = decodeHeader($address[1], true, false);
                                if (strstr('^^' . strtolower($address[0]), $high_val) || strstr('^^' . strtolower($address[1]), $high_val)) {
                                    $hlt_color = $message_highlight_list_part['color'];
                                    break 4;
                                }
                            }
                            break;
                        default:
                            $headertest = strtolower(decodeHeader(${$matches}[$match_type], true, false));
                            if (strstr('^^' . $headertest, $high_val)) {
                                $hlt_color = $message_highlight_list_part['color'];
                                break 3;
                            }
                            break;
                    }
                }
            }
        }
    }
    /* end Message highlight code */
    if (!isset($hlt_color)) {
        $hlt_color = $color_string;
    }
    $col = 0;
    $sSubject = str_replace('&nbsp;', ' ', decodeHeader($sSubject));
    $subject = processSubject($sSubject, $iIndent);
    echo html_tag('tr', '', '', '', 'valign="top"') . "\n";
    if (sizeof($index_order)) {
        foreach ($index_order as $index_order_part) {
            switch ($index_order_part) {
                case 1:
                    /* checkbox */
                    echo html_tag('td', addCheckBox("msg[{$t}]", $checkall, $iId), 'center', $hlt_color);
                    break;
                case 2:
                    /* from */
                    if ($senderAddress != $senderName) {
                        $senderAddress = strtr($senderAddress, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
                        $title = ' title="' . str_replace('"', "''", $senderAddress) . '"';
                    } else {
                        $title = '';
                    }
                    echo html_tag('td', $italic . $bold . $flag . $fontstr . $senderName . $fontstr_end . $flag_end . $bold_end . $italic_end, 'left', $hlt_color, $title);
                    break;
                case 3:
                    /* date */
                    if ($sDate == '') {
                        $sDate = _("Unknown date");
                    }
                    echo html_tag('td', $bold . $flag . $fontstr . $sDate . $fontstr_end . $flag_end . $bold_end, 'center', $hlt_color, 'nowrap');
                    break;
                case 4:
                    /* subject */
                    $td_str = $bold;
                    if ($iIndent) {
                        $td_str .= str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $iIndent);
                    }
                    $td_str .= '<a href="read_body.php?mailbox=' . $urlMailbox . '&amp;passed_id=' . $iId . '&amp;startMessage=' . $start_msg . $searchstr . '"';
                    $td_str .= ' ' . concat_hook_function('subject_link', array($start_msg, $searchstr));
                    if ($subject != $sSubject) {
                        $title = get_html_translation_table(HTML_SPECIALCHARS);
                        $title = array_flip($title);
                        $title = strtr($sSubject, $title);
                        $title = str_replace('"', "''", $title);
                        $td_str .= " title=\"{$title}\"";
                    }
                    $td_str .= ">{$flag}{$subject}{$flag_end}</a>{$bold_end}";
                    echo html_tag('td', $td_str, 'left', $hlt_color);
                    break;
                case 5:
                    /* flags */
                    // icon message markers
                    //
                    if ($use_icons && $icon_theme != 'none') {
                        $td_str = "<b><small>";
                        if (isset($aFlags['\\flagged']) && $aFlags['\\flagged'] == true) {
                            $td_str .= '<img src="' . SM_PATH . 'images/themes/' . $icon_theme . '/flagged.png" border="0" height="10" width="10" /> ';
                        }
                        if ($default_use_priority) {
                            if ($iPrio == 1 || $iPrio == 2) {
                                $td_str .= '<img src="' . SM_PATH . 'images/themes/' . $icon_theme . '/prio_high.png" border="0" height="10" width="5" /> ';
                            } else {
                                if ($iPrio == 5) {
                                    $td_str .= '<img src="' . SM_PATH . 'images/themes/' . $icon_theme . '/prio_low.png" border="0" height="10" width="5" /> ';
                                } else {
                                    $td_str .= '<img src="' . SM_PATH . 'images/themes/' . $icon_theme . '/transparent.png" border="0" width="5" /> ';
                                }
                            }
                        }
                        if ($sType1 == 'mixed') {
                            $td_str .= '<img src="' . SM_PATH . 'images/themes/' . $icon_theme . '/attach.png" border="0" height="10" width="6" />';
                        } else {
                            $td_str .= '<img src="' . SM_PATH . 'images/themes/' . $icon_theme . '/transparent.png" border="0" width="6" />';
                        }
                        $msg_icon = '';
                        if (!isset($aFlags['\\seen']) || $aFlags['\\seen'] == false) {
                            $msg_alt = '(' . _("New") . ')';
                            $msg_title = '(' . _("New") . ')';
                            $msg_icon .= SM_PATH . 'images/themes/' . $icon_theme . '/msg_new';
                        } else {
                            $msg_alt = '(' . _("Read") . ')';
                            $msg_title = '(' . _("Read") . ')';
                            $msg_icon .= SM_PATH . 'images/themes/' . $icon_theme . '/msg_read';
                        }
                        if (isset($aFlags['\\deleted']) && $aFlags['\\deleted'] == true) {
                            $msg_icon .= '_deleted';
                        }
                        if (isset($aFlags['\\answered']) && $aFlags['\\answered'] == true) {
                            $msg_alt = '(' . _("Answered") . ')';
                            $msg_title = '(' . _("Answered") . ')';
                            $msg_icon .= '_reply';
                        }
                        $td_str .= '<img src="' . $msg_icon . '.png" border="0" alt="' . $msg_alt . '" title="' . $msg_title . '" height="12" width="18" />';
                        $td_str .= '</small></b>';
                        echo html_tag('td', $td_str, 'right', $hlt_color, 'nowrap');
                    } else {
                        $stuff = false;
                        $td_str = "<b><small>";
                        if (isset($aFlags['\\answered']) && $aFlags['\\answered'] == true) {
                            $td_str .= _("A");
                            $stuff = true;
                        }
                        if ($sType1 == 'mixed') {
                            $td_str .= '+';
                            $stuff = true;
                        }
                        if ($default_use_priority) {
                            if ($iPrio == 1 || $iPrio == 2) {
                                $td_str .= "<font color=\"{$color['1']}\">!</font>";
                                $stuff = true;
                            }
                            if ($iPrio == 5) {
                                $td_str .= "<font color=\"{$color['8']}\">?</font>";
                                $stuff = true;
                            }
                        }
                        if (isset($aFlags['\\deleted']) && $aFlags['\\deleted'] == true) {
                            $td_str .= "<font color=\"{$color['1']}\">D</font>";
                            $stuff = true;
                        }
                        if (!$stuff) {
                            $td_str .= '&nbsp;';
                        }
                        $td_str .= '</small></b>';
                        echo html_tag('td', $td_str, 'center', $hlt_color, 'nowrap');
                    }
                    break;
                case 6:
                    /* size */
                    echo html_tag('td', $bold . $fontstr . show_readable_size($iSize) . $fontstr_end . $bold_end, 'right', $hlt_color);
                    break;
            }
            ++$col;
        }
    }
    /* html for separationlines between rows */
    if ($last) {
        echo '</tr>' . "\n";
    } else {
        echo '</tr>' . "\n" . '<tr><td colspan="' . $col . '" bgcolor="' . $color[0] . '" height="1"></td></tr>' . "\n";
    }
}
function showComposeButtonRow()
{
    global $use_javascript_addr_book, $save_as_draft, $default_use_priority, $mailprio, $default_use_mdn, $request_mdn, $request_dr, $data_dir, $username;
    echo '   <tr>' . "\n" . '      <td></td>' . "\n" . '      <td>' . "\n";
    if ($default_use_priority) {
        if (!isset($mailprio)) {
            $mailprio = '3';
        }
        echo '          ' . _("Priority") . addSelect('mailprio', array('1' => _("High"), '3' => _("Normal"), '5' => _("Low")), $mailprio, TRUE);
    }
    $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', $default_use_mdn);
    if ($default_use_mdn) {
        if ($mdn_user_support) {
            echo '          ' . _("Receipt") . ': ' . addCheckBox('request_mdn', $request_mdn == '1', '1') . _("On Read") . addCheckBox('request_dr', $request_dr == '1', '1') . _("On Delivery");
        }
    }
    echo '      </td>' . "\n" . '   </tr>' . "\n" . '   <tr>' . "\n" . '      <td></td>' . "\n" . '      <td>' . "\n" . '         <input type="submit" name="sigappend" value="' . _("Signature") . '" />' . "\n";
    if ($use_javascript_addr_book) {
        echo "         <script language=\"JavaScript\"><!--\n document.write(\"" . "            <input type=button value=\\\"" . _("Addresses") . "\\\" onclick=\\\"javascript:open_abook();\\\" />\");" . "            // --></script><noscript>\n" . '            <input type="submit" name="html_addr_search" value="' . _("Addresses") . '" />' . "         </noscript>\n";
    } else {
        echo '         <input type="submit" name="html_addr_search" value="' . _("Addresses") . '" />' . "\n";
    }
    if ($save_as_draft) {
        echo '         <input type="submit" name ="draft" value="' . _("Save Draft") . "\" />\n";
    }
    echo '         <input type="submit" name="send" value="' . _("Send") . '" />' . "\n";
    do_hook('compose_button_row');
    echo '      </td>' . "\n" . '   </tr>' . "\n\n";
}
         $tr_bgcolor = $color[12];
     } else {
         $tr_bgcolor = $color[4];
     }
     if ($squirrelmail_language == 'ja_JP') {
         echo html_tag('tr', '', '', $tr_bgcolor);
         if ($abook->backends[$row['backend']]->writeable) {
             echo html_tag('td', '<small>' . addCheckBox('sel[]', $selected, $row['backend'] . ':' . $row['nickname']) . '</small>', 'center', '', 'valign="top" width="1%"');
         } else {
             echo html_tag('td', '&nbsp;', 'center', '', 'valign="top" width="1%"');
         }
         echo html_tag('td', '&nbsp;' . htmlspecialchars($row['nickname']) . '&nbsp;', 'left', '', 'valign="top" width="1%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . '&nbsp;', 'left', '', 'valign="top" width="1%" nowrap') . html_tag('td', '', 'left', '', 'valign="top" width="1%" nowrap') . '&nbsp;';
     } else {
         echo html_tag('tr', '', '', $tr_bgcolor);
         if ($abook->backends[$row['backend']]->writeable) {
             echo html_tag('td', '<small>' . addCheckBox('sel[]', $selected, $row['backend'] . ':' . $row['nickname']) . '</small>', 'center', '', 'valign="top" width="1%"');
         } else {
             echo html_tag('td', '&nbsp;', 'center', '', 'valign="top" width="1%"');
         }
         echo html_tag('td', '&nbsp;' . htmlspecialchars($row['nickname']) . '&nbsp;', 'left', '', 'valign="top" width="1%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['name']) . '&nbsp;', 'left', '', 'valign="top" width="1%" nowrap') . html_tag('td', '', 'left', '', 'valign="top" width="1%" nowrap') . '&nbsp;';
     }
     $email = $abook->full_address($row);
     echo makeComposeLink('src/compose.php?send_to=' . rawurlencode($email), htmlspecialchars($row['email'])) . '&nbsp;</td>' . "\n" . html_tag('td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'valign="top" width="1%"');
     // add extra column if third party backend needs it
     if ($abook->add_extra_field) {
         echo html_tag('td', '&nbsp;' . (isset($row['extra']) ? $row['extra'] : '') . '&nbsp;', 'left', '', 'valign="top" width="1%"');
     }
     echo "</tr>\n";
     $line++;
 }
 /* End of list. Close table. */
Beispiel #10
0
 /**
  * Creates an associative edit list
  *
  * Note that multiple layout types are supported for this widget.
  * $this->layout_type must be one of the SMOPT_EDIT_LIST_LAYOUT_*
  * constants.
  *
  * @return string html formated list of edit fields and
  *                their associated controls
  */
 function createWidget_EditListAssociative()
 {
     global $oTemplate;
     switch ($this->size) {
         case SMOPT_SIZE_TINY:
             $height = 3;
             break;
         case SMOPT_SIZE_SMALL:
             $height = 8;
             break;
         case SMOPT_SIZE_MEDIUM:
             $height = 15;
             break;
         case SMOPT_SIZE_LARGE:
             $height = 25;
             break;
         case SMOPT_SIZE_HUGE:
             $height = 40;
             break;
         case SMOPT_SIZE_NORMAL:
         default:
             $height = 5;
     }
     // ensure correct format of current value(s)
     //
     if (empty($this->possible_values)) {
         $this->possible_values = array();
     }
     if (!is_array($this->possible_values)) {
         $this->possible_values = array($this->possible_values);
     }
     $oTemplate->assign('name', $this->name);
     $oTemplate->assign('current_value', $this->value);
     $oTemplate->assign('possible_values', $this->possible_values);
     $oTemplate->assign('poss_value_folders', $this->poss_value_folders);
     $oTemplate->assign('folder_filter', $this->folder_filter);
     $oTemplate->assign('use_input_widget', $this->use_add_widget);
     $oTemplate->assign('use_delete_widget', $this->use_delete_widget);
     $oTemplate->assign('checkbox_widget', addCheckBox('delete_' . $this->name, FALSE, SMPREF_YES, array_merge(array('id' => 'delete_' . $this->name), $this->aExtraAttribs)));
     //FIXME: $this->aExtraAttribs probably should only be used in one place
     $oTemplate->assign('input_key_widget', addInput('add_' . $this->name . '_key', '', 22, 0, $this->aExtraAttribs));
     $oTemplate->assign('input_value_widget', addInput('add_' . $this->name . '_value', '', 12, 0, $this->aExtraAttribs));
     $oTemplate->assign('select_height', $height);
     $oTemplate->assign('aAttribs', $this->aExtraAttribs);
     $oTemplate->assign('trailing_text', $this->trailing_text);
     switch ($this->layout_type) {
         case SMOPT_EDIT_LIST_LAYOUT_SELECT:
             return $oTemplate->fetch('edit_list_associative_widget.tpl');
         case SMOPT_EDIT_LIST_LAYOUT_LIST:
             return $oTemplate->fetch('edit_list_associative_widget_list_style.tpl');
         default:
             error_box(sprintf(_("Associative Edit List Layout Type '%s' Not Found"), $this->layout_type));
     }
 }
Beispiel #11
0
<tr><td>Enabled:</td>
<td><?php 
    echo addRadioButton('data[0][enabled]', !isset($row['']) || $row['enabled'], 1);
    ?>
 <label for="data_0__enabled_1">yes</label>
<?php 
    echo addRadioButton('data[0][enabled]', isset($row['enabled']) && !$row['enabled'], 0);
    ?>
 <label for="data_0__enabled_0">no</label></td></tr>
<?php 
    if ($cmd == 'add') {
        ?>
<tr><td></td>
<td><?php 
        echo addCheckBox('data[0][adduser]', true, 1);
        ?>
 <label for="data_0__adduser_">Add user for this team</label></td></tr>
<tr id="user_extra_data"><td><label for="data_0__mapping__1__extra__username_">Username:</label></td>
<td><?php 
        echo addInput('data[0][mapping][1][extra][username]', null, 8, 15, 'pattern="' . IDENTIFIER_CHARS . '+" title="Alphanumerics only" required');
        ?>
</td></tr>
<script type="text/javascript">
	$(function() {
		var show_hide_user_extra_data = function() {
			if ($('#data_0__adduser_:checked').val()) {
				$('#user_extra_data').show();
			} else {
				$('#user_extra_data').hide();
			}