Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Kurzemnieks <ivo.kurzemnieks@zabbix.com>2020-11-09 19:27:25 +0300
committerIvo Kurzemnieks <ivo.kurzemnieks@zabbix.com>2020-11-09 19:27:25 +0300
commit83a3e875c9d490ef8c92b7241ad50388960c6134 (patch)
tree4347be6cfada62d6fe928f5de97efca5474557a9 /ui/graphs.php
parent891c359297aae09723fc902bd4cb69e86264b762 (diff)
..F....... [ZBX-2594] added "context" variable to sub-menu URLs to highlight Templates or Hosts menu
Diffstat (limited to 'ui/graphs.php')
-rw-r--r--ui/graphs.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/ui/graphs.php b/ui/graphs.php
index eb27a6d40f1..2a6e79a4282 100644
--- a/ui/graphs.php
+++ b/ui/graphs.php
@@ -61,6 +61,7 @@ $fields = [
'show_triggers' => [T_ZBX_INT, O_OPT, null, IN('1'), null],
'group_graphid' => [T_ZBX_INT, O_OPT, null, DB_ID, null],
'copy_targetids' => [T_ZBX_INT, O_OPT, null, DB_ID, null],
+ 'context' => [T_ZBX_STR, O_MAND, null, null, null],
// actions
'action' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, IN('"graph.masscopyto","graph.massdelete","graph.updatediscover"'), null],
'add' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
@@ -491,7 +492,8 @@ elseif (isset($_REQUEST['form'])) {
'parent_discoveryid' => getRequest('parent_discoveryid'),
'group_gid' => getRequest('group_gid', []),
'hostid' => $hostid,
- 'normal_only' => getRequest('normal_only')
+ 'normal_only' => getRequest('normal_only'),
+ 'context' => getRequest('context')
];
if (!empty($data['graphid']) && !isset($_REQUEST['form_refresh'])) {
@@ -549,7 +551,7 @@ elseif (isset($_REQUEST['form'])) {
// templates
$flag = ($data['parent_discoveryid'] === null) ? ZBX_FLAG_DISCOVERY_NORMAL : ZBX_FLAG_DISCOVERY_PROTOTYPE;
$data['templates'] = makeGraphTemplatesHtml($graph['graphid'], getGraphParentTemplates([$graph], $flag),
- $flag, CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES)
+ $flag, CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_TEMPLATES), $data['context']
);
// items
@@ -670,7 +672,8 @@ else {
'sort' => $sort_field,
'sortorder' => $sort_order,
'profileIdx' => 'web.graphs.filter',
- 'active_tab' => CProfile::get('web.graphs.filter.active', 1)
+ 'active_tab' => CProfile::get('web.graphs.filter.active', 1),
+ 'context' => getRequest('context')
];
// Select graphs.
@@ -708,7 +711,13 @@ else {
CPagerHelper::savePage($page['file'], $page_num);
- $data['paging'] = CPagerHelper::paginate($page_num, $data['graphs'], $sort_order, new CUrl('graphs.php'));
+ $url = (new CUrl('graphs.php'))->setArgument('context', $data['context']);
+
+ if (hasRequest('parent_discoveryid')) {
+ $url->setArgument('parent_discoveryid', $data['parent_discoveryid']);
+ }
+
+ $data['paging'] = CPagerHelper::paginate($page_num, $data['graphs'], $sort_order, $url);
// Get graphs after paging.
$options = [