summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2012-12-20 15:35:36 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2012-12-20 15:35:36 +0100
commit436df6b67d1bcb9c4b5bd659319f2c0d38a0645b (patch)
tree5360b8d3fbd5c57681f92c8f027386480030c94c /settings
parent74d41b8b96e48fa7ac6aaca132340c94ccd50964 (diff)
downloadnextcloud-server-436df6b67d1bcb9c4b5bd659319f2c0d38a0645b.tar.gz
nextcloud-server-436df6b67d1bcb9c4b5bd659319f2c0d38a0645b.zip
enable translations for quota sizes 'none' and 'default'
Diffstat (limited to 'settings')
-rw-r--r--settings/templates/users.php23
-rw-r--r--settings/users.php12
2 files changed, 28 insertions, 7 deletions
diff --git a/settings/templates/users.php b/settings/templates/users.php
index 4328bb459b1..143dc52af5c 100644
--- a/settings/templates/users.php
+++ b/settings/templates/users.php
@@ -36,6 +36,11 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
<div class="quota-select-wrapper">
<?php if((bool) $_['isadmin']): ?>
<select class='quota'>
+ <option
+ <?php if($_['default_quota']=='none') echo 'selected="selected"';?>
+ value='none'>
+ <?php echo $l->t('Unlimited');?>
+ </option>
<?php foreach($_['quota_preset'] as $preset):?>
<?php if($preset!='default'):?>
<option
@@ -45,7 +50,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
</option>
<?php endif;?>
<?php endforeach;?>
- <?php if(array_search($_['default_quota'], $_['quota_preset'])===false):?>
+ <?php if(array_search($_['default_quota'], $_['quota_preset'])===false && array_search($_['default_quota'], array('none', 'default'))===false):?>
<option selected="selected"
value='<?php echo $_['default_quota'];?>'>
<?php echo $_['default_quota'];?>
@@ -55,7 +60,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
<?php echo $l->t('Other');?>
...
</option>
- </select> <input class='quota-other'></input>
+ </select> <input class='quota-other'/>
<?php endif; ?>
<?php if((bool) !$_['isadmin']): ?>
<select class='quota' disabled="disabled">
@@ -122,6 +127,16 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
<td class="quota">
<div class="quota-select-wrapper">
<select class='quota-user'>
+ <option
+ <?php if($user['quota']=='default') echo 'selected="selected"';?>
+ value='default'>
+ <?php echo $l->t('Default');?>
+ </option>
+ <option
+ <?php if($user['quota']=='none') echo 'selected="selected"';?>
+ value='none'>
+ <?php echo $l->t('Unlimited');?>
+ </option>
<?php foreach($_['quota_preset'] as $preset):?>
<option
<?php if($user['quota']==$preset) echo 'selected="selected"';?>
@@ -129,7 +144,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
<?php echo $preset;?>
</option>
<?php endforeach;?>
- <?php if(array_search($user['quota'], $_['quota_preset'])===false):?>
+ <?php if(array_search($user['quota'], $_['quota_preset'])===false && array_search($user['quota'], array('none', 'default'))===false):?>
<option selected="selected" value='<?php echo $user['quota'];?>'>
<?php echo $user['quota'];?>
</option>
@@ -138,7 +153,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
<?php echo $l->t('Other');?>
...
</option>
- </select> <input class='quota-other'></input>
+ </select> <input class='quota-other'/>
</div>
</td>
<td class="remove">
diff --git a/settings/users.php b/settings/users.php
index 2fd10f1d6ec..3dee152bb15 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -30,10 +30,15 @@ if($isadmin) {
}
foreach($accessibleusers as $i) {
+ $quota=OC_Preferences::getValue($i, 'files', 'quota', 'default');
+ // translation of old value 'none' to 'unlimited'
+ if ($quota=='none')
+ $quota='unlimited';
+
$users[] = array(
"name" => $i,
"groups" => join( ", ", /*array_intersect(*/OC_Group::getUserGroups($i)/*, OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()))*/),
- 'quota'=>OC_Preferences::getValue($i, 'files', 'quota', 'Default'),
+ 'quota'=>OC_Preferences::getValue($i, 'files', 'quota', 'default'),
'subadmin'=>implode(', ', OC_SubAdmin::getSubAdminsGroups($i)));
}
@@ -41,13 +46,14 @@ foreach( $accessiblegroups as $i ) {
// Do some more work here soon
$groups[] = array( "name" => $i );
}
-$quotaPreset=OC_Appconfig::getValue('files', 'quota_preset', 'Default, Unlimited, 1 GB, 5 GB, 10 GB');
+$quotaPreset=OC_Appconfig::getValue('files', 'quota_preset', '1 GB, 5 GB, 10 GB');
$quotaPreset=explode(',', $quotaPreset);
foreach($quotaPreset as &$preset) {
$preset=trim($preset);
}
+$quotaPreset=array_diff($quotaPreset, array('default', 'none'));
-$defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'Unlimited');
+$defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'none');
$tmpl = new OC_Template( "settings", "users", "user" );
$tmpl->assign( "users", $users );