mirror of
https://github.com/Mibew/mibew.git
synced 2025-05-07 21:13:07 +03:00
Do not use global $page array in setup_statistics_tabs func
This commit is contained in:
parent
ab56e6f35b
commit
175686aded
@ -32,16 +32,24 @@ function get_statistics_query($type)
|
|||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_statistics_tabs($active)
|
/**
|
||||||
{
|
* Builds list of the statistics tabs. The keys of the resulting array are
|
||||||
global $page;
|
* tabs titles and the values are tabs URLs.
|
||||||
$page['tabs'] = array(
|
*
|
||||||
|
* @param int $active Number of the active tab. The count starts from 0.
|
||||||
|
* @return array Tabs list
|
||||||
|
*/
|
||||||
|
function setup_statistics_tabs($active) {
|
||||||
|
$tabs = array(
|
||||||
getlocal("report.bydate.title") => $active != 0 ? (MIBEW_WEB_ROOT . "/operator/statistics.php".get_statistics_query('bydate')) : "",
|
getlocal("report.bydate.title") => $active != 0 ? (MIBEW_WEB_ROOT . "/operator/statistics.php".get_statistics_query('bydate')) : "",
|
||||||
getlocal("report.byoperator.title") => $active != 1 ? (MIBEW_WEB_ROOT . "/operator/statistics.php".get_statistics_query('byagent')) : ""
|
getlocal("report.byoperator.title") => $active != 1 ? (MIBEW_WEB_ROOT . "/operator/statistics.php".get_statistics_query('byagent')) : ""
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Settings::get('enabletracking')) {
|
if (Settings::get('enabletracking')) {
|
||||||
$page['tabs'][getlocal("report.bypage.title")] = ($active != 2 ? (MIBEW_WEB_ROOT . "/operator/statistics.php".get_statistics_query('bypage')) : "");
|
$tabs[getlocal("report.bypage.title")] = ($active != 2 ? (MIBEW_WEB_ROOT . "/operator/statistics.php".get_statistics_query('bypage')) : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $tabs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,7 +181,7 @@ $page['title'] = getlocal("statistics.title");
|
|||||||
$page['menuid'] = "statistics";
|
$page['menuid'] = "statistics";
|
||||||
|
|
||||||
prepare_menu($operator);
|
prepare_menu($operator);
|
||||||
setup_statistics_tabs($activetab);
|
$page['tabs'] = setup_statistics_tabs($activetab);
|
||||||
|
|
||||||
$page_style = new PageStyle(PageStyle::currentStyle());
|
$page_style = new PageStyle(PageStyle::currentStyle());
|
||||||
$page_style->render('statistics');
|
$page_style->render('statistics');
|
||||||
|
Loading…
Reference in New Issue
Block a user