mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
N°3294 - Display and refresh counters in OQL menu entries
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
|
||||
namespace Combodo\iTop\Controller;
|
||||
|
||||
use ajax_page;
|
||||
use AjaxPage;
|
||||
use ApplicationMenu;
|
||||
use BulkExport;
|
||||
use BulkExportException;
|
||||
use DBObjectSearch;
|
||||
@@ -18,13 +19,13 @@ use utils;
|
||||
class AjaxRenderController
|
||||
{
|
||||
/**
|
||||
* @param \ajax_page $oPage
|
||||
* @param \AjaxPage $oPage
|
||||
*
|
||||
* @param bool $bTokenOnly
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function ExportBuild(ajax_page $oPage, bool $bTokenOnly)
|
||||
public function ExportBuild(AjaxPage $oPage, bool $bTokenOnly)
|
||||
{
|
||||
register_shutdown_function(function () {
|
||||
$aErr = error_get_last();
|
||||
@@ -113,4 +114,19 @@ class AjaxRenderController
|
||||
$oPage->add(json_encode($aResult));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the menus count
|
||||
*
|
||||
* The resulting JSON is added to the page with the format:
|
||||
* {"code": "done or error", "counts": {"menu_id_1": count1, "menu_id_2": count2...}}
|
||||
*
|
||||
* @param \AjaxPage $oPage
|
||||
*/
|
||||
public function GetMenusCount(AjaxPage $oPage)
|
||||
{
|
||||
$aCounts = ApplicationMenu::GetMenusCount();
|
||||
$aResult = ['code' => 'done', 'counts' => $aCounts];
|
||||
$oPage->add(json_encode($aResult));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user