Skip to content

Commit

Permalink
changes with PR alpha data.panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekiro-kost committed Sep 28, 2023
1 parent 8e2e0e3 commit 3edb161
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
24 changes: 7 additions & 17 deletions core/api/mobile.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
14 changes: 6 additions & 8 deletions core/class/mobile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3edb161

Please sign in to comment.