Skip to content

Commit

Permalink
починил гибернацию
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbytes committed Mar 15, 2019
1 parent 4ceb597 commit ade93fc
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 22 deletions.
30 changes: 17 additions & 13 deletions makeprocess.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,23 @@ function makeprocess($destination, $idprocess, $param, $key, $name, $data = nul
?>
<div id="logic<?echo $idprocess;?>">
<script async>
ProcessLogic(
"<?echo $idprocess?>",
"<?echo $name?>",
"<?echo $destination?>",
"<?echo $destination_?>",
"<?echo $maxwidthm?>",
"<?echo $folder?>",
"<?echo $mobile?>",
"<?echo $key?>",
"<?echo $param?>",
"<?echo $autohide?>",
'<?echo $data?>'
);
$( function() {
$(document).ready(function(){
ProcessLogic(
"<?echo $idprocess?>",
"<?echo $name?>",
"<?echo $destination?>",
"<?echo $destination_?>",
"<?echo $maxwidthm?>",
"<?echo $folder?>",
"<?echo $mobile?>",
"<?echo $key?>",
"<?echo $param?>",
"<?echo $autohide?>",
'<?echo $data?>'
);
});
});
</script>
</div>
<?
Expand Down
8 changes: 6 additions & 2 deletions os.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@
<div id="desktop-1" class="desktop" desktopid="1">
<?
$prepare->desktop("linkdiv");
$_SESSION['appid'] = -1;
if(!$_SESSION['h_status']){
$_SESSION['appid'] = -1;
}else{
$_SESSION['h_status'] = false;
}
?>
</div>
</div>
Expand All @@ -78,7 +82,7 @@
<div id="selector-1" desktop="1" class="selector ui-forest-blink"></div>
</div>
<script>
var id = <?echo $_SESSION['appid'] = $_SESSION['appid'] + 1?>;
var id = <? echo $_SESSION['appid'] = $_SESSION['appid'] + 1 ?>;
<?
require 'system/core/library/js/core-js.php';
?>
Expand Down
3 changes: 2 additions & 1 deletion system/core/library/Mercury/AppContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public function EndContainer(){

if($this->appName && $this->appID){
echo '<script>';
echo 'UpdateWindow("'.$this->appID.'","'.$this->appName.'");';

echo '$( function() { $(document).ready(function(){ UpdateWindow("'.$this->appID.'","'.$this->appName.'"); }); });';

//update app length
echo '$("#app'.$this->appID.'").attr("applength-'.$this->appID.'", parseInt($("#app'.$this->appID.'").attr("applength-'.$this->appID.'")) + $("#'.$this->appName.$this->appID.'").html().length);';
Expand Down
6 changes: 5 additions & 1 deletion system/core/library/gui.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ function newnotification($name, $title, $text, $time = 0, $customDate = 0){
<? if($time!='infinite'){ ?>
setTimeout(function() {$("#notification_<? echo $name ?>").css('opacity','0'); $("#notification_<? echo $name ?>").css('display','none');},<? echo $time ?>);
<? } ?>
SaveNotification();
$( function() {
$(document).ready(function(){
SaveNotification();
});
});
$("#script_<? echo $name ?>").remove();
</script>
</div>
Expand Down
4 changes: 2 additions & 2 deletions system/core/library/js/core-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ function hibernation(logout){
type: "POST",
url: "system/core/library/etc/hibernation",
data: {
content:savestate,
appid:id
content: savestate,
appid: id
}
}).done(function(o) {
if(logout == 'true'){
Expand Down
8 changes: 5 additions & 3 deletions system/core/library/prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,18 +355,20 @@ function hibernation(){
}

if(!empty($content) && $_SESSION["safemode"] != "true"){
$_SESSION['h_status'] = true;
$_SESSION['appid'] = $content['last_app_id'];
$key = $bd->readglobal2("password", "forestusers", "login", $login, true);
echo $security->__decode($content['state'], $key);
file_put_contents('system/users/'.$login.'/settings/state.hdf','');
$object->newnotification("Hibernation",$language[$_SESSION['locale'].'_hibernation_name'],$language[$_SESSION['locale'].'_hibernation_notification']." <b>".$content['time_stamp']."</b>");
file_put_contents('system/users/'.$login.'/settings/state.hdf', '');
$object->newnotification("Hibernation", $language[$_SESSION['locale'].'_hibernation_name'], $language[$_SESSION['locale'].'_hibernation_notification']." <b>".$content['time_stamp']."</b>");
?>
<script>
var id = <? echo $content['last_app_id'] ?>;
</script>
<?
}else{
file_put_contents('system/users/'.$login.'/settings/state.hdf','');
file_put_contents('system/users/'.$login.'/settings/state.hdf', '');
$_SESSION['h_status'] = false;
}
}
unset($content, $security, $key, $getdata);
Expand Down

0 comments on commit ade93fc

Please sign in to comment.