reverting quota messup

This commit is contained in:
Benjamin Sonntag 2012-08-26 11:01:54 +00:00
parent 2bc7be8e6b
commit d56643cca2
1 changed files with 10 additions and 14 deletions

View File

@ -91,23 +91,18 @@ class m_quota {
} }
} }
} }
// New Hook
$qname=$hooks->invoke("hook_quota_names"); // return strings or arrays $qname=$hooks->invoke("hook_quota_names"); // return strings or arrays
foreach($qname as $res) foreach($qname as $res)
if ($res) { if ($res && is_array($res)) {
if (is_array($res)) { foreach($res as $k=>$v) {
foreach($res as $k) { $qlist[$k]=$v;
$qlist[$k]=_("quota_".$k); $this->clquota[$k]=$k;
$this->clquota[$k]=$c;
}
} else {
$qlist[$res]=_("quota_".$res);
$this->clquota[$res]=$c;
} }
} }
return $qlist; return $qlist;
} }
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
/** Return a ressource usage (u) and total quota (t) /** Return a ressource usage (u) and total quota (t)
@ -140,11 +135,12 @@ class m_quota {
); );
} }
} }
// New Hook :
foreach ($ttmp as $tt) { foreach ($ttmp as $tt) {
$res=$hooks->invoke("",$tt["name"]); $res=$hooks->invoke("hook_quota_get",array($tt["name"]));
foreach($res as $r) { foreach($res as $r) {
if ($r) { if ($r!==false) {
$this->quotas[$tt["name"]]=array("t"=>$tt["total"],"u"); $this->quotas[$tt["name"]]=array("t"=>$tt["total"],"u"=>$r);
} }
} }
} }