Changeset 606 in subversion


Ignore:
Timestamp:
Jun 6, 2007 3:51:21 PM (6 years ago)
Author:
till
Message:

+ CS
# bugfix: compose headers

Location:
branches/devel-vnext/program
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-vnext/program/include/rcube/rcmail_compose.php

    r602 r606  
    297297    } 
    298298    $out = $form_start ? "$form_start\n" : ''; 
     299 
     300    //tfk_debug($MESSAGE['headers']); 
     301 
    299302    $saveid = new hiddenfield( 
    300303                    array( 
     
    302305                        'value' => $compose_mode==RCUBE_COMPOSE_DRAFT ? str_replace(array('<','>'), 
    303306                        "", 
    304                         $MESSAGE['structure']->headers['messageID']) : '' 
     307                        $MESSAGE['headers']->messageID) : '' 
    305308                    ) 
    306309    ); 
  • branches/devel-vnext/program/steps/settings/edit_identity.inc

    r589 r606  
    11<?php 
    2  
    32/* 
    43 +-----------------------------------------------------------------------+ 
     
    2019*/ 
    2120 
    22 if (($_GET['_iid'] || $_POST['_iid']) && $_action=='edit-identity') 
    23   { 
    24   $DB->query("SELECT * FROM ".get_table_name('identities')." 
    25               WHERE  identity_id=? 
    26               AND    user_id=? 
    27               AND    del<>1", 
    28               get_input_value('_iid', RCUBE_INPUT_GPC), 
    29               $_SESSION['user_id']); 
     21if (($_GET['_iid'] || $_POST['_iid']) && $_action=='edit-identity') { 
     22    $_query = "SELECT * FROM " . get_table_name('identities'); 
     23    $_query.= " WHERE identity_id=?"; 
     24    $_query.= " AND user_id=?"; 
     25    $_query.= " AND del<>1"; 
     26    $DB->query( 
     27            $_query, 
     28            get_input_value('_iid', RCUBE_INPUT_GPC), 
     29            $_SESSION['user_id'] 
     30    ); 
    3031   
    31   $IDENTITY_RECORD = $DB->fetch_assoc(); 
     32    $IDENTITY_RECORD = $DB->fetch_assoc(); 
    3233   
    33   if (is_array($IDENTITY_RECORD)) 
    34     $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']); 
    35  
    36   $OUTPUT->set_pagetitle(rcube_label('edititem')); 
    37   } 
    38 else 
     34    if (is_array($IDENTITY_RECORD)) { 
     35        $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']); 
     36    } 
     37    $OUTPUT->set_pagetitle(rcube_label('edititem')); 
     38} 
     39else { 
    3940  $OUTPUT->set_pagetitle(rcube_label('newitem')); 
    40  
    41  
     41} 
    4242$OUTPUT->include_script('list.js'); 
    4343 
    44  
    4544function rcube_identity_form($attrib) 
    46   { 
    47   global $IDENTITY_RECORD, $OUTPUT; 
     45{ 
     46    global $IDENTITY_RECORD, $OUTPUT; 
    4847 
    4948/* 
     
    6160                                    "theme_advanced_buttons3 : '' });"); 
    6261*/ 
    63   if (!$IDENTITY_RECORD && $GLOBALS['_action']!='add-identity') 
    64     return rcube_label('notfound'); 
    65  
    66   // add some labels to client 
    67   rcube_add_label('noemailwarning', 'nonamewarning'); 
     62    if (!$IDENTITY_RECORD && $GLOBALS['_action']!='add-identity') { 
     63        return rcube_label('notfound'); 
     64    } 
     65    // add some labels to client 
     66    rcube_add_label('noemailwarning', 'nonamewarning'); 
    6867 
    6968 
    70   list($form_start, $form_end) = get_form_tags($attrib, 'save-identity', array('name' => '_iid', 'value' => $IDENTITY_RECORD['identity_id'])); 
    71   unset($attrib['form']); 
     69    list($form_start, $form_end) = get_form_tags($attrib, 'save-identity', array('name' => '_iid', 'value' => $IDENTITY_RECORD['identity_id'])); 
     70    unset($attrib['form']); 
    7271 
    7372 
    74   // list of available cols 
    75   $a_show_cols = array('name'         => array('type' => 'text'), 
    76                        'email'        => array('type' => 'text'), 
    77                        'organization' => array('type' => 'text'), 
    78                        'reply-to'     => array('type' => 'text', 'label' => 'replyto'), 
    79                        'bcc'          => array('type' => 'text'), 
    80                        'signature'        => array('type' => 'textarea', 'size' => "40", 'rows' => "4"), 
    81                    //  'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'_signature\');'), 
    82                        'standard'     => array('type' => 'checkbox', 'label' => 'setdefault')); 
     73    // list of available cols 
     74    $a_show_cols = array( 
     75                        'name'         => array('type' => 'text'), 
     76                        'email'        => array('type' => 'text'), 
     77                        'organization' => array('type' => 'text'), 
     78                        'reply-to'     => array('type' => 'text', 'label' => 'replyto'), 
     79                        'bcc'          => array('type' => 'text'), 
     80                        'signature'       => array('type' => 'textarea', 'size' => "40", 'rows' => "4"), 
     81                   //   'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'_signature\');'), 
     82                        'standard'     => array('type' => 'checkbox', 'label' => 'setdefault')); 
    8383 
    8484 
    85   // a specific part is requested 
    86   if ($attrib['part']) 
    87     { 
    88     $colprop = $a_show_cols[$attrib['part']]; 
    89     if (is_array($colprop)) 
    90       { 
    91       $out = $form_start; 
    92       $out .= rcmail_get_edit_field($attrib['part'], $IDENTITY_RECORD[$attrib['part']], $attrib, $colprop['type']);  
    93       return $out; 
    94       } 
    95     else 
    96       return ''; 
     85    // a specific part is requested 
     86    if ($attrib['part']) { 
     87        $colprop = $a_show_cols[$attrib['part']]; 
     88        if (is_array($colprop)) { 
     89            $out = $form_start; 
     90            $out.= rcmail_get_edit_field($attrib['part'], $IDENTITY_RECORD[$attrib['part']], $attrib, $colprop['type']);  
     91            return $out; 
     92        } 
     93        else { 
     94            return ''; 
     95        } 
    9796    } 
    9897 
    9998 
    100   // return the complete edit form as table 
    101   $out = "$form_start<table>\n\n"; 
     99    // return the complete edit form as table 
     100    $out = "$form_start<table>\n\n"; 
    102101 
    103   foreach ($a_show_cols as $col => $colprop) 
    104     { 
    105     $attrib['id'] = 'rcmfd_'.$col; 
     102    foreach ($a_show_cols as $col => $colprop) { 
     103        $attrib['id'] = 'rcmfd_'.$col; 
    106104 
    107     if (strlen($colprop['onclick'])) 
    108       $attrib['onclick'] = $colprop['onclick']; 
    109     else 
    110       unset($attrib['onclick']); 
     105        if (strlen($colprop['onclick'])) { 
     106            $attrib['onclick'] = $colprop['onclick']; 
     107        } 
     108        else { 
     109            unset($attrib['onclick']); 
     110        } 
    111111 
    112     if ($col == 'signature') 
    113       { 
    114       $attrib['size'] = $colprop['size']; 
    115       $attrib['rows'] = $colprop['rows']; 
    116       $attrib['mce_editable'] = $IDENTITY_RECORD['html_signature'] ? "true" : "false"; 
    117       } 
    118     else 
    119       { 
    120       unset($attrib['size']); 
    121       unset($attrib['rows']); 
    122       unset($attrib['mce_editable']); 
    123       } 
     112        if ($col == 'signature') { 
     113            $attrib['size'] = $colprop['size']; 
     114            $attrib['rows'] = $colprop['rows']; 
     115            $attrib['mce_editable'] = $IDENTITY_RECORD['html_signature'] ? "true" : "false"; 
     116        } 
     117        else { 
     118            unset($attrib['size']); 
     119            unset($attrib['rows']); 
     120            unset($attrib['mce_editable']); 
     121        } 
    124122 
    125     $label = strlen($colprop['label']) ? $colprop['label'] : $col; 
    126     $value = rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $attrib, $colprop['type']); 
     123        $label = strlen($colprop['label']) ? $colprop['label'] : $col; 
     124        $value = rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $attrib, $colprop['type']); 
    127125 
    128     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     126        $out .= sprintf( 
     127                    "<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    129128                    $attrib['id'], 
    130129                    Q(rcube_label($label)), 
    131130                    $value); 
    132131    } 
     132    $out .= "\n</table>$form_end"; 
    133133 
    134   $out .= "\n</table>$form_end"; 
    135  
    136   return $out;   
    137   } 
     134    return $out;   
     135} 
    138136 
    139137$OUTPUT->add_handler('identityform', 'rcube_identity_form'); 
    140138 
    141 if ($_action=='add-identity' && template_exists('addidentity')) 
    142   parse_template('addidentity'); 
    143  
     139if ($_action=='add-identity' && template_exists('addidentity')) { 
     140    parse_template('addidentity'); 
     141} 
    144142parse_template('editidentity'); 
    145143?> 
  • branches/devel-vnext/program/steps/settings/identities.inc

    r589 r606  
    2020*/ 
    2121 
    22 if ($USER_DATA = $DB->fetch_assoc($sql_result)) 
    23   $OUTPUT->set_pagetitle(sprintf('%s (%s@%s)', rcube_label('identities'), $USER_DATA['username'], $USER_DATA['mail_host'])); 
    24  
     22if ($USER_DATA = $DB->fetch_assoc($sql_result)) { 
     23    $OUTPUT->set_pagetitle(sprintf('%s (%s@%s)', rcube_label('identities'), $USER_DATA['username'], $USER_DATA['mail_host'])); 
     24} 
    2525$OUTPUT->include_script('list.js'); 
    2626 
     
    2828// similar function as /steps/addressbook/func.inc::rcmail_contact_frame() 
    2929function rcmail_identity_frame($attrib) 
    30   { 
    31   global $OUTPUT; 
     30{ 
     31    global $OUTPUT; 
    3232 
    33   if (!$attrib['id']) 
    34     $attrib['id'] = 'rcmIdentityFrame'; 
     33    if (!$attrib['id']) { 
     34        $attrib['id'] = 'rcmIdentityFrame'; 
     35    } 
     36    $attrib['name'] = $attrib['id']; 
    3537 
    36   $attrib['name'] = $attrib['id']; 
     38    $OUTPUT->set_env('contentframe', $attrib['name']); 
    3739 
    38   $OUTPUT->set_env('contentframe', $attrib['name']); 
     40    $attrib_str = create_attrib_string($attrib, array('name', 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder')); 
     41    $out = '<iframe'. $attrib_str . '></iframe>'; 
    3942 
    40   $attrib_str = create_attrib_string($attrib, array('name', 'id', 'class', 'style', 'src', 'width', 'height', 'frameborder')); 
    41   $out = '<iframe'. $attrib_str . '></iframe>'; 
    42  
    43   return $out; 
    44   } 
     43    return $out; 
     44} 
    4545 
    4646$OUTPUT->add_handler('identityframe', 'rcmail_identity_frame'); 
Note: See TracChangeset for help on using the changeset viewer.