From d56643cca25a219494194ca10e979e673c15b6d6 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Sun, 26 Aug 2012 11:01:54 +0000 Subject: [PATCH] reverting quota messup --- bureau/class/m_quota.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/bureau/class/m_quota.php b/bureau/class/m_quota.php index 0261d6aa..a04755c6 100644 --- a/bureau/class/m_quota.php +++ b/bureau/class/m_quota.php @@ -91,23 +91,18 @@ class m_quota { } } } + // New Hook $qname=$hooks->invoke("hook_quota_names"); // return strings or arrays foreach($qname as $res) - if ($res) { - if (is_array($res)) { - foreach($res as $k) { - $qlist[$k]=_("quota_".$k); - $this->clquota[$k]=$c; - } - } else { - $qlist[$res]=_("quota_".$res); - $this->clquota[$res]=$c; - + if ($res && is_array($res)) { + foreach($res as $k=>$v) { + $qlist[$k]=$v; + $this->clquota[$k]=$k; } } return $qlist; } - + /* ----------------------------------------------------------------- */ /** Return a ressource usage (u) and total quota (t) @@ -140,11 +135,12 @@ class m_quota { ); } } + // New Hook : foreach ($ttmp as $tt) { - $res=$hooks->invoke("",$tt["name"]); + $res=$hooks->invoke("hook_quota_get",array($tt["name"])); foreach($res as $r) { - if ($r) { - $this->quotas[$tt["name"]]=array("t"=>$tt["total"],"u"); + if ($r!==false) { + $this->quotas[$tt["name"]]=array("t"=>$tt["total"],"u"=>$r); } } }