Add link to message subjects (#1484257); don't make selected list items bold; remove duplicate function
| | |
| | | } |
| | | |
| | | |
| | | // compose a URL to the given action |
| | | function rcmail_self_url($action, $p=array(), $task=null) |
| | | /** |
| | | * Compose an URL for a specific action |
| | | * |
| | | * @param string Request action |
| | | * @param array More URL parameters |
| | | * @param string Request task (omit if the same) |
| | | * @return The application URL |
| | | */ |
| | | function rcmail_url($action, $p=array(), $task=null) |
| | | { |
| | | global $MAIN_TASKS, $COMM_PATH; |
| | | $qstring = ''; |
| | |
| | | function strip_newlines($str) |
| | | { |
| | | return preg_replace('/[\r\n]/', '', $str); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Compose an URL for a specific action |
| | | * |
| | | * @param string Request action |
| | | * @param array More URL parameters |
| | | * @return The application URL |
| | | */ |
| | | function rcmail_url($action, $param=NULL) |
| | | { |
| | | $url = $GLOBALS['COMM_PATH'] . '&'.$action; |
| | | |
| | | if (is_array($param)) |
| | | foreach ($param as $p => $val) |
| | | $url .= sprintf('&%s=%s', urlencode($p), urlencode($val)); |
| | | |
| | | return $url; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // make valid href to specific buttons |
| | | if (in_array($attrib['command'], $MAIN_TASKS)) |
| | | $attrib['href'] = Q(rcmail_self_url(null, null, $attrib['command'])); |
| | | $attrib['href'] = Q(rcmail_url(null, null, $attrib['command'])); |
| | | else if (in_array($attrib['command'], $a_static_commands)) |
| | | $attrib['href'] = Q(rcmail_self_url($attrib['command'])); |
| | | $attrib['href'] = Q(rcmail_url($attrib['command'])); |
| | | } |
| | | |
| | | // overwrite attributes |
| | |
| | | |
| | | // get subjects of selectedd messages |
| | | var names = ''; |
| | | var c, subject, obj; |
| | | var c, node, subject, obj; |
| | | for(var n=0; n<this.selection.length; n++) |
| | | { |
| | | if (n>12) // only show 12 lines |
| | |
| | | subject = ''; |
| | | |
| | | for(c=0; c<obj.childNodes.length; c++) |
| | | if (!subject && obj.childNodes[c].nodeName=='TD' && obj.childNodes[c].firstChild && obj.childNodes[c].firstChild.nodeType==3) |
| | | if (obj.childNodes[c].nodeName=='TD' && (node = obj.childNodes[c].firstChild) && (node.nodeType==3 || node.nodeName=='A')) |
| | | { |
| | | subject = obj.childNodes[c].firstChild.data; |
| | | subject = node.nodeType==3 ? node.data : node.innerHTML; |
| | | names += (subject.length > 50 ? subject.substring(0, 50)+'...' : subject) + '<br />'; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | $out .= sprintf($line_templ, |
| | | 'rcmli'.$local_id, |
| | | !$current ? 'selected' : '', |
| | | Q(rcmail_self_url('list', array('_source' => 0))), |
| | | Q(rcmail_url('list', array('_source' => 0))), |
| | | JS_OBJECT_NAME, |
| | | $local_id, |
| | | JS_OBJECT_NAME, |
| | |
| | | $out .= sprintf($line_templ, |
| | | 'rcmli'.$dom_id, |
| | | $current == $id ? 'selected' : '', |
| | | Q(rcmail_self_url('list', array('_source' => $id))), |
| | | Q(rcmail_url('list', array('_source' => $id))), |
| | | JS_OBJECT_NAME, |
| | | $js_id, |
| | | JS_OBJECT_NAME, |
| | |
| | | $mailto_str = join(', ', $mailto); |
| | | $mailto_id = substr(md5($mailto_str), 0, 16); |
| | | $_SESSION['mailto'][$mailto_id] = $mailto_str; |
| | | $OUTPUT->command('redirect', rcmail_self_url('compose', array('_mailto' => $mailto_id), 'mail')); |
| | | $OUTPUT->command('redirect', rcmail_url('compose', array('_mailto' => $mailto_id), 'mail')); |
| | | } |
| | | else |
| | | $OUTPUT->show_message('nocontactsfound', 'warning'); |
| | |
| | | |
| | | // define url for getting message parts |
| | | if (strlen($_GET['_uid'])) |
| | | $GET_URL = sprintf('%s&_action=get&_mbox=%s&_uid=%d', $COMM_PATH, $IMAP->get_mailbox_name(), get_input_value('_uid', RCUBE_INPUT_GET)); |
| | | $GET_URL = rcmail_url('get', array('_mbox'=>$IMAP->get_mailbox_name(), '_uid'=>get_input_value('_uid', RCUBE_INPUT_GET))); |
| | | |
| | | |
| | | // set current mailbox in client environment |
| | |
| | | $zebra_class, |
| | | $unread_count ? ' unread' : '', |
| | | $folder['id']==$mbox_name ? ' selected' : '', |
| | | Q(rcmail_self_url('', array('_mbox' => $folder['id']))), |
| | | Q(rcmail_url('', array('_mbox' => $folder['id']))), |
| | | JS_OBJECT_NAME, |
| | | $js_name, |
| | | JS_OBJECT_NAME, |
| | |
| | | $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); |
| | | $a_sort_cols = array('subject', 'date', 'from', 'to', 'size'); |
| | | |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | |
| | | // show 'to' instead of from in sent messages |
| | | if (($IMAP->get_mailbox_name()==$CONFIG['sent_mbox'] || $IMAP->get_mailbox_name()==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols)) |
| | | if (($mbox==$CONFIG['sent_mbox'] || $mbox==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols)) |
| | | && !array_search('to', $a_show_cols)) |
| | | $a_show_cols[$f] = 'to'; |
| | | |
| | |
| | | // just add a link tag to the header |
| | | else |
| | | { |
| | | $col_name = sprintf('<a href="./#sort" onclick="return %s.command(\'sort\',\'%s\',this)" title="%s">%s</a>', |
| | | $col_name = sprintf( |
| | | '<a href="./#sort" onclick="return %s.command(\'sort\',\'%s\',this)" title="%s">%s</a>', |
| | | JS_OBJECT_NAME, |
| | | $col, |
| | | rcube_label('sortby'), |
| | |
| | | $cont = Q(rcmail_address_string($header->$col, 3, $attrib['addicon']), 'show'); |
| | | else if ($col=='subject') |
| | | { |
| | | $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; |
| | | $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid'; |
| | | $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset)); |
| | | if (empty($cont)) $cont = Q(rcube_label('nosubject')); |
| | | $cont = sprintf('<a href="%s" onclick="return false">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); |
| | | } |
| | | else if ($col=='size') |
| | | $cont = show_bytes($header->$col); |
| | |
| | | global $CONFIG, $IMAP, $OUTPUT; |
| | | |
| | | $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); |
| | | $mbox = $IMAP->get_mailbox_name(); |
| | | |
| | | // show 'to' instead of from in sent messages |
| | | if (($IMAP->get_mailbox_name() == $CONFIG['sent_mbox'] || $IMAP->get_mailbox_name() == $CONFIG['drafts_mbox']) |
| | | if (($mbox == $CONFIG['sent_mbox'] || $mbox == $CONFIG['drafts_mbox']) |
| | | && (($f = array_search('from', $a_show_cols)) !== false) && array_search('to', $a_show_cols) === false) |
| | | $a_show_cols[$f] = 'to'; |
| | | |
| | |
| | | $cont = Q(rcmail_address_string($header->$col, 3), 'show'); |
| | | else if ($col=='subject') |
| | | { |
| | | $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; |
| | | $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid'; |
| | | $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset)); |
| | | if (!$cont) $cont = Q(rcube_label('nosubject')); |
| | | $cont = sprintf('<a href="%s" onclick="return false">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); |
| | | } |
| | | else if ($col=='size') |
| | | $cont = show_bytes($header->$col); |
| | |
| | | |
| | | table.records-table tr.selected td |
| | | { |
| | | font-weight: bold; |
| | | color: #FFFFFF; |
| | | background-color: #CC3333; |
| | | } |
| | |
| | | |
| | | table.records-table tr.unfocused td |
| | | { |
| | | font-weight: bold; |
| | | color: #FFFFFF; |
| | | background-color: #929292; |
| | | } |
| | |
| | | } |
| | | |
| | | #messagelist thead tr td a, |
| | | #messagelist thead tr td a:hover |
| | | #messagelist tbody tr td a |
| | | { |
| | | display: block; |
| | | width: auto !important; |
| | |
| | | text-overflow: ellipsis; |
| | | border-bottom: 1px solid #EBEBEB; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | #messagelist tbody tr td a |
| | | { |
| | | color: #000; |
| | | } |
| | | |
| | | #messagelist col |
| | |
| | | |
| | | #messagelist tr.selected td |
| | | { |
| | | font-weight: bold; |
| | | color: #FFFFFF; |
| | | background-color: #CC3333; |
| | | } |
| | | |
| | | #messagelist tr.unfocused td |
| | | { |
| | | font-weight: bold; |
| | | color: #FFFFFF; |
| | | background-color: #929292; |
| | | } |
| | | |
| | | #messagelist tr.selected td a.rcmContactAddress |
| | | #messagelist tr.selected td a |
| | | { |
| | | color: #FFFFFF; |
| | | } |
| | | |
| | | #messagelist tr.unfocused td a.rcmContactAddress |
| | | #messagelist tr.unfocused td a |
| | | { |
| | | color: #FFFFFF; |
| | | } |
| | | |
| | | #messagelist tr.deleted td a.rcmContactAddress |
| | | #messagelist tr.deleted td a |
| | | { |
| | | color: #CCCCCC; |
| | | } |