feature #534, modernize admin homepage {wip}

* add tab
* display the pending comments as a "message" (new blue box)
* remove anything related to environment #532
* display stats as big icon + big number + caption
* new stat "storage used"
This commit is contained in:
plegall
2016-10-07 14:30:54 +02:00
parent 41fe517590
commit 5dbc6c85a9
5 changed files with 200 additions and 121 deletions
+4
View File
@@ -27,6 +27,10 @@ function add_core_tabs($sheets, $tab_id)
{
switch($tab_id)
{
case 'admin_home':
$sheets[''] = array('caption' => l10n('Administration Home'), 'url' => 'admin.php');
break;
case 'album':
global $admin_album_base_url;
$sheets['properties'] = array('caption' => '<span class="icon-pencil"></span>'.l10n('Properties'), 'url' => $admin_album_base_url.'-properties');
+26
View File
@@ -3006,3 +3006,29 @@ UPDATE '.IMAGES_TABLE.'
;';
pwg_query($query);
}
/**
* Get a more human friendly representation of big numbers. Like 17.8k instead of 17832
*
* @since 2.9
* @param float $numbers
*/
function number_format_human_readable($numbers)
{
$readable = array("", "k", "M");
$index = 0;
while ($numbers >= 1000)
{
$numbers /= 1000;
$index++;
if ($index > count($readable) - 1)
{
$index--;
break;
}
}
return number_format($numbers, 1).$readable[$index];
}