diff --git a/core/api/mobile.api.php b/core/api/mobile.api.php index caef33dc..c8f6f9fb 100755 --- a/core/api/mobile.api.php +++ b/core/api/mobile.api.php @@ -246,25 +246,15 @@ function saveMenuFromAppV2($menu, $mobile){ $deamons_infos = []; $objectsPanel = []; $pluginPanelMobile = []; - //$pluginPanelDesktop= []; - foreach ((plugin::listPlugin()) as $plugin) { + $pluginPanelOutMobile= []; + foreach ((plugin::listPlugin(true)) as $plugin) { $obArray = utils::o2a($plugin); $objectId = $obArray['id']; $objectName = $obArray['name']; - if($plugin->getMobile() != '' && $plugin->getMobile() != 'panel'){ - if($plugin->getMobile() == $objectId){ - $objectsPanel[$objectId] = $objectName; - $pluginPanelMobile[$objectId] = $plugin->getMobile(); - } - - /*if($plugin->getMobile() != 'panel'){ - array_push($pluginPanelMobile, $objectId); - } - if( $plugin->getMobile() == 'panel'){ - $objectsPanel[$objectId] = $objectName; - array_push($pluginPanelDesktop, $objectId); - } */ - } + if($plugin->getMobile() != ''){ + $objectsPanel[$objectId] = $objectName; + $pluginPanelMobile[$objectId] = $plugin->getMobile(); + } $update = $plugin->getUpdate(); if(is_object($update)){ $pluginUpdateArray = utils::o2a($update); @@ -280,7 +270,7 @@ function saveMenuFromAppV2($menu, $mobile){ } } config::save('pluginPanelMobile', $pluginPanelMobile, 'mobile'); - //config::save('pluginPanelDesktop', $pluginPanelDesktop, 'mobile'); + config::save('pluginPanelOutMobile', $pluginPanelOutMobile, 'mobile'); $return[$idBox]['informations']['objects']['panel'] = $objectsPanel; $categories = []; foreach (jeedom::getConfiguration('eqLogic:category') as $key => $value) { diff --git a/core/class/mobile.class.php b/core/class/mobile.class.php index e823e96f..8774620f 100755 --- a/core/class/mobile.class.php +++ b/core/class/mobile.class.php @@ -1119,15 +1119,13 @@ public static function configMenuCustom($eqId, $jeedomVersion) ${'tabUrl' . $i} = "/index.php?v={$webviewUrl}&p=dashboard&object_id={$objectId}"; } else if ($typeObject == 'plan') { ${'tabUrl' . $i} = "/index.php?v={$webviewUrl}&p=plan&plan_id={$objectId}"; - } else if ($typeObject == 'panel') { - + } else if ($typeObject == 'panel') { $pluginPanelMobile = config::byKey('pluginPanelMobile', 'mobile'); - ${'tabUrl' . $i} = "/index.php?v=m&p={$pluginPanelMobile[$objectId]}&app_mode=1"; - //$pluginPanelDesktop = config::byKey('pluginPanelDesktop', 'mobile'); - - - //$test = "/index.php?v=m&p={$objectId}"; - //log::add('mobile', 'debug', 'PANEL : ' .$test); + if($pluginPanelOutMobile[$objectId] == $objectId){ + ${'tabUrl' . $i} = "/index.php?v=m&p={$objectId}"; + }else{ + ${'tabUrl' . $i} = "/index.php?v=m&p={$objectId}&app_mode=1"; + } } } else if ($objectId == 'overview') { ${'typeObject' . $i} = $objectId;