Changeset 5686 in subversion


Ignore:
Timestamp:
Jan 2, 2012 9:44:28 AM (17 months ago)
Author:
thomasb
Message:

Use iframes for identity management

Location:
trunk/roundcubemail
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/app.js

    r5678 r5686  
    352352 
    353353        if (this.env.action == 'identities') { 
    354           this.enable_command('add', this.env.identities_level < 2); 
     354          this.enable_command('add', 'delete', this.env.identities_level < 2); 
    355355        } 
    356356        else if (this.env.action == 'edit-identity' || this.env.action == 'add-identity') { 
    357357          this.enable_command('add', this.env.identities_level < 2); 
    358           this.enable_command('save', 'delete', 'edit', 'toggle-editor', true); 
     358          this.enable_command('save', 'edit', 'toggle-editor', true); 
     359          if (this.is_framed() && this.env.identities_level < 2) 
     360            this.set_button('delete', 'act');  // activate button but delegate command to parent 
     361          else 
     362            this.enable_command('delete', this.env.identities_level < 2); 
     363 
     364          if (this.env.action == 'add-identity') 
     365            $("input[type='text']").first().select(); 
    359366        } 
    360367        else if (this.env.action == 'folders') { 
     
    47714778      id = this.env.iid ? this.env.iid : selection[0]; 
    47724779 
    4773     // append token to request 
    4774     this.goto_url('delete-identity', '_iid='+id+'&_token='+this.env.request_token, true); 
     4780    // submit request with appended token 
     4781    if (confirm(this.get_label('deleteidentityconfirm'))) 
     4782      this.goto_url('delete-identity', '_iid='+id+'&_token='+this.env.request_token, true); 
    47754783 
    47764784    return true; 
     4785  }; 
     4786   
     4787  this.update_identity_row = function(id, name, add) 
     4788  { 
     4789    var row, col, list = this.identity_list, 
     4790      rid = this.html_identifier(id); 
     4791 
     4792    if (list.rows[rid] && (row = list.rows[rid].obj)) { 
     4793      $(row.cells[0]).html(name); 
     4794    } 
     4795    else if (add) { 
     4796      row = $('<tr>').attr('id', 'rcmrow'+rid).get(0); 
     4797      col = $('<td>').addClass('mail').html(name).appendTo(row); 
     4798      list.insert_row(row); 
     4799      list.select(rid); 
     4800    } 
    47774801  }; 
    47784802 
  • trunk/roundcubemail/program/localization/en_US/messages.inc

    r5490 r5686  
    110110$messages['receiptsent'] = 'Successfully sent a read receipt.'; 
    111111$messages['errorsendingreceipt'] = 'Could not send the receipt.'; 
     112$messages['deleteidentityconfirm'] = 'Do you really want to delete this identity?'; 
    112113$messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.'; 
    113114$messages['forbiddencharacter'] = 'Folder name contains a forbidden character.'; 
  • trunk/roundcubemail/program/steps/settings/edit_identity.inc

    r5617 r5686  
    152152$OUTPUT->add_handler('identityform', 'rcube_identity_form'); 
    153153$OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); 
     154$OUTPUT->add_label('deleteidentityconfirm'); 
    154155 
    155156$OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem'))); 
  • trunk/roundcubemail/program/steps/settings/identities.inc

    r4410 r5686  
    2323 
    2424$OUTPUT->set_pagetitle(rcube_label('identities')); 
    25  
    2625$OUTPUT->include_script('list.js'); 
    2726 
     
    4443$OUTPUT->add_handler('identityframe', 'rcmail_identity_frame'); 
    4544$OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); 
     45$OUTPUT->add_label('deleteidentityconfirm'); 
    4646 
    4747$OUTPUT->send('identities'); 
  • trunk/roundcubemail/program/steps/settings/save_identity.inc

    r5564 r5686  
    9797    if ($_POST['_framed']) { 
    9898      // update the changed col in list 
    99       // ... 
     99      $OUTPUT->command('parent.update_identity_row', $iid, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>'))); 
    100100    } 
    101101  } 
     
    136136    if (!empty($_POST['_standard'])) 
    137137      $default_id = $insert_id; 
     138 
     139    if ($_POST['_framed']) { 
     140      // add a new row to the list 
     141      $OUTPUT->command('parent.update_identity_row', $insert_id, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>')), true); 
     142    } 
    138143  } 
    139144  else { 
     
    153158 
    154159// go to next step 
    155 rcmail_overwrite_action('identities'); 
     160if (!empty($_REQUEST['_framed'])) { 
     161  rcmail_overwrite_action('edit-identity'); 
     162} 
     163else 
     164  rcmail_overwrite_action('identities'); 
  • trunk/roundcubemail/skins/larry/templates/identities.html

    r5619 r5686  
    2121</div> 
    2222<div class="boxfooter"> 
    23 <roundcube:button command="add" type="link" title="newidentity" class="listbutton add disabled" classAct="listbutton add" innerClass="inner" content="+" condition="config:identities_level:0<2" /> 
     23<roundcube:button command="add" type="link" title="newidentity" class="listbutton add disabled" classAct="listbutton add" innerClass="inner" content="+" condition="config:identities_level:0<2" /><roundcube:button command="delete" type="link" title="delete" class="listbutton delete disabled" classAct="listbutton delete" innerClass="inner" content="-" condition="config:identities_level:0<2" /> 
    2424</div> 
    2525</div> 
    2626 
    27 <div id="identity-details" class="uibox contentbox watermark"> 
    28 <roundcube:object name="message" id="message" class="statusbar" /> 
     27<div id="identity-details" class="uibox contentbox"> 
     28        <roundcube:object name="identityframe" id="preferences-frame" style="width:100%; height:96%" src="/watermark.html" /> 
     29        <roundcube:object name="message" id="message" class="statusbar" /> 
    2930</div> 
    3031 
  • trunk/roundcubemail/skins/larry/templates/identityedit.html

    r5619 r5686  
    55<roundcube:include file="/includes/links.html" /> 
    66</head> 
    7 <body> 
     7<body class="iframe"> 
    88 
    9 <roundcube:include file="/includes/header.html" /> 
     9<h1 class="boxtitle"><roundcube:object name="steptitle" /></h1> 
    1010 
    11 <div id="mainscreen" class="offset"> 
    12  
    13 <roundcube:include file="/includes/settingstabs.html" /> 
    14  
    15 <div id="settings-right"> 
    16  
    17 <div id="identitieslist" class="uibox listbox"> 
    18 <h2 class="boxtitle"><roundcube:label name="identities" /></h2> 
    19 <div class="scroller withfooter"> 
    20 <roundcube:object name="identitiesList" id="identities-table" class="listing" noheader="true" editIcon="" /> 
    21 </div> 
    22 <div class="boxfooter"> 
    23 <roundcube:button command="add" type="link" title="newidentity" class="listbutton add disabled" classAct="listbutton add" innerClass="inner" content="+" condition="config:identities_level:0<2" /> 
    24 </div> 
     11<div id="preferences-details" class="boxcontent"> 
     12<roundcube:object name="identityform" class="propform" size="40" textareacols="40" textarearows="6" /> 
    2513</div> 
    2614 
    27 <div id="identity-details" class="uibox contentbox"> 
    28 <h1 class="boxtitle"><roundcube:object name="steptitle" /></h1> 
    29  
    30 <div class="boxcontent scroller"> 
    31 <roundcube:object name="identityform" class="propform" size="40" textareacols="40" textarearows="6" /> 
    32  
    33 <p class="formbuttons"> 
     15<div id="formfooter"> 
     16<div class="footerleft formbuttons"> 
    3417        <roundcube:button command="save" type="input" class="button mainaction" label="save" /> 
    35         <roundcube:button command="delete" type="input" class="button" label="delete" condition="env:action=='edit-identity'" /> 
    36 </p> 
     18        <roundcube:button command="delete" type="input" class="button" label="delete" condition="env:action=='edit-identity' && config:identities_level:0<2" /> 
    3719</div> 
    38  
    39 <roundcube:object name="message" id="message" class="statusbar" /> 
    40 </div> 
    41  
    42 </div> 
    43  
    4420</div> 
    4521 
  • trunk/roundcubemail/skins/larry/ui.js

    r5685 r5686  
    121121          orientation:'v', relative:true, start:305, min:150, size:12 }).init(); 
    122122      } 
    123       else if (rcmail.env.action.indexOf('identit') >= 0) { 
     123      else if (rcmail.env.action == 'identities') { 
    124124        new rcube_splitter({ id:'identviewsplitter', p1:'#identitieslist', p2:'#identity-details', 
    125125          orientation:'v', relative:true, start:305, min:150, size:12 }).init(); 
Note: See TracChangeset for help on using the changeset viewer.