diff --git a/core/api/mobile.api.php b/core/api/mobile.api.php index 4985e93d..caef33dc 100755 --- a/core/api/mobile.api.php +++ b/core/api/mobile.api.php @@ -245,14 +245,18 @@ function saveMenuFromAppV2($menu, $mobile){ $healthPlugins = []; $deamons_infos = []; $objectsPanel = []; - //$pluginPanelMobile = []; + $pluginPanelMobile = []; //$pluginPanelDesktop= []; foreach ((plugin::listPlugin()) as $plugin) { $obArray = utils::o2a($plugin); $objectId = $obArray['id']; $objectName = $obArray['name']; if($plugin->getMobile() != '' && $plugin->getMobile() != 'panel'){ - $objectsPanel[$objectId] = $objectName; + if($plugin->getMobile() == $objectId){ + $objectsPanel[$objectId] = $objectName; + $pluginPanelMobile[$objectId] = $plugin->getMobile(); + } + /*if($plugin->getMobile() != 'panel'){ array_push($pluginPanelMobile, $objectId); } @@ -275,7 +279,7 @@ function saveMenuFromAppV2($menu, $mobile){ array_push($arrayPlugins, $pluginUpdateArray); } } - //config::save('pluginPanelMobile', $pluginPanelMobile, 'mobile'); + config::save('pluginPanelMobile', $pluginPanelMobile, 'mobile'); //config::save('pluginPanelDesktop', $pluginPanelDesktop, 'mobile'); $return[$idBox]['informations']['objects']['panel'] = $objectsPanel; $categories = []; diff --git a/core/class/mobile.class.php b/core/class/mobile.class.php index 72c646d4..e823e96f 100755 --- a/core/class/mobile.class.php +++ b/core/class/mobile.class.php @@ -1120,14 +1120,11 @@ public static function configMenuCustom($eqId, $jeedomVersion) } else if ($typeObject == 'plan') { ${'tabUrl' . $i} = "/index.php?v={$webviewUrl}&p=plan&plan_id={$objectId}"; } else if ($typeObject == 'panel') { - ${'tabUrl' . $i} = "/index.php?v=m&p={$objectId}&app_mode=1"; - //$pluginPanelMobile = config::byKey('pluginPanelMobile', 'mobile'); + + $pluginPanelMobile = config::byKey('pluginPanelMobile', 'mobile'); + ${'tabUrl' . $i} = "/index.php?v=m&p={$pluginPanelMobile[$objectId]}&app_mode=1"; //$pluginPanelDesktop = config::byKey('pluginPanelDesktop', 'mobile'); - /* if(in_array($objectId, $pluginPanelDesktop)){ - ${'tabUrl' . $i} = "/index.php?v=d&m={$objectId}&p=panel"; - }else if(in_array($objectId, $pluginPanelMobile)){ - ${'tabUrl' . $i} = "/index.php?v=m&p={$objectId}"; - }*/ + //$test = "/index.php?v=m&p={$objectId}"; //log::add('mobile', 'debug', 'PANEL : ' .$test);