Changeset ecfaed5 in github


Ignore:
Timestamp:
Nov 11, 2011 10:04:45 AM (19 months ago)
Author:
alecpl <alec@…>
Branches:
release-0.7
Children:
3fec695
Parents:
c82bf66
Message:
  • Apply fixes fom trunk up to r5414
Files:
1 added
29 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r51f7a5b recfaed5  
    22=========================== 
    33 
     4- Add option to skip alternative email addresses in autocompletion 
     5- Fix inconsistent behaviour of Compose button in Drafts folder, add Edit button for drafts 
     6- Fix problem with parsing HTML message body with non-unicode characters (#1487813) 
     7- Add option to define matching method for addressbook search (#1486564, #1487907) 
    48- Make email recipients separator configurable 
    59- Fix so folders with \Noinferiors attribute aren't listed in parent selector 
  • config/main.inc.php.dist

    r51f7a5b recfaed5  
    628628$rcmail_config['address_template'] = '{street}<br/>{locality} {zipcode}<br/>{country} {region}'; 
    629629 
     630// Matching mode for addressbook search (including autocompletion) 
     631// 0 - partial (*abc*), default 
     632// 1 - strict (abc) 
     633// 2 - prefix (abc*) 
     634// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode 
     635$rcmail_config['addressbook_search_mode'] = 0; 
     636 
    630637// ---------------------------------- 
    631638// USER PREFERENCES 
     
    775782$rcmail_config['spellcheck_before_send'] = false; 
    776783 
     784// Skip alternative email addresses in autocompletion (show one address per contact) 
     785$rcmail_config['autocomplete_single'] = false; 
     786 
    777787// end of config file 
  • plugins/acl/acl.js

    r5da48a9 recfaed5  
    22 * ACL plugin script 
    33 * 
    4  * @version 0.6.2 
     4 * @version 0.6.3 
    55 * @author Aleksander Machniak <alec@alec.pl> 
    66 */ 
  • plugins/acl/acl.php

    r5da48a9 recfaed5  
    44 * Folders Access Control Lists Management (RFC4314, RFC2086) 
    55 * 
    6  * @version 0.6.2 
     6 * @version 0.6.3 
    77 * @author Aleksander Machniak <alec@alec.pl> 
    88 * 
     
    9292 
    9393        if ($this->init_ldap()) { 
    94             $this->ldap->set_pagesize((int)$this->rc->config->get('autocomplete_max', 15)); 
    95             $result = $this->ldap->search('*', $search); 
     94            $max  = (int) $this->rc->config->get('autocomplete_max', 15); 
     95            $mode = (int) $this->rc->config->get('addressbook_search_mode'); 
     96 
     97            $this->ldap->set_pagesize($max); 
     98            $result = $this->ldap->search('*', $search, $mode); 
    9699 
    97100            foreach ($result->records as $record) { 
  • program/include/rcube_addressbook.php

    rdc6c4f4 recfaed5  
    9797     * @param array   List of fields to search in 
    9898     * @param string  Search value 
     99     * @param int     Matching mode: 
     100     *                0 - partial (*abc*), 
     101     *                1 - strict (=), 
     102     *                2 - prefix (abc*) 
    99103     * @param boolean True if results are requested, False if count only 
    100104     * @param boolean True to skip the count query (select only) 
     
    102106     * @return object rcube_result_set List of contact records and 'count' value 
    103107     */ 
    104     abstract function search($fields, $value, $strict=false, $select=true, $nocount=false, $required=array()); 
     108    abstract function search($fields, $value, $mode=0, $select=true, $nocount=false, $required=array()); 
    105109 
    106110    /** 
     
    400404        $out = array(); 
    401405        foreach ($data as $c => $values) { 
    402             if (strpos($c, $col) === 0) { 
     406            if ($c === $col || strpos($c, $col.':') === 0) { 
    403407                if ($flat) { 
    404408                    $out = array_merge($out, (array)$values); 
  • program/include/rcube_contacts.php

    r51f7a5b recfaed5  
    178178            " AND user_id=?", 
    179179            $group_id, $this->user_id); 
    180              
     180 
    181181        if ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) { 
    182182            $sql_arr['ID'] = $sql_arr['contactgroup_id']; 
    183183            return $sql_arr; 
    184184        } 
    185          
     185 
    186186        return null; 
    187187    } 
     
    269269     * @param mixed   $fields   The field name of array of field names to search in 
    270270     * @param mixed   $value    Search value (or array of values when $fields is array) 
    271      * @param boolean $strict   True for strict (=), False for partial (LIKE) matching 
     271     * @param int     $mode     Matching mode: 
     272     *                          0 - partial (*abc*), 
     273     *                          1 - strict (=), 
     274     *                          2 - prefix (abc*) 
    272275     * @param boolean $select   True if results are requested, False if count only 
    273276     * @param boolean $nocount  True to skip the count query (select only) 
     
    276279     * @return object rcube_result_set Contact records and 'count' value 
    277280     */ 
    278     function search($fields, $value, $strict=false, $select=true, $nocount=false, $required=array()) 
     281    function search($fields, $value, $mode=0, $select=true, $nocount=false, $required=array()) 
    279282    { 
    280283        if (!is_array($fields)) 
     
    284287 
    285288        $where = $and_where = array(); 
     289        $mode = intval($mode); 
    286290 
    287291        foreach ($fields as $idx => $col) { 
     
    296300            else if ($col == '*') { 
    297301                $words = array(); 
    298                 foreach (explode(" ", self::normalize_string($value)) as $word) 
    299                     $words[] = $this->db->ilike('words', '%'.$word.'%'); 
     302                foreach (explode(" ", self::normalize_string($value)) as $word) { 
     303                    switch ($mode) { 
     304                    case 1: // strict 
     305                        $words[] = '(' . $this->db->ilike('words', $word.' %') 
     306                            . ' OR ' . $this->db->ilike('words', '% '.$word.' %') 
     307                            . ' OR ' . $this->db->ilike('words', '% '.$word) . ')'; 
     308                        break; 
     309                    case 2: // prefix 
     310                        $words[] = '(' . $this->db->ilike('words', $word.'%') 
     311                            . ' OR ' . $this->db->ilike('words', '% '.$word.'%') . ')'; 
     312                        break; 
     313                    default: // partial 
     314                        $words[] = $this->db->ilike('words', '%'.$word.'%'); 
     315                    } 
     316                } 
    300317                $where[] = '(' . join(' AND ', $words) . ')'; 
    301318            } 
     
    304321                // table column 
    305322                if (in_array($col, $this->table_cols)) { 
    306                     if ($strict) { 
     323                    switch ($mode) { 
     324                    case 1: // strict 
    307325                        $where[] = $this->db->quoteIdentifier($col).' = '.$this->db->quote($val); 
    308                     } 
    309                     else { 
     326                        break; 
     327                    case 2: // prefix 
     328                        $where[] = $this->db->ilike($col, $val.'%'); 
     329                        break; 
     330                    default: // partial 
    310331                        $where[] = $this->db->ilike($col, '%'.$val.'%'); 
    311332                    } 
     
    314335                else { 
    315336                    if (in_array($col, $this->fulltext_cols)) { 
    316                         foreach (explode(" ", self::normalize_string($val)) as $word) 
    317                             $words[] = $this->db->ilike('words', '%'.$word.'%'); 
     337                        foreach (explode(" ", self::normalize_string($val)) as $word) { 
     338                            switch ($mode) { 
     339                            case 1: // strict 
     340                                $words[] = '(' . $this->db->ilike('words', $word.' %') 
     341                                    . ' OR ' . $this->db->ilike('words', '% '.$word.' %') 
     342                                    . ' OR ' . $this->db->ilike('words', '% '.$word) . ')'; 
     343                                break; 
     344                            case 2: // prefix 
     345                                $words[] = '(' . $this->db->ilike('words', $word.'%') 
     346                                    . ' OR ' . $this->db->ilike('words', ' '.$word.'%') . ')'; 
     347                                break; 
     348                            default: // partial 
     349                                $words[] = $this->db->ilike('words', '%'.$word.'%'); 
     350                            } 
     351                        } 
    318352                        $where[] = '(' . join(' AND ', $words) . ')'; 
    319353                    } 
     
    363397                        foreach ((array)$row[$col] as $value) { 
    364398                            // composite field, e.g. address 
    365                             if (is_array($value)) { 
    366                                 $value = implode($value); 
    367                             } 
    368                             $value = mb_strtolower($value); 
    369                             if (($strict && $value == $search) || (!$strict && strpos($value, $search) !== false)) { 
    370                                 $found[$colname] = true; 
    371                                 break; 
     399                            foreach ((array)$value as $val) { 
     400                                $val = mb_strtolower($val); 
     401                                switch ($mode) { 
     402                                case 1: 
     403                                    $got = ($val == $search); 
     404                                    break; 
     405                                case 2: 
     406                                    $got = ($search == substr($val, 0, strlen($search))); 
     407                                    break; 
     408                                default: 
     409                                    $got = (strpos($val, $search) !== false); 
     410                                    break; 
     411                                } 
     412 
     413                                if ($got) { 
     414                                    $found[$colname] = true; 
     415                                    break 2; 
     416                                } 
    372417                            } 
    373418                        } 
  • program/include/rcube_imap.php

    r51f7a5b recfaed5  
    479479    function get_mailbox_name() 
    480480    { 
    481         return $this->conn->connected() ? $this->mailbox : ''; 
     481        return $this->mailbox; 
    482482    } 
    483483 
  • program/include/rcube_ldap.php

    r51f7a5b recfaed5  
    691691     * @param mixed   $fields   The field name of array of field names to search in 
    692692     * @param mixed   $value    Search value (or array of values when $fields is array) 
    693      * @param boolean $strict   True for strict, False for partial (fuzzy) matching 
     693     * @param int     $mode     Matching mode: 
     694     *                          0 - partial (*abc*), 
     695     *                          1 - strict (=), 
     696     *                          2 - prefix (abc*) 
    694697     * @param boolean $select   True if results are requested, False if count only 
    695698     * @param boolean $nocount  (Not used) 
     
    698701     * @return array  Indexed list of contact records and 'count' value 
    699702     */ 
    700     function search($fields, $value, $strict=false, $select=true, $nocount=false, $required=array()) 
    701     { 
     703    function search($fields, $value, $mode=0, $select=true, $nocount=false, $required=array()) 
     704    { 
     705        $mode = intval($mode); 
     706 
    702707        // special treatment for ID-based search 
    703708        if ($fields == 'ID' || $fields == $this->primary_key) 
     
    731736 
    732737            // get all entries of this page and post-filter those that really match the query 
     738            $search = mb_strtolower($value); 
    733739            $this->result = new rcube_result_set(0); 
    734740            $entries = ldap_get_entries($this->conn, $this->ldap_result); 
     741 
    735742            for ($i = 0; $i < $entries['count']; $i++) { 
    736743                $rec = $this->_ldap2result($entries[$i]); 
    737                 if (stripos($rec['name'] . $rec['email'], $value) !== false) { 
    738                     $this->result->add($rec); 
    739                     $this->result->count++; 
     744                foreach (array('email', 'name') as $f) { 
     745                    $val = mb_strtolower($rec[$f]); 
     746                    switch ($mode) { 
     747                    case 1: 
     748                        $got = ($val == $search); 
     749                        break; 
     750                    case 2: 
     751                        $got = ($search == substr($val, 0, strlen($search))); 
     752                        break; 
     753                    default: 
     754                        $got = (strpos($val, $search) !== false); 
     755                        break; 
     756                    } 
     757 
     758                    if ($got) { 
     759                        $this->result->add($rec); 
     760                        $this->result->count++; 
     761                        break; 
     762                    } 
    740763                } 
    741764            } 
     
    746769        // use AND operator for advanced searches 
    747770        $filter = is_array($value) ? '(&' : '(|'; 
    748         $wc     = !$strict && $this->prop['fuzzy_search'] ? '*' : ''; 
     771        // set wildcards 
     772        $wp = $ws = ''; 
     773        if (!empty($this->prop['fuzzy_search']) && $mode != 1) { 
     774            $ws = '*'; 
     775            if (!$mode) { 
     776                $wp = '*'; 
     777            } 
     778        } 
    749779 
    750780        if ($fields == '*') 
     
    760790            { 
    761791                foreach ($this->prop['search_fields'] as $field) { 
    762                     $filter .= "($field=$wc" . $this->_quote_string($value) . "$wc)"; 
     792                    $filter .= "($field=$wp" . $this->_quote_string($value) . "$ws)"; 
    763793                } 
    764794            } 
     
    769799                $val = is_array($value) ? $value[$idx] : $value; 
    770800                if ($f = $this->_map_field($field)) { 
    771                     $filter .= "($f=$wc" . $this->_quote_string($val) . "$wc)"; 
     801                    $filter .= "($f=$wp" . $this->_quote_string($val) . "$ws)"; 
    772802                } 
    773803            } 
     
    14181448        $groups = array(); 
    14191449        if ($search) { 
    1420             $search = strtolower($search); 
     1450            $search = mb_strtolower($search); 
    14211451            foreach ($group_cache as $group) { 
    1422                 if (strstr(strtolower($group['name']), $search)) 
     1452                if (strpos(mb_strtolower($group['name']), $search) !== false) 
    14231453                    $groups[] = $group; 
    14241454            } 
     
    14961526            } 
    14971527 
    1498             $group_sortnames[] = strtolower($ldap_data[$i][$sort_attr][0]); 
     1528            $group_sortnames[] = mb_strtolower($ldap_data[$i][$sort_attr][0]); 
    14991529        } 
    15001530 
  • program/include/rcube_session.php

    rc82bf66 recfaed5  
    411411  { 
    412412    if ($this->key && $this->memcache) 
    413       $this->mc_read($this->key); 
     413      $data = $this->mc_read($this->key); 
    414414    else if ($this->key) 
    415       $this->db_read($this->key); 
     415      $data = $this->db_read($this->key); 
     416 
     417    if ($data) 
     418     session_decode($data); 
    416419  } 
    417420 
  • program/js/app.js

    r51f7a5b recfaed5  
    208208          'print', 'load-attachment', 'load-headers', 'forward-attachment']; 
    209209 
    210         if (this.env.action=='show' || this.env.action=='preview') { 
     210        if (this.env.action == 'show' || this.env.action == 'preview') { 
    211211          this.enable_command(this.env.message_commands, this.env.uid); 
    212212          this.enable_command('reply-list', this.env.list_post); 
     
    461461 
    462462    // check input before leaving compose step 
    463     if (this.task=='mail' && this.env.action=='compose' && $.inArray(command, this.env.compose_commands)<0) { 
     463    if (this.task == 'mail' && this.env.action == 'compose' && $.inArray(command, this.env.compose_commands)<0) { 
    464464      if (this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning'))) 
    465465        return false; 
     
    816816        if (this.task == 'mail') { 
    817817          url += '&_mbox='+urlencode(this.env.mailbox); 
    818  
    819           if (this.env.mailbox == this.env.drafts_mailbox) { 
    820             var uid; 
    821             if (uid = this.get_single_uid()) 
    822               url += '&_draft_uid='+uid; 
    823           } 
    824           else if (props) 
     818          if (props) 
    825819             url += '&_to='+urlencode(props); 
    826820        } 
  • program/localization/en_US/labels.inc

    r1cc9e21 recfaed5  
    226226$labels['showimages'] = 'Display images'; 
    227227$labels['alwaysshow'] = 'Always show images from $sender'; 
     228$labels['isdraft']    = 'This is a draft message.'; 
    228229 
    229230$labels['htmltoggle'] = 'HTML'; 
     
    431432$labels['replysamefolder'] = 'Place replies in the folder of the message being replied to'; 
    432433$labels['defaultaddressbook'] = 'Add new contacts to the selected addressbook'; 
     434$labels['autocompletesingle'] = 'Skip alternative email addresses in autocompletion'; 
    433435$labels['spellcheckbeforesend'] = 'Check spelling before sending a message'; 
    434436$labels['spellcheckoptions'] = 'Spellcheck Options'; 
  • program/localization/pl_PL/labels.inc

    r32226f73 recfaed5  
    486486$labels['dateformat'] = 'Format daty'; 
    487487$labels['timeformat'] = 'Format czasu'; 
     488$labels['isdraft'] = 'To jest kopia robocza wiadomoà
     489›ci.'; 
     490$labels['autocompletesingle'] = 'Nie pokazuj alternatywnych adresów przy autouzupeà
     491‚nianiu'; 
    488492 
    489493?> 
  • program/steps/addressbook/copy.inc

    r2d761bb recfaed5  
    6161        // Note: Some addressbooks allows empty email address field 
    6262        if (!empty($a_record['email'])) 
    63             $result = $TARGET->search('email', $a_record['email'], true, true, true); 
     63            $result = $TARGET->search('email', $a_record['email'], 1, true, true); 
    6464        else if (!empty($a_record['name'])) 
    65             $result = $TARGET->search('name', $a_record['name'], true, true, true); 
     65            $result = $TARGET->search('name', $a_record['name'], 1, true, true); 
    6666        else 
    6767            $result = new rcube_result_set(); 
  • program/steps/addressbook/import.inc

    r4d4a2fa recfaed5  
    175175      if (!$replace && $email) { 
    176176        // compare e-mail address 
    177         $existing = $CONTACTS->search('email', $email, false, false); 
     177        $existing = $CONTACTS->search('email', $email, 1, false); 
    178178        if (!$existing->count && $vcard->displayname) {  // compare display name 
    179           $existing = $CONTACTS->search('name', $vcard->displayname, false, false); 
     179          $existing = $CONTACTS->search('name', $vcard->displayname, 1, false); 
    180180        } 
    181181        if ($existing->count) { 
  • program/steps/addressbook/mailto.inc

    rdc6c4f4 recfaed5  
    3232        $CONTACTS->set_page(1); 
    3333        $CONTACTS->set_pagesize(count($cid) + 2); // +2 to skip counting query 
    34         $recipients = $CONTACTS->search($CONTACTS->primary_key, $cid, false, true, true, 'email'); 
     34        $recipients = $CONTACTS->search($CONTACTS->primary_key, $cid, 0, true, true, 'email'); 
    3535    } 
    3636} 
  • program/steps/addressbook/save.inc

    r5db6f96 recfaed5  
    163163  $existing = false; 
    164164  foreach ($CONTACTS->get_col_values('email', $a_record, true) as $email) { 
    165       if ($email && ($res = $CONTACTS->search('email', $email, false, false, true)) && $res->count) { 
     165      if ($email && ($res = $CONTACTS->search('email', $email, 1, false, true)) && $res->count) { 
    166166          $OUTPUT->show_message('contactexists', 'notice', null, false); 
    167167          break; 
  • program/steps/addressbook/search.inc

    rb104e39 recfaed5  
    138138    } 
    139139 
     140    // Values matching mode 
     141    $mode = (int) $RCMAIL->config->get('addressbook_search_mode'); 
     142 
    140143    // get sources list 
    141144    $sources    = $RCMAIL->get_address_sources(); 
     
    169172 
    170173        // get contacts count 
    171         $result = $source->search($fields, $search, false, false); 
     174        $result = $source->search($fields, $search, $mode, false); 
    172175 
    173176        if (!$result->count) { 
  • program/steps/mail/addcontact.inc

    r39cafac recfaed5  
    5151      $OUTPUT->send(); 
    5252    } 
    53      
     53 
    5454    $email = rcube_idn_to_ascii($contact['email']); 
    5555    if (!check_email($email, false)) { 
     
    6666      // TODO: show dialog to complete record 
    6767      // if ($error['type'] == rcube_addressbook::ERROR_VALIDATE) { } 
    68        
     68 
    6969      $OUTPUT->show_message($error['message'] ? $error['message'] : 'errorsavingcontact', 'error'); 
    7070      $OUTPUT->send(); 
     
    7272 
    7373    // check for existing contacts 
    74     $existing = $CONTACTS->search('email', $contact['email'], true, false); 
     74    $existing = $CONTACTS->search('email', $contact['email'], 1, false); 
    7575 
    7676    if ($done = $existing->count) 
  • program/steps/mail/autocomplete.inc

    r51f7a5b recfaed5  
    4141 
    4242 
    43 $MAXNUM = (int)$RCMAIL->config->get('autocomplete_max', 15); 
     43$MAXNUM = (int) $RCMAIL->config->get('autocomplete_max', 15); 
     44$mode   = (int) $RCMAIL->config->get('addressbook_search_mode'); 
     45$single = (bool) $RCMAIL->config->get('autocomplete_single'); 
    4446$search = get_input_value('_search', RCUBE_INPUT_GPC, true); 
    4547$source = get_input_value('_source', RCUBE_INPUT_GPC); 
     
    5254 
    5355if (!empty($book_types) && strlen($search)) { 
    54   $contacts = array(); 
     56  $contacts  = array(); 
    5557  $books_num = count($book_types); 
     58  $search_lc = mb_strtolower($search); 
    5659 
    5760  foreach ($book_types as $id) { 
     
    5962    $abook->set_pagesize($MAXNUM); 
    6063 
    61     if ($result = $abook->search(array('email','name'), $search, false, true, true, 'email')) { 
     64    if ($result = $abook->search(array('email','name'), $search, $mode, true, true, 'email')) { 
    6265      while ($sql_arr = $result->iterate()) { 
    6366        // Contact can have more than one e-mail address 
     
    6568        $email_cnt = count($email_arr); 
    6669        foreach ($email_arr as $email) { 
    67           if (empty($email)) 
    68             continue; 
    69           $contact = format_email_recipient($email, $sql_arr['name']); 
    70           // skip entries that don't match 
    71           if ($email_cnt > 1 && stripos($contact, $search) === false) { 
     70          if (empty($email)) { 
    7271            continue; 
    7372          } 
     73 
     74          $contact = format_email_recipient($email, $sql_arr['name']); 
     75 
     76          // skip entries that don't match 
     77          if ($email_cnt > 1 && strpos(mb_strtolower($contact), $search_lc) === false) { 
     78            continue; 
     79          } 
     80 
    7481          // skip duplicates 
    7582          if (!in_array($contact, $contacts)) { 
     
    7885              break 2; 
    7986          } 
     87 
     88          // skip redundant entries (show only first email address) 
     89          if ($single) { 
     90            break; 
     91          } 
    8092        } 
    8193      } 
     
    8395 
    8496    // also list matching contact groups 
    85     if ($abook->groups) { 
     97    if ($abook->groups && count($contacts) < $MAXNUM) { 
    8698      foreach ($abook->list_groups($search) as $group) { 
    8799        $abook->reset(); 
  • program/steps/mail/func.inc

    r51f7a5b recfaed5  
    639639  if (!$p['skip_washer_style_callback']) 
    640640    $washer->add_callback('style', 'rcmail_washtml_callback'); 
     641 
     642  // Remove non-UTF8 characters (#1487813) 
     643  $html = rc_utf8_clean($html); 
    641644 
    642645  $html = $washer->wash($html); 
  • program/steps/mail/show.inc

    r9e54e6f recfaed5  
    151151} 
    152152 
    153 function rcmail_remote_objects_msg($attrib) 
     153function rcmail_remote_objects_msg() 
    154154{ 
    155155  global $MESSAGE, $RCMAIL; 
    156156 
    157   if (!$attrib['id']) 
    158     $attrib['id'] = 'rcmremoteobjmsg'; 
     157  $attrib['id']    = 'remote-objects-message'; 
     158  $attrib['class'] = 'notice'; 
     159  $attrib['style'] = 'display: none'; 
    159160 
    160161  $msg = Q(rcube_label('blockedimages')) . '&nbsp;'; 
     
    169170  $RCMAIL->output->add_gui_object('remoteobjectsmsg', $attrib['id']); 
    170171  return html::div($attrib, $msg); 
     172} 
     173 
     174function rcmail_message_buttons() 
     175{ 
     176  global $MESSAGE, $RCMAIL, $CONFIG; 
     177 
     178  $mbox  = $RCMAIL->imap->get_mailbox_name(); 
     179  $delim = $RCMAIL->imap->get_hierarchy_delimiter(); 
     180  $dbox  = $CONFIG['drafts_mbox']; 
     181 
     182  // the message is not a draft 
     183  if ($mbox != $dbox && strpos($mbox, $dbox.$delim) !== 0) { 
     184    return ''; 
     185  } 
     186 
     187  $attrib['id']    = 'message-buttons'; 
     188  $attrib['class'] = 'notice'; 
     189 
     190  $msg = Q(rcube_label('isdraft')) . '&nbsp;'; 
     191  $msg .= html::a(array('href' => "#edit", 'onclick' => JS_OBJECT_NAME.".command('edit')"), Q(rcube_label('edit'))); 
     192 
     193  return html::div($attrib, $msg); 
     194} 
     195 
     196function rcmail_message_objects($attrib) 
     197{ 
     198  global $RCMAIL, $MESSAGE; 
     199 
     200  if (!$attrib['id']) 
     201    $attrib['id'] = 'message-objects'; 
     202 
     203  $content = array( 
     204    rcmail_message_buttons(), 
     205    rcmail_remote_objects_msg(), 
     206  ); 
     207 
     208  $plugin = $RCMAIL->plugins->exec_hook('message_objects', 
     209    array('content' => $content, 'message' => $MESSAGE)); 
     210 
     211  $content = implode("\n", $plugin['content']); 
     212 
     213  return html::div($attrib, $content); 
    171214} 
    172215 
     
    190233  'messageattachments' => 'rcmail_message_attachments', 
    191234  'mailboxname' => 'rcmail_mailbox_name_display', 
    192   'blockedobjects' => 'rcmail_remote_objects_msg')); 
     235  'messageobjects' => 'rcmail_message_objects', 
     236)); 
    193237 
    194238 
  • program/steps/settings/func.inc

    r799e120 recfaed5  
    660660    } 
    661661 
     662    if (!isset($no_override['autocomplete_single'])) { 
     663      $field_id = 'rcmfd_autocomplete_single'; 
     664      $checkbox = new html_checkbox(array('name' => '_autocomplete_single', 'id' => $field_id, 'value' => 1)); 
     665 
     666      $blocks['main']['options']['autocomplete_single'] = array( 
     667        'title' => html::label($field_id, Q(rcube_label('autocompletesingle'))), 
     668        'content' => $checkbox->show($config['autocomplete_single']?1:0), 
     669      ); 
     670    } 
     671 
    662672    break; 
    663673 
  • program/steps/settings/save_prefs.inc

    r1cc9e21 recfaed5  
    9494    $a_user_prefs = array( 
    9595      'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true), 
     96      'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE, 
    9697    ); 
    9798 
  • skins/default/common.css

    r58487bb recfaed5  
    231231 
    232232#message div.notice, 
    233 #remote-objects-message 
     233#message-objects div.notice 
    234234{ 
    235235  background: url(images/display/icons.png) 6px 3px no-repeat; 
     
    239239 
    240240#message div.error, 
    241 #message div.warning 
     241#message div.warning, 
     242#message-objects div.warning, 
     243#message-objects div.error 
    242244{ 
    243245  background: url(images/display/icons.png) 6px -97px no-repeat; 
     
    246248} 
    247249 
    248 #message div.confirmation 
     250#message div.confirmation, 
     251#message-objects div.confirmation 
    249252{ 
    250253  background: url(images/display/icons.png) 6px -47px no-repeat; 
     
    253256} 
    254257 
    255 #message div.loading 
     258#message div.loading, 
     259#message-objects div.loading 
    256260{ 
    257261  background: url(images/display/loading.gif) 6px 3px no-repeat; 
  • skins/default/ie6hacks.css

    r7a2bade recfaed5  
    2121#message div.warning, 
    2222#message div.confirmation, 
    23 #remote-objects-message 
     23#message-objects div.notice, 
     24#message-objects div.error, 
     25#message-objects div.warning, 
     26#message-objects div.confirmation 
    2427{ 
    2528  background-image: url(images/display/icons.gif); 
  • skins/default/mail.css

    r57863c1 recfaed5  
    11981198} 
    11991199 
    1200 #remote-objects-message 
    1201 { 
    1202   display: none; 
     1200#message-objects div 
     1201{ 
    12031202  margin: 8px; 
    12041203  min-height: 20px; 
     
    12061205} 
    12071206 
    1208 #remote-objects-message a 
     1207#message-objects div a 
    12091208{ 
    12101209  color: #666666; 
     
    12121211} 
    12131212 
    1214 #remote-objects-message a:hover 
     1213#message-objects div a:hover 
    12151214{ 
    12161215  color: #333333; 
  • skins/default/templates/message.html

    r8e99ffb recfaed5  
    3737<roundcube:object name="messageFullHeaders" id="full-headers" /> 
    3838<roundcube:object name="messageAttachments" id="attachment-list" /> 
    39  
    40 <roundcube:object name="blockedObjects" id="remote-objects-message" /> 
     39<roundcube:object name="messageObjects" id="message-objects" /> 
    4140<roundcube:object name="messageBody" id="messagebody" /> 
    4241</div> 
  • skins/default/templates/messagepreview.html

    rc6be456 recfaed5  
    1414</div> 
    1515 
    16 <roundcube:object name="blockedObjects" id="remote-objects-message" /> 
     16<roundcube:object name="messageObjects" id="message-objects" /> 
    1717<roundcube:object name="messageBody" id="messagebody" /> 
    1818 
  • tests/mailfunc.php

    rc08b18c4 recfaed5  
    101101 
    102102  /** 
     103   * Test washtml class on non-unicode characters (#1487813) 
     104   */ 
     105  function test_washtml_utf8() 
     106  { 
     107    $part = $this->get_html_part('src/invalidchars.html'); 
     108    $washed = rcmail_print_body($part); 
     109 
     110    $this->assertPattern('/<p>ÑÐşÐŒÐ²ÐŞÐ»<\/p>/', $washed, "Remove non-unicode characters from HTML message body"); 
     111  } 
     112 
     113  /** 
    103114   * Test links pattern replacements in plaintext messages 
    104115   */ 
Note: See TracChangeset for help on using the changeset viewer.