bug fix: remove old references to unknown 'bw_web' quota values linking to not existing stats_show_per_month.php page and menu gadget
(anyone aiming to display custom menu gadget or size based quota could return in_menu=1 and type=size array values in hook_quota_get() function)
This commit is contained in:
parent
e32e8837c0
commit
0c840f9f2e
|
@ -54,9 +54,7 @@ reset($qlist);
|
|||
echo _($val);
|
||||
if ($q[$key]["u"] >= $q[$key]["t"]) echo "</font>";
|
||||
|
||||
if ($key == 'bw_web') {
|
||||
echo " </td><td>". format_size($q[$key]["u"]) ." </td><td>". format_size($q[$key]["t"]) ." </td>";
|
||||
} elseif ($key == 'web') {
|
||||
if (($key == 'web')||(isset($q[$key]['type'])&&($q[$key]['type']=='size'))) {
|
||||
echo " </td><td>". format_size($q[$key]["u"] * 1024) . " </td><td>". format_size($q[$key]["t"] * 1024) ." </td>";
|
||||
} else {
|
||||
echo " </td><td>".$q[$key]["u"]." </td><td>".$q[$key]["t"]." </td>";
|
||||
|
|
|
@ -71,14 +71,16 @@ class m_quota {
|
|||
|
||||
$q = $this->getquota();
|
||||
|
||||
foreach (array('web', 'bw_web') as $key) {
|
||||
if (!isset($q[$key]["u"]) || empty($q[$key]["t"])) {
|
||||
continue;
|
||||
}
|
||||
$usage_percent = (int) ($q[$key]["u"] / $q[$key]["t"] * 100);
|
||||
$obj['links'][] = array('txt' => _("quota_" . $key) . " " . sprintf(_("%s%% of %s"), $usage_percent, format_size($q[$key]["t"] * 1024)), 'url' => ($key == 'bw_web' ? 'stats_show_per_month.php' : 'quota_show.php'));
|
||||
$obj['links'][] = array('txt' => 'progressbar', 'total' => $q[$key]["t"], 'used' => $q[$key]["u"]);
|
||||
}
|
||||
foreach ($q as $key=>$value)
|
||||
if (($key=="web")||(isset($value['in_menu'])&&$value['in_menu'])) {
|
||||
if (!isset($q[$key]["u"]) || empty($q[$key]["t"])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$usage_percent = (int) ($q[$key]["u"] / $q[$key]["t"] * 100);
|
||||
$obj['links'][] = array('txt' => _("quota_" . $key) . " " . sprintf(_("%s%% of %s"), $usage_percent, format_size($q[$key]["t"] * 1024)), 'url' => 'quota_show.php');
|
||||
$obj['links'][] = array('txt' => 'progressbar', 'total' => $q[$key]["t"], 'used' => $q[$key]["u"]);
|
||||
}
|
||||
|
||||
// do not return menu item if there is no quota
|
||||
if (!count($obj['links'])) return false;
|
||||
|
|
Loading…
Reference in New Issue