Changeset 41bece1 in github


Ignore:
Timestamp:
May 17, 2007 2:41:24 PM (6 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
258f1e5
Parents:
5870871
Message:

Add link to message subjects (#1484257); don't make selected list items bold; remove duplicate function

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • program/include/main.inc

    rf115416 r41bece1  
    754754 
    755755 
    756 // compose a URL to the given action 
    757 function rcmail_self_url($action, $p=array(), $task=null) 
     756/** 
     757 * Compose an URL for a specific action 
     758 * 
     759 * @param string  Request action 
     760 * @param array   More URL parameters 
     761 * @param string  Request task (omit if the same) 
     762 * @return The application URL 
     763 */ 
     764function rcmail_url($action, $p=array(), $task=null) 
    758765{ 
    759766  global $MAIN_TASKS, $COMM_PATH; 
     
    11211128{ 
    11221129  return preg_replace('/[\r\n]/', '', $str); 
    1123 } 
    1124  
    1125  
    1126 /** 
    1127  * Compose an URL for a specific action 
    1128  * 
    1129  * @param string Request action 
    1130  * @param array  More URL parameters 
    1131  * @return The application URL 
    1132  */ 
    1133 function rcmail_url($action, $param=NULL) 
    1134 { 
    1135   $url = $GLOBALS['COMM_PATH'] . '&'.$action; 
    1136  
    1137   if (is_array($param)) 
    1138     foreach ($param as $p => $val) 
    1139       $url .= sprintf('&%s=%s', urlencode($p), urlencode($val)); 
    1140  
    1141   return $url; 
    11421130} 
    11431131 
  • program/include/rcmail_template.inc

    r7198044 r41bece1  
    564564      // make valid href to specific buttons 
    565565      if (in_array($attrib['command'], $MAIN_TASKS)) 
    566         $attrib['href'] = Q(rcmail_self_url(null, null, $attrib['command'])); 
     566        $attrib['href'] = Q(rcmail_url(null, null, $attrib['command'])); 
    567567      else if (in_array($attrib['command'], $a_static_commands)) 
    568         $attrib['href'] = Q(rcmail_self_url($attrib['command'])); 
     568        $attrib['href'] = Q(rcmail_url($attrib['command'])); 
    569569    } 
    570570 
  • program/js/list.js

    rf115416 r41bece1  
    585585    // get subjects of selectedd messages 
    586586    var names = ''; 
    587     var c, subject, obj; 
     587    var c, node, subject, obj; 
    588588    for(var n=0; n<this.selection.length; n++) 
    589589    { 
     
    600600 
    601601        for(c=0; c<obj.childNodes.length; c++) 
    602           if (!subject && obj.childNodes[c].nodeName=='TD' && obj.childNodes[c].firstChild && obj.childNodes[c].firstChild.nodeType==3) 
     602          if (obj.childNodes[c].nodeName=='TD' && (node = obj.childNodes[c].firstChild) && (node.nodeType==3 || node.nodeName=='A')) 
    603603          { 
    604             subject = obj.childNodes[c].firstChild.data; 
     604            subject = node.nodeType==3 ? node.data : node.innerHTML; 
    605605            names += (subject.length > 50 ? subject.substring(0, 50)+'...' : subject) + '<br />'; 
     606            break; 
    606607          } 
    607608      } 
  • program/steps/addressbook/func.inc

    rf115416 r41bece1  
    7272    'rcmli'.$local_id, 
    7373    !$current ? 'selected' : '', 
    74     Q(rcmail_self_url('list', array('_source' => 0))), 
     74    Q(rcmail_url('list', array('_source' => 0))), 
    7575    JS_OBJECT_NAME, 
    7676    $local_id, 
     
    9090      'rcmli'.$dom_id, 
    9191      $current == $id ? 'selected' : '', 
    92       Q(rcmail_self_url('list', array('_source' => $id))), 
     92      Q(rcmail_url('list', array('_source' => $id))), 
    9393      JS_OBJECT_NAME, 
    9494      $js_id, 
  • program/steps/addressbook/mailto.inc

    rf115416 r41bece1  
    3737  $mailto_id = substr(md5($mailto_str), 0, 16); 
    3838  $_SESSION['mailto'][$mailto_id] = $mailto_str; 
    39   $OUTPUT->command('redirect', rcmail_self_url('compose', array('_mailto' => $mailto_id), 'mail')); 
     39  $OUTPUT->command('redirect', rcmail_url('compose', array('_mailto' => $mailto_id), 'mail')); 
    4040} 
    4141else 
  • program/steps/mail/func.inc

    r7198044 r41bece1  
    5959// define url for getting message parts 
    6060if (strlen($_GET['_uid'])) 
    61   $GET_URL = sprintf('%s&_action=get&_mbox=%s&_uid=%d', $COMM_PATH, $IMAP->get_mailbox_name(), get_input_value('_uid', RCUBE_INPUT_GET)); 
     61  $GET_URL = rcmail_url('get', array('_mbox'=>$IMAP->get_mailbox_name(), '_uid'=>get_input_value('_uid', RCUBE_INPUT_GET))); 
    6262 
    6363 
     
    234234                    $unread_count ? ' unread' : '', 
    235235                    $folder['id']==$mbox_name ? ' selected' : '', 
    236                     Q(rcmail_self_url('', array('_mbox' => $folder['id']))), 
     236                    Q(rcmail_url('', array('_mbox' => $folder['id']))), 
    237237                    JS_OBJECT_NAME, 
    238238                    $js_name, 
     
    324324  $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 
    325325  $a_sort_cols = array('subject', 'date', 'from', 'to', 'size'); 
     326 
     327  $mbox = $IMAP->get_mailbox_name(); 
    326328   
    327329  // show 'to' instead of from in sent messages 
    328   if (($IMAP->get_mailbox_name()==$CONFIG['sent_mbox'] || $IMAP->get_mailbox_name()==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols)) 
     330  if (($mbox==$CONFIG['sent_mbox'] || $mbox==$CONFIG['drafts_mbox']) && ($f = array_search('from', $a_show_cols)) 
    329331      && !array_search('to', $a_show_cols)) 
    330332    $a_show_cols[$f] = 'to'; 
     
    383385      else 
    384386        { 
    385         $col_name = sprintf('<a href="./#sort" onclick="return %s.command(\'sort\',\'%s\',this)" title="%s">%s</a>', 
    386                             JS_OBJECT_NAME, 
    387                             $col, 
    388                             rcube_label('sortby'), 
    389                             $col_name); 
     387        $col_name = sprintf( 
     388          '<a href="./#sort" onclick="return %s.command(\'sort\',\'%s\',this)" title="%s">%s</a>', 
     389          JS_OBJECT_NAME, 
     390          $col, 
     391          rcube_label('sortby'), 
     392          $col_name); 
    390393        } 
    391394      } 
     
    454457      else if ($col=='subject') 
    455458        { 
     459        $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; 
     460        $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid'; 
    456461        $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset)); 
    457462        if (empty($cont)) $cont = Q(rcube_label('nosubject')); 
     463        $cont = sprintf('<a href="%s" onclick="return false">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); 
    458464        } 
    459465      else if ($col=='size') 
     
    514520 
    515521  $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 
     522  $mbox = $IMAP->get_mailbox_name(); 
    516523 
    517524  // show 'to' instead of from in sent messages 
    518   if (($IMAP->get_mailbox_name() == $CONFIG['sent_mbox'] || $IMAP->get_mailbox_name() == $CONFIG['drafts_mbox']) 
     525  if (($mbox == $CONFIG['sent_mbox'] || $mbox == $CONFIG['drafts_mbox']) 
    519526      && (($f = array_search('from', $a_show_cols)) !== false) && array_search('to', $a_show_cols) === false) 
    520527    $a_show_cols[$f] = 'to'; 
     
    536543      else if ($col=='subject') 
    537544        { 
     545        $action = $mbox==$CONFIG['drafts_mbox'] ? 'compose' : 'show'; 
     546        $uid_param = $mbox==$CONFIG['drafts_mbox'] ? '_draf_uid' : '_uid'; 
    538547        $cont = Q(rcube_imap::decode_mime_string($header->$col, $header->charset)); 
    539548        if (!$cont) $cont = Q(rcube_label('nosubject')); 
     549        $cont = sprintf('<a href="%s" onclick="return false">%s</a>', Q(rcmail_url($action, array($uid_param=>$header->uid, '_mbox'=>$mbox))), $cont); 
    540550        } 
    541551      else if ($col=='size') 
  • skins/default/common.css

    rf115416 r41bece1  
    290290table.records-table tr.selected td 
    291291{ 
    292   font-weight: bold; 
    293292  color: #FFFFFF; 
    294293  background-color: #CC3333; 
     
    301300table.records-table tr.unfocused td 
    302301{ 
    303   font-weight: bold; 
    304302  color: #FFFFFF; 
    305303  background-color: #929292; 
  • skins/default/mail.css

    r281e3ed r41bece1  
    397397 
    398398#messagelist thead tr td a, 
    399 #messagelist thead tr td a:hover 
     399#messagelist tbody tr td a 
    400400{ 
    401401  display: block; 
     
    419419} 
    420420 
     421#messagelist tbody tr td a 
     422{ 
     423  color: #000; 
     424} 
     425 
    421426#messagelist col 
    422427{ 
     
    478483#messagelist tr.selected td 
    479484{ 
    480   font-weight: bold; 
    481485  color: #FFFFFF; 
    482486  background-color: #CC3333; 
     
    485489#messagelist tr.unfocused td 
    486490{ 
    487   font-weight: bold; 
    488491  color: #FFFFFF; 
    489492  background-color: #929292; 
    490493} 
    491494 
    492 #messagelist tr.selected td a.rcmContactAddress 
     495#messagelist tr.selected td a 
    493496{ 
    494497  color: #FFFFFF; 
    495498} 
    496499 
    497 #messagelist tr.unfocused td a.rcmContactAddress 
     500#messagelist tr.unfocused td a 
    498501{ 
    499502  color: #FFFFFF; 
    500503} 
    501504 
    502 #messagelist tr.deleted td a.rcmContactAddress 
     505#messagelist tr.deleted td a 
    503506{ 
    504507  color: #CCCCCC; 
Note: See TracChangeset for help on using the changeset viewer.