bug fix: quota summary was inserted directly on main page without calling the appropriate hook.
This commit is contained in:
parent
79097f48da
commit
1c049f6bc6
|
@ -106,12 +106,17 @@ if($admin->enabled) {
|
||||||
echo "</p>";
|
echo "</p>";
|
||||||
} // if $admin->enabled
|
} // if $admin->enabled
|
||||||
|
|
||||||
$c = $admin->get($cuid);
|
$blocks=$hooks->invoke("hook_homepageblock");
|
||||||
|
uasort($blocks, function($a, $b) {return $a->order<$b->order ? -1 : 1;});
|
||||||
define("QUOTASONE","1");
|
foreach ($blocks as $v) {
|
||||||
echo "<hr/>";
|
if (property_exists($v, "call")) {
|
||||||
require_once("quotas_oneuser.php");
|
$func=$v->call;
|
||||||
|
$func();
|
||||||
|
}
|
||||||
|
if (property_exists($v, "include")) {
|
||||||
|
include $v->include;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php include_once("foot.php"); ?>
|
<?php include_once("foot.php"); ?>
|
||||||
|
|
|
@ -151,7 +151,7 @@ if (!isset($mode)) { # when included from adm_login, mode is not set
|
||||||
<!-- Mailing lists -->
|
<!-- Mailing lists -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$totallist = $quota->get_size_mailman_sum_user($c["uid"]);
|
$totallist = $quota->get_size_mailman_sum_user($mem->user["uid"]);
|
||||||
if ($totallist) {
|
if ($totallist) {
|
||||||
// $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($totallist * 1024);
|
$t=$quota->get_size_unit($totallist * 1024);
|
||||||
|
|
|
@ -80,9 +80,21 @@ class m_quota {
|
||||||
$obj['links'][] = array('txt' => 'progressbar', 'total' => $q[$key]["t"], 'used' => $q[$key]["u"]);
|
$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;
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hook_homepageblock() {
|
||||||
|
return (object)Array(
|
||||||
|
'pos' => 20,
|
||||||
|
'call'=> function() {
|
||||||
|
define("QUOTASONE","1");
|
||||||
|
},
|
||||||
|
'include' => "quotas_oneuser.php"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------- */
|
/* ----------------------------------------------------------------- */
|
||||||
|
|
||||||
/** Check if a user can use a ressource.
|
/** Check if a user can use a ressource.
|
||||||
|
|
Loading…
Reference in New Issue