public function executeMain() { $others_count = 0; $others_size = 0; $top_count = array(); $top_size = array(); $menuManager = new MenuManager(); $sections = $menuManager->getSections(); $groupManager = new GroupManager(); $result = $groupManager->getStat(); $count = $result->getCount(); $blks = $result->getBlocks(); array_multisort($count, SORT_NUMERIC, SORT_DESC); array_multisort($blks, SORT_NUMERIC, SORT_DESC); //Create array for the count section (top10) $i = 0; foreach ($count as $key => $value) { if ($i < LIMIT) { $top_count[$key] = $value; } else { $others_count += $value; } $i++; } $top_count['Others'] = $others_count; //Create array for the volume section (top10) $i = 0; foreach ($blks as $key => $value) { if ($i < LIMIT) { $top_size[$key] = $value * DEV_BSIZE; } else { $others_size += $value * DEV_BSIZE; } $i++; } $top_size['Others'] = $others_size; $this->page->addVar('menu', $sections); $this->page->addVar('top_count', $top_count); $this->page->addVar('top_size', $top_size); $this->page->addVar('statistics', $result); $this->page->addVar('fsname', $groupManager->getfsname()); }