Skip to content

Commit

Permalink
update link dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekiro-kost committed Sep 26, 2023
1 parent 41027e8 commit abf9e1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
13 changes: 4 additions & 9 deletions core/api/mobile.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function checkDateMenu($menu, $mobile){


function saveMenuFromAppV2($menu, $mobile){
log::add('mobile','debug','MENU_SAVE_FROM_APPV2 ' .json_encode($menu));
log::add('mobile','debug','MENU_SAVE_FRM_APPV2 ' .json_encode($menu));
if(is_object($mobile)){
$count = 0;
$i=1;
Expand Down Expand Up @@ -291,13 +291,8 @@ function saveMenuFromAppV2($menu, $mobile){
if(is_object($mobile)){
log::add('mobile', 'debug', 'mobile bien trouvé > '.$mobile->getName());
$return[$idBox]['configs'] = array();
if(jeedom::version() < '4.4.0'){
// $return[$idBox]['configs']['menu'] = handleVersionJeedomMenu();
$return[$idBox]['configs']['menu'] = mobile::configMenuCustom($mobile->getId(), jeedom::version());
}else{
$return[$idBox]['configs']['menu'] = mobile::configMenuCustom($mobile->getId(), jeedom::version());
}
}else{
$return[$idBox]['configs']['menu'] = mobile::configMenuCustom($mobile->getId(), jeedom::version());
}else{
if(jeedom::version() < '4.4.0'){
$return[$idBox]['configs']['menu'] = mobile::configMenuCustom($mobile->getId(), jeedom::version());
}else{
Expand All @@ -308,7 +303,7 @@ function saveMenuFromAppV2($menu, $mobile){
$defaultMenuArray = json_decode($defaultMenuJson, true);
$return[$idBox]['configs']['menu'] = $defaultMenuArray;
}
}
}
log::add('mobile', 'debug', 'CustomENVOICONFIGSAPI GETJSON' .json_encode($return[$idBox]['configs']));
log::add('mobile','debug','INFOS GETJSONINITAL : '.json_encode($return));
$jsonrpc->makeSuccess($return);
Expand Down
13 changes: 7 additions & 6 deletions core/class/mobile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1043,14 +1043,15 @@ public static function configMenuCustom($eqId, $jeedomVersion)
$j = 0;
$count = 1;
for ($i = 1; $i < 5; $i++) {
$webviewUrl = '';
//$webviewUrl = '';
$isActive = true;
$webview = $eqLogic->getConfiguration('checkboxWebViewMenu' . $i, 'WebviewMobile');
/*$webview = $eqLogic->getConfiguration('checkboxWebViewMenu' . $i, 'WebviewDesktop');
if ($webview == 'WebviewDesktop') {
$webviewUrl = 'd';
} else if ($webview == 'WebviewMobile') {
$webviewUrl = 'm';
}
}*/
$webviewUrl = 'd';
${'tabIconName' . $i} = $eqLogic->getConfiguration('spanIcon' . $i, 'none');
log::add('mobile', 'debug', '| CHANGETABICON ' . ${'tabIconName' . $i});
config::save('icon' . $i . 'NoCut', ${'tabIconName' . $i}, 'mobile');
Expand Down Expand Up @@ -1082,14 +1083,14 @@ public static function configMenuCustom($eqId, $jeedomVersion)
${'typeObject' . $i} = $typeObject;
${'typewebviewurl' . $i} = $webviewUrl;
${'typeobjectId' . $i} = $idUrl;
if ($typeObject == 'view') {
${'tabUrl' . $i} = "/index.php?v={$webviewUrl}&p={$typeObject}&view_id={$objectId}";
if ($typeObject == 'views') {
${'tabUrl' . $i} = "/index.php?v={$webviewUrl}&p=view&view_id={$objectId}";
} else if ($typeObject == 'dashboard') {
${'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') {
${'tabUrl' . $i} = "/index.php?v={$webviewUrl}&p={$objectId}";
${'tabUrl' . $i} = "/index.php?v=m&p={$objectId}";
log::add('mobile', 'debug', 'PANEL : ' . ${'$tabUrl' . $i});
}
} else if ($objectId == 'overview') {
Expand Down

0 comments on commit abf9e1a

Please sign in to comment.