Skip to content

Commit

Permalink
use the getMenuDefaultTab function
Browse files Browse the repository at this point in the history
  • Loading branch information
Phpvarious authored Oct 9, 2024
1 parent dfb013e commit a5bc10a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions core/api/mobile.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,7 @@ function saveMenuFromAppV2($menu, $mobile)
$return[$idBox]['configs']['hideMenuCustom'] = intval($mobile->getConfiguration('hideMenuCustom', 0));
$return[$idBox]['configs']['hideMenuGeoloc'] = intval($mobile->getConfiguration('hideMenuGeoloc', 0));
} else {
$defaultMenuJson = '{"tab0":{"active":true,"icon":{"name":"in","type":"jeedomapp"},"name":"Accueil","options":{"uri":"\/index.php?v=m&p=home"},"type":"WebviewApp"},
"tab1":{"active":true,"icon":{"name":"hubspot","type":"fa"},"name":"Synthese","options":{"uri":"\/index.php?v=m&p=overview"},"type":"WebviewApp"},
"tab2":{"active":true,"icon":{"name":"medkit","type":"fa"},"name":"Sant\u00e9","options":{"uri":"\/index.php?v=m&p=health"},"type":"WebviewApp"},
"tab3":{"active":false,"icon":{"name":"in","type":"jeedomapp"},"name":"Accueil","options":{"uri":"\/index.php?v=m&app_mode=1"},"type":"WebviewApp"}}';
$defaultMenuArray = json_decode($defaultMenuJson, true);
$return[$idBox]['configs']['menu'] = $defaultMenuArray;
$return[$idBox]['configs']['menu'] = mobile::getMenuDefaultTab();
$return[$idBox]['configs']['hideMenuCustom'] = 0;
$return[$idBox]['configs']['hideMenuGeoloc'] = 0;
}
Expand All @@ -345,12 +340,7 @@ function saveMenuFromAppV2($menu, $mobile)
log::add('mobile', 'debug', '| OK Mobile trouvé > ' . $mobile->getName());
$menu = $mobile->configMenuCustom();
} else {
$defaultMenuJson = '{"tab0":{"active":true,"icon":{"name":"in","type":"jeedomapp"},"name":"Accueil","options":{"uri":"\/index.php?v=m&p=home"},"type":"WebviewApp"},
"tab1":{"active":true,"icon":{"name":"hubspot","type":"fa"},"name":"Synthese","options":{"uri":"\/index.php?v=m&p=overview"},"type":"WebviewApp"},
"tab2":{"active":true,"icon":{"name":"medkit","type":"fa"},"name":"Sant\u00e9","options":{"uri":"\/index.php?v=m&p=health"},"type":"WebviewApp"},
"tab3":{"active":false,"icon":{"name":"in","type":"jeedomapp"},"name":"Accueil","options":{"uri":"\/index.php?v=m&app_mode=1"},"type":"WebviewApp"}}';
$defaultMenuArray = json_decode($defaultMenuJson, true);
$menu = $defaultMenuArray;
$menu = mobile::getMenuDefaultTab();
}
log::add('mobile', 'debug', '| [INFO] Retour vers App > ' . json_encode($menu));
log::add('mobile', 'debug', '└───────────────────────────────────────────');
Expand Down

0 comments on commit a5bc10a

Please sign in to comment.