Corrige quelques appels de trad

Déduplique du code pour les profils de quota
This commit is contained in:
Alan Garcia 2013-01-31 13:28:17 +00:00
parent dd3253af2d
commit 869a871264
5 changed files with 8 additions and 21 deletions

View File

@ -95,14 +95,7 @@ if (isset($error) && $error) {
<th><label for="type"><?php __("Account type"); ?></label></th> <th><label for="type"><?php __("Account type"); ?></label></th>
<td><select name="type" id="type" class="inl"> <td><select name="type" id="type" class="inl">
<?php <?php
$db->query("SELECT distinct(type) FROM defquotas ORDER by type"); eoption($quota->listtype(), 'default', true);
while($db->next_record()) {
$type = $db->f("type");
echo "<option value=\"$type\"";
if($type == 'default')
echo " selected=\"selected\"";
echo ">$type</option>";
}
?></select> ?></select>
</td> </td>
</tr> </tr>

View File

@ -112,14 +112,7 @@ if (!$r=$admin->get($uid)) {
<th><label for="type"><?php __("Account type"); ?></label></th> <th><label for="type"><?php __("Account type"); ?></label></th>
<td><select name="type" id="type" class="inl"> <td><select name="type" id="type" class="inl">
<?php <?php
$db->query("SELECT distinct(type) FROM defquotas ORDER by type"); eoption($quota->listtype(), $r['type'], true);
while($db->next_record()) {
$type = $db->f("type");
echo "<option value=\"$type\"";
if($type == $r['type'])
echo " selected";
echo ">$type</option>";
}
?></select>&nbsp; <input type="checkbox" name="reset_quotas" id="reset_quotas" class="inc" /><label for="reset_quotas"><?php __("Reset quotas to default?") ?></label></td> ?></select>&nbsp; <input type="checkbox" name="reset_quotas" id="reset_quotas" class="inc" /><label for="reset_quotas"><?php __("Reset quotas to default?") ?></label></td>
</tr> </tr>
<tr> <tr>

View File

@ -66,7 +66,7 @@
$url = ($key == 'bw_web' ? 'stats_show_per_month.php' : 'quota_show.php'); $url = ($key == 'bw_web' ? 'stats_show_per_month.php' : 'quota_show.php');
echo "<dd>"; echo "<dd>";
echo '<div><a href="' . $url . '">' . /* _($val) */ $key . ' ' . $usage_percent . '%' . ' (' . format_size($q[$key]["u"]) . ' / ' . format_size($q[$key]["t"]) . ')</a></div>'; echo '<div><a href="' . $url . '">' . /* _($val) */ _("quota_".$key) . ' ' . $usage_percent . '%' . ' (' . format_size($q[$key]["u"]) . ' / ' . format_size($q[$key]["t"]) . ')</a></div>';
echo "</dd>"; echo "</dd>";
echo "<dd>"; echo "<dd>";
echo '<div class="progress-bar">'; echo '<div class="progress-bar">';

View File

@ -21,7 +21,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set
$totalweb = $quota->get_size_web_sum_user($mem->user["uid"]); $totalweb = $quota->get_size_web_sum_user($mem->user["uid"]);
// $totalweb is in KB, so we call get_size_unit() with it in Bytes // $totalweb is in KB, so we call get_size_unit() with it in Bytes
$t=$quota->get_size_unit($totalweb * 1024); $t=$quota->get_size_unit($totalweb * 1024);
echo "<p>"._("Web Space:")." "; echo "<p>"._("quota_web")." "; // use quota_web because it's the magically translated string
echo sprintf("%.1f", $t['size'])."&nbsp;".$t['unit']; echo sprintf("%.1f", $t['size'])."&nbsp;".$t['unit'];
echo "</p>"; echo "</p>";

View File

@ -419,12 +419,13 @@ function duration_list($name, $selected=0) {
} }
/* select_values($arr,$cur) echo des <option> du tableau $values ou de la table sql $values /* select_values($arr,$cur) echo des <option> du tableau $values ou de la table sql $values
selectionne $current par defaut. Par defaut prends les champs 0 comme id et 1 comme selectionne $current par defaut.
donnees pour la table. sinon utilise $info[0] et $info[1]. Si on lui demande poliement, il prend un tableau a une dimension
*/ */
function eoption($values,$cur,$info="") { function eoption($values,$cur,$onedim=false) {
if (is_array($values)) { if (is_array($values)) {
foreach ($values as $k=>$v) { foreach ($values as $k=>$v) {
if ( $onedim ) $k=$v;
echo "<option value=\"$k\""; echo "<option value=\"$k\"";
if ($k==$cur) echo " selected=\"selected\""; if ($k==$cur) echo " selected=\"selected\"";
echo ">".$v."</option>"; echo ">".$v."</option>";