Skip to content
Snippets Groups Projects
Commit dba33bf1 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#53174, track tab should not be visible when tracker is switched off., patch by Ber

parent a6cb8d7a
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -130,12 +130,12 @@ function statistics_menu($may_cache) { ...@@ -130,12 +130,12 @@ function statistics_menu($may_cache) {
'type' => MENU_CALLBACK); 'type' => MENU_CALLBACK);
} }
else { else {
if (arg(0) == 'user' && is_numeric(arg(1))) { if (arg(0) == 'user' && is_numeric(arg(1)) && variable_get('statistics_enable_access_log', 0)) {
$items[] = array('path' => 'user/'. arg(1) .'/track/navigation', 'title' => t('track page visits'), $items[] = array('path' => 'user/'. arg(1) .'/track/navigation', 'title' => t('track page visits'),
'callback' => 'statistics_user_tracker', 'access' => $access, 'callback' => 'statistics_user_tracker', 'access' => $access,
'type' => MENU_LOCAL_TASK, 'weight' => 2); 'type' => MENU_LOCAL_TASK, 'weight' => 2);
} }
if (arg(0) == 'node' && is_numeric(arg(1))) { if (arg(0) == 'node' && is_numeric(arg(1)) && variable_get('statistics_enable_access_log', 0)) {
$items[] = array('path' => 'node/'. arg(1) .'/track', 'title' => t('track'), $items[] = array('path' => 'node/'. arg(1) .'/track', 'title' => t('track'),
'callback' => 'statistics_node_tracker', 'access' => $access, 'callback' => 'statistics_node_tracker', 'access' => $access,
'type' => MENU_LOCAL_TASK, 'weight' => 2); 'type' => MENU_LOCAL_TASK, 'weight' => 2);
......
...@@ -130,12 +130,12 @@ function statistics_menu($may_cache) { ...@@ -130,12 +130,12 @@ function statistics_menu($may_cache) {
'type' => MENU_CALLBACK); 'type' => MENU_CALLBACK);
} }
else { else {
if (arg(0) == 'user' && is_numeric(arg(1))) { if (arg(0) == 'user' && is_numeric(arg(1)) && variable_get('statistics_enable_access_log', 0)) {
$items[] = array('path' => 'user/'. arg(1) .'/track/navigation', 'title' => t('track page visits'), $items[] = array('path' => 'user/'. arg(1) .'/track/navigation', 'title' => t('track page visits'),
'callback' => 'statistics_user_tracker', 'access' => $access, 'callback' => 'statistics_user_tracker', 'access' => $access,
'type' => MENU_LOCAL_TASK, 'weight' => 2); 'type' => MENU_LOCAL_TASK, 'weight' => 2);
} }
if (arg(0) == 'node' && is_numeric(arg(1))) { if (arg(0) == 'node' && is_numeric(arg(1)) && variable_get('statistics_enable_access_log', 0)) {
$items[] = array('path' => 'node/'. arg(1) .'/track', 'title' => t('track'), $items[] = array('path' => 'node/'. arg(1) .'/track', 'title' => t('track'),
'callback' => 'statistics_node_tracker', 'access' => $access, 'callback' => 'statistics_node_tracker', 'access' => $access,
'type' => MENU_LOCAL_TASK, 'weight' => 2); 'type' => MENU_LOCAL_TASK, 'weight' => 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment