Skip to content

Commit

Permalink
Merge pull request #75 from Phpvarious/patch-2
Browse files Browse the repository at this point in the history
Update mobile.api.php
  • Loading branch information
rocket13011 authored Sep 28, 2023
2 parents c5491e7 + 9302166 commit 427afd2
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions core/api/mobile.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,27 +248,28 @@ function saveMenuFromAppV2($menu, $mobile){
$pluginPanelMobile = [];
$pluginPanelOutMobile= [];
foreach ((plugin::listPlugin(true)) as $plugin) {
$obArray = utils::o2a($plugin);
$objectId = $obArray['id'];
$objectName = $obArray['name'];
if($plugin->getMobile() != ''){
$objectsPanel[$objectId] = $objectName;
$pluginPanelMobile[$objectId] = $plugin->getMobile();
}
$update = $plugin->getUpdate();
if(is_object($update)){
$pluginUpdateArray = utils::o2a($update);
$arrayDataPlugins = utils::o2a($plugin);
if($plugin->getHasOwnDeamon() == 1){
$deamons_infos[$plugin->getId()] = $plugin->deamon_info();
}else{
$deamons_infos[$plugin->getId()] = array('launchable_message' => 'nodemon', 'launchable' => 'nodemon', 'state' => 'nodemon', 'log' => 'nodemon', 'auto' => 0);
}
$changeLogs[$arrayDataPlugins['id']]['changelog'] = $arrayDataPlugins['changelog'];
$changeLogs[$arrayDataPlugins['id']]['changelog_beta'] = $arrayDataPlugins['changelog_beta'];
array_push($arrayPlugins, $pluginUpdateArray);
}
}
$obArray = utils::o2a($plugin);
$obArray['displayMobilePanel'] = config::byKey('displayMobilePanel', $plugin->getId(), 0);
$objectId = $obArray['id'];
$objectName = $obArray['name'];
if($plugin->getMobile() != '' && $obArray['displayMobilePanel'] != 0){
$objectsPanel[$objectId] = $objectName;
$pluginPanelMobile[$objectId] = $plugin->getMobile();
}
$update = $plugin->getUpdate();
if(is_object($update)){
$pluginUpdateArray = utils::o2a($update);
$arrayDataPlugins = utils::o2a($plugin);
if($plugin->getHasOwnDeamon() == 1){
$deamons_infos[$plugin->getId()] = $plugin->deamon_info();
}else{
$deamons_infos[$plugin->getId()] = array('launchable_message' => 'nodemon', 'launchable' => 'nodemon', 'state' => 'nodemon', 'log' => 'nodemon', 'auto' => 0);
}
$changeLogs[$arrayDataPlugins['id']]['changelog'] = $arrayDataPlugins['changelog'];
$changeLogs[$arrayDataPlugins['id']]['changelog_beta'] = $arrayDataPlugins['changelog_beta'];
array_push($arrayPlugins, $pluginUpdateArray);
}
}
config::save('pluginPanelMobile', $pluginPanelMobile, 'mobile');
config::save('pluginPanelOutMobile', $pluginPanelOutMobile, 'mobile');
$return[$idBox]['informations']['objects']['panel'] = $objectsPanel;
Expand Down

0 comments on commit 427afd2

Please sign in to comment.