function browscap_menu in Browscap 5
Same name and namespace in other branches
- 8 browscap.module \browscap_menu()
- 6.2 browscap.module \browscap_menu()
- 6 browscap.module \browscap_menu()
- 7.2 browscap.module \browscap_menu()
- 7 browscap.module \browscap_menu()
Implementation of hook_menu().
Return value
array
File
- ./
browscap.module, line 17 - Replacement for PHP's get_browser() function
Code
function browscap_menu($may_cache) {
$items = array();
$access = user_access('access administration pages');
if ($may_cache) {
// LOG PAGES
$items[] = array(
'path' => 'admin/logs/browscap',
'title' => t('Browscap'),
'description' => t('Browser-specific site statistics.'),
'callback' => 'browscap_top_useragents',
'callback arguments' => array(
'all',
),
'access' => $access,
'weight' => 5,
);
$items[] = array(
'path' => 'admin/logs/browscap/useragents',
'title' => t('All user agents'),
'access' => $access,
'weight' => 1,
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items[] = array(
'path' => 'admin/logs/browscap/browsers',
'callback' => 'browscap_top_useragents',
'callback arguments' => array(
'browsers',
),
'title' => t('Browsers'),
'access' => $access,
'weight' => 2,
'type' => MENU_LOCAL_TASK,
);
$items[] = array(
'path' => 'admin/logs/browscap/crawlers',
'callback' => 'browscap_top_useragents',
'callback arguments' => array(
'crawlers',
),
'title' => t('Crawlers'),
'access' => $access,
'weight' => 3,
'type' => MENU_LOCAL_TASK,
);
// SETTINGS PAGE
$items[] = array(
'path' => 'admin/settings/browscap',
'title' => t('Browscap'),
'description' => t('Enable browscap site statistics.'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'browscap_settings',
),
'access' => user_access('administer site configuration'),
);
$items[] = array(
'path' => 'admin/settings/browscap/refresh',
'title' => t('Browscap Refresh'),
'callback' => 'browscap_refresh',
'access' => user_access('administer site configuration'),
'type' => MENU_CALLBACK,
);
}
else {
if (arg(0) == 'admin' && arg(1) == 'logs' && arg(2) == 'browscap' && arg(3) == 'useragent' && arg(4)) {
// INFORMATION ABOUT A USERAGENT
$items[] = array(
'path' => 'admin/logs/browscap/useragent',
'callback' => 'browscap_useragent_properties',
'title' => 'Useragent details',
'access' => $access,
'weight' => 5,
'type' => MENU_LOCAL_TASK,
);
}
}
return $items;
}