enable translations for quota sizes 'none' and 'default'
This commit is contained in:
parent
74d41b8b96
commit
436df6b67d
|
@ -36,6 +36,11 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
|
||||||
<div class="quota-select-wrapper">
|
<div class="quota-select-wrapper">
|
||||||
<?php if((bool) $_['isadmin']): ?>
|
<?php if((bool) $_['isadmin']): ?>
|
||||||
<select class='quota'>
|
<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 foreach($_['quota_preset'] as $preset):?>
|
||||||
<?php if($preset!='default'):?>
|
<?php if($preset!='default'):?>
|
||||||
<option
|
<option
|
||||||
|
@ -45,7 +50,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
|
||||||
</option>
|
</option>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<?php endforeach;?>
|
<?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"
|
<option selected="selected"
|
||||||
value='<?php echo $_['default_quota'];?>'>
|
value='<?php echo $_['default_quota'];?>'>
|
||||||
<?php echo $_['default_quota'];?>
|
<?php echo $_['default_quota'];?>
|
||||||
|
@ -55,7 +60,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
|
||||||
<?php echo $l->t('Other');?>
|
<?php echo $l->t('Other');?>
|
||||||
...
|
...
|
||||||
</option>
|
</option>
|
||||||
</select> <input class='quota-other'></input>
|
</select> <input class='quota-other'/>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if((bool) !$_['isadmin']): ?>
|
<?php if((bool) !$_['isadmin']): ?>
|
||||||
<select class='quota' disabled="disabled">
|
<select class='quota' disabled="disabled">
|
||||||
|
@ -122,6 +127,16 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
|
||||||
<td class="quota">
|
<td class="quota">
|
||||||
<div class="quota-select-wrapper">
|
<div class="quota-select-wrapper">
|
||||||
<select class='quota-user'>
|
<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):?>
|
<?php foreach($_['quota_preset'] as $preset):?>
|
||||||
<option
|
<option
|
||||||
<?php if($user['quota']==$preset) echo 'selected="selected"';?>
|
<?php if($user['quota']==$preset) echo 'selected="selected"';?>
|
||||||
|
@ -129,7 +144,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
|
||||||
<?php echo $preset;?>
|
<?php echo $preset;?>
|
||||||
</option>
|
</option>
|
||||||
<?php endforeach;?>
|
<?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'];?>'>
|
<option selected="selected" value='<?php echo $user['quota'];?>'>
|
||||||
<?php echo $user['quota'];?>
|
<?php echo $user['quota'];?>
|
||||||
</option>
|
</option>
|
||||||
|
@ -138,7 +153,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
|
||||||
<?php echo $l->t('Other');?>
|
<?php echo $l->t('Other');?>
|
||||||
...
|
...
|
||||||
</option>
|
</option>
|
||||||
</select> <input class='quota-other'></input>
|
</select> <input class='quota-other'/>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="remove">
|
<td class="remove">
|
||||||
|
|
|
@ -30,10 +30,15 @@ if($isadmin) {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($accessibleusers as $i) {
|
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(
|
$users[] = array(
|
||||||
"name" => $i,
|
"name" => $i,
|
||||||
"groups" => join( ", ", /*array_intersect(*/OC_Group::getUserGroups($i)/*, OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()))*/),
|
"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)));
|
'subadmin'=>implode(', ', OC_SubAdmin::getSubAdminsGroups($i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,13 +46,14 @@ foreach( $accessiblegroups as $i ) {
|
||||||
// Do some more work here soon
|
// Do some more work here soon
|
||||||
$groups[] = array( "name" => $i );
|
$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);
|
$quotaPreset=explode(',', $quotaPreset);
|
||||||
foreach($quotaPreset as &$preset) {
|
foreach($quotaPreset as &$preset) {
|
||||||
$preset=trim($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 = new OC_Template( "settings", "users", "user" );
|
||||||
$tmpl->assign( "users", $users );
|
$tmpl->assign( "users", $users );
|
||||||
|
|
Loading…
Reference in New Issue