Changeset 1796 in subversion


Ignore:
Timestamp:
Sep 15, 2008 10:53:57 AM (5 years ago)
Author:
thomasb
Message:

Redesign of the identities settings + add config option to disable multiple identities

Location:
trunk/roundcubemail
Files:
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r1793 r1796  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42008/09/15 (thomasb) 
     5---------- 
     6- Redesign of the identities settings (#1484042) 
     7- Add config option to disable creation/deletion of identities (#1484498) 
    38 
    492008/09/15 (alec) 
  • trunk/roundcubemail/config/main.inc.php.dist

    r1793 r1796  
    299299$rcmail_config['dont_override'] = array(); 
    300300 
     301// allow users to add and delete sender identities 
     302$rcmail_config['multiple_identities'] = true; 
     303 
    301304// try to load host-specific configuration 
    302305// see http://trac.roundcube.net/wiki/Howto_Config for more details 
  • trunk/roundcubemail/program/include/rcube_template.php

    r1767 r1796  
    107107    } 
    108108 
     109 
     110    /** 
     111     * Getter for the current page title 
     112     * 
     113     * @return string The page title 
     114     */ 
     115    public function get_pagetitle() 
     116    { 
     117        if (!empty($this->pagetitle)) { 
     118            $title = $this->pagetitle; 
     119        } 
     120        else if ($this->env['task'] == 'login') { 
     121            $title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name']))); 
     122        } 
     123        else { 
     124            $title = ucfirst($this->env['task']); 
     125        } 
     126         
     127        return $title; 
     128    } 
     129 
     130 
    109131    /** 
    110132     * Set skin 
     
    358380            ); 
    359381        } 
    360         // add command to set page title 
    361         if ($this->ajax_call && !empty($this->pagetitle)) { 
    362             $out .= sprintf( 
    363                 "this.set_pagetitle('%s');\n", 
    364                 JQ((!empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '') . $this->pagetitle) 
    365             ); 
    366         } 
     382         
    367383        return $out; 
    368384    } 
     
    456472            array( 
    457473                '/session:([a-z0-9_]+)/i', 
    458                 '/config:([a-z0-9_]+)/i', 
     474                '/config:([a-z0-9_]+)(:([a-z0-9_]+))?/i', 
    459475                '/env:([a-z0-9_]+)/i', 
    460476                '/request:([a-z0-9_]+)/ie' 
     
    462478            array( 
    463479                "\$_SESSION['\\1']", 
    464                 "\$this->config['\\1']", 
     480                "\$this->app->config->get('\\1',get_boolean('\\3'))", 
    465481                "\$this->env['\\1']", 
    466482                "get_input_value('\\1', RCUVE_INPUT_GPC)" 
     
    592608                    return $ver; 
    593609                } 
     610                if ($object=='steptitle') { 
     611                  return Q($this->get_pagetitle()); 
     612                } 
    594613                if ($object=='pagetitle') { 
    595                     $task  = $this->env['task']; 
    596614                    $title = !empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : ''; 
    597  
    598                     if (!empty($this->pagetitle)) { 
    599                         $title .= $this->pagetitle; 
    600                     } 
    601                     else if ($task == 'login') { 
    602                         $title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name']))); 
    603                     } 
    604                     else { 
    605                         $title .= ucfirst($task); 
    606                     } 
    607  
     615                    $title .= $this->get_pagetitle(); 
    608616                    return Q($title); 
    609617                } 
  • trunk/roundcubemail/program/js/app.js

    r1789 r1796  
    296296        this.enable_command('preferences', 'identities', 'save', 'folders', true); 
    297297         
    298         if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') 
    299           this.enable_command('edit', 'add', 'delete', true); 
     298        if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') { 
     299          this.enable_command('add', 'delete', this.env.multiple_identities); 
     300          this.enable_command('edit', true); 
     301        } 
    300302 
    301303        if (this.env.action=='edit-identity' || this.env.action=='add-identity') 
  • trunk/roundcubemail/program/localization/de_CH/messages.inc

    r1716 r1796  
    8686$messages['importerror'] = 'Import fehlgeschlagen! Die hochgeladene Datei ist nicht im vCard-Format.'; 
    8787$messages['importconfirm'] = '<b>Es wurden $inserted Adressen erfolgreich importiert und $skipped bestehende EintrÀge ÃŒbersprungen</b>:<p><em>$names</em></p>'; 
     88$messages['opnotpermitted'] = 'Operation nicht erlaubt!'; 
    8889 
    8990?> 
  • trunk/roundcubemail/program/localization/de_DE/messages.inc

    r1761 r1796  
    8686$messages['importerror'] = 'Import fehlgeschlagen! Die hochgeladene Datei ist nicht im vCard-Format.'; 
    8787$messages['importconfirm'] = 'Es wurden $inserted Adressen erfolgreich importiert und $skipped bestehende EintrÀge ÃŒbersprungen:$names'; 
     88$messages['opnotpermitted'] = 'Operation nicht erlaubt!'; 
    8889 
    8990?> 
  • trunk/roundcubemail/program/localization/en_US/messages.inc

    r1793 r1796  
    8787$messages['importerror'] = 'Import failed! The uploaded file is not a valid vCard file.'; 
    8888$messages['importconfirm'] = '<b>Successfully imported $inserted contacts, $skipped existing entries skipped</b>:<p><em>$names</em></p>'; 
     89$messages['opnotpermitted'] = 'Operation not permitted!'; 
    8990 
    9091?> 
  • trunk/roundcubemail/program/steps/settings/delete_identity.inc

    r1035 r1796  
    2222if (($ids = get_input_value('_iid', RCUBE_INPUT_GET)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $ids)) 
    2323{ 
    24  
    25   if ($USER->delete_identity($ids)) 
    26   { 
    27     $OUTPUT->show_message('deletedsuccessfully', 'confirmation'); 
     24  if ($RCMAIL->config->get('multiple_identities', true)) { 
     25    if ($USER->delete_identity($ids)) { 
     26      $OUTPUT->show_message('deletedsuccessfully', 'confirmation'); 
     27    } 
     28    else { 
     29      $OUTPUT->show_message('nodeletelastidentity', 'error'); 
     30    } 
    2831  } 
    29   else  
    30   { 
    31     $OUTPUT->show_message('nodeletelastidentity', 'error'); 
     32  else { 
     33    $OUTPUT->show_message('opnotpermitted', 'error'); 
    3234  } 
     35   
    3336  // send response 
    3437  if ($OUTPUT->ajax_call) 
  • trunk/roundcubemail/program/steps/settings/edit_identity.inc

    r1788 r1796  
    2222$OUTPUT->set_pagetitle(rcube_label('identities')); 
    2323 
    24 if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') 
    25   { 
     24if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') { 
    2625  $IDENTITY_RECORD = $USER->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC)); 
    2726   
    2827  if (is_array($IDENTITY_RECORD)) 
    2928    $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']); 
    30   } 
    31  
     29} 
     30else if (!$RCMAIL->config->get('multiple_identities', true)) { 
     31  $OUTPUT->show_message('opnotpermitted', 'error'); 
     32  // go to identities page 
     33  rcmail_overwrite_action('identities'); 
     34  return; 
     35} 
    3236 
    3337$OUTPUT->include_script('list.js'); 
     
    137141$OUTPUT->add_handler('identityform', 'rcube_identity_form'); 
    138142 
     143$OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem'))); 
     144 
    139145if ($RCMAIL->action=='add-identity' && $OUTPUT->template_exists('addidentity')) 
    140146  $OUTPUT->send('addidentity'); 
  • trunk/roundcubemail/program/steps/settings/func.inc

    r1792 r1796  
    302302 
    303303  // define list of cols to be displayed 
    304   $a_show_cols = array('name', 'email', 'organization', 'reply-to'); 
     304  $a_show_cols = array('name', 'email'); 
    305305 
    306306  // create XHTML table   
     
    367367  } 
    368368 
     369$OUTPUT->set_env('multiple_identities', $RCMAIL->config->get('multiple_identities', true)); 
    369370 
    370371// register UI objects 
  • trunk/roundcubemail/program/steps/settings/save_identity.inc

    r1407 r1796  
    7878 
    7979// insert a new identity record 
    80 else 
     80else if ($RCMAIL->config->get('multiple_identities', true)) 
    8181{ 
    8282  if ($insert_id = $USER->insert_identity($save_data)) 
     
    9797  } 
    9898} 
     99else 
     100  $OUTPUT->show_message('opnotpermitted', 'error'); 
    99101 
    100102 
  • trunk/roundcubemail/skins/default/settings.css

    r1785 r1796  
    77  top: 50px; 
    88  left: 220px; 
    9   right: 60px; 
     9  right: 40px; 
    1010  height: 22px; 
    1111  border-bottom: 1px solid #999999; 
    1212  white-space: nowrap; 
    1313  /* css hack for IE */ 
    14   width: expression((parseInt(document.documentElement.clientWidth)-280)+'px'); 
     14  width: expression((parseInt(document.documentElement.clientWidth)-260)+'px'); 
    1515} 
    1616 
     
    8888} 
    8989 
     90#identities-list 
     91{ 
     92  bottom: 60px; 
     93  width: 420px; 
     94  border: 1px solid #999999; 
     95} 
     96 
     97#listbuttons 
     98{ 
     99  position: absolute; 
     100  left: 20px; 
     101  bottom: 18px; 
     102} 
     103 
    90104#identities-table 
    91105{ 
    92   width: 600px; 
    93   border: 1px solid #999999; 
     106  width: 420px; 
     107  table-layout: fixed; 
    94108  background-color: #F9F9F9; 
    95109} 
     
    98112{ 
    99113  cursor: default; 
     114  overflow: hidden; 
     115  text-overflow: ellipsis; 
     116} 
     117 
     118#identities-table thead td.name 
     119{ 
     120  width: 55%; 
     121} 
     122 
     123#identities-table thead td.email 
     124{ 
     125  width: 45%; 
    100126} 
    101127 
     
    109135#identity-details 
    110136{ 
    111   margin-top: 30px; 
    112   width: 600px; 
    113   border: 1px solid #999999; 
     137  position: absolute; 
     138  top: 95px; 
     139  left: 450px; 
     140  right: 40px; 
     141  bottom: 60px; 
     142  border: 1px solid #999999; 
     143  overflow: auto; 
     144  /* css hack for IE */ 
     145  width: expression((parseInt(document.documentElement.clientWidth)-490)+'px'); 
     146  height: expression((parseInt(document.documentElement.clientHeight)-160)+'px'); 
    114147} 
    115148 
  • trunk/roundcubemail/skins/default/templates/editidentity.html

    r1716 r1796  
    1515<div id="identities-list"> 
    1616<roundcube:object name="identitiesList" id="identities-table" class="records-table" cellspacing="0" summary="Identities list" editIcon="" /> 
     17</div> 
    1718 
    18 <p><roundcube:button command="add" type="input" label="newidentity" class="button" /></p> 
     19<p id="listbuttons"> 
     20<roundcube:button command="add" type="input" label="newidentity" class="button" condition="config:multiple_identities:true" /> 
     21</p> 
    1922 
    2023<div id="identity-details"> 
    21 <div id="identity-title"><roundcube:label name="edititem" /></div> 
     24<div id="identity-title"><roundcube:object name="steptitle" /></div> 
    2225 
    2326<div style="padding:15px;"> 
     
    2528 
    2629<p><br /> 
    27 <roundcube:button command="delete" type="input" class="button" label="delete" />&nbsp; 
     30<roundcube:button command="delete" type="input" class="button" label="delete" condition="env:action=='edit-identity'&&config:multiple_identities:true" style="margin-right:0.5em" /> 
    2831<roundcube:button command="save" type="input" class="button mainaction" label="save" /> 
    2932</p> 
    30 </div> 
    3133</div> 
    3234</div> 
  • trunk/roundcubemail/skins/default/templates/identities.html

    r1029 r1796  
    1414<div id="identities-list"> 
    1515<roundcube:object name="identitiesList" id="identities-table" class="records-table" cellspacing="0" summary="Identities list" editIcon="" /> 
     16</div> 
    1617 
    17 <p><roundcube:button command="add" type="input" label="newidentity" class="button" /></p> 
     18<p id="listbuttons"> 
     19<roundcube:button command="add" type="input" label="newidentity" class="button" condition="config:multiple_identities:true" /> 
     20</p> 
     21 
     22<div id="identity-details"> 
     23  <div style="margin:10px auto; text-align:center"> 
     24  <img src="/images/rcube_watermark.png" width="245" height="245" alt="RoundCube" /> 
     25  </div> 
    1826</div> 
    1927 
Note: See TracChangeset for help on using the changeset viewer.