Commit 70346dad authored by Liuba Kazakov's avatar Liuba Kazakov Committed by Hugh Davenport
Browse files

Device detection - do not display dropdown menu and admin menu



on handheld/mobile devices

Bug #1041645

Change-Id: I1d6e0e5d1aecdee42694b552ccc707a5e2197422
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent fb4ef3d9
......@@ -395,11 +395,14 @@ EOF;
$smarty->assign('THEMELIST', json_encode(array_merge((array)json_decode($smarty->get_template_vars('THEMELIST')), $theme_list)));
}
$dropdownmenu = get_config('dropdownmenu');
// disable drop-downs if a handheld device detected
$dropdownmenu = $SESSION->get('handheld_device') ? false : get_config('dropdownmenu');
if ($dropdownmenu) {
$smarty->assign('DROPDOWNMENU', $dropdownmenu);
}
$smarty->assign('MOBILE', $SESSION->get('mobile'));
$sitename = get_config('sitename');
if (!$sitename) {
$sitename = 'Mahara';
......@@ -2319,8 +2322,8 @@ function mahara_standard_nav() {
*/
function main_nav() {
if (in_admin_section()) {
global $USER;
if ($USER->get('admin')) {
global $USER, $SESSION;
if ($USER->get('admin') && !$SESSION->get('mobile')) {
$menu = admin_nav();
}
else if ($USER->is_institutional_admin()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment