-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.php
138 lines (131 loc) · 5.32 KB
/
update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
require_once("core/php/functions/commonFunctions.php");
$baseUrl = "core/";
if(file_exists('local/layout.php'))
{
$baseUrl = "local/";
//there is custom information, use this
require_once('local/layout.php');
$baseUrl .= $currentSelectedTheme."/";
}
require_once($baseUrl.'conf/config.php');
require_once('core/conf/config.php');
require_once('core/php/configStatic.php');
$version = explode('.', $configStatic['version']);
$newestVersion = explode('.', $configStatic['newestVersion']);
$levelOfUpdate = 0; // 0 is no updated, 1 is minor update and 2 is major update
$beta = false;
$newestVersionCount = count($newestVersion);
$versionCount = count($version);
$levelOfUpdate = $levelOfUpdate = findUpdateValue($newestVersionCount, $versionCount, $newestVersion, $version);
require_once('core/php/loadVars.php'); ?>
<!doctype html>
<head>
<title>Git Status | Update</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl ?>template/theme.css?v=<?php echo $configStatic['version']; ?>">
<link rel="icon" type="image/png" href="core/img/favicon.png" />
<script src="core/js/jquery.js"></script>
<script src="core/js/visibility.core.js"></script>
<script src="core/js/visibility.fallback.js"></script>
<script src="core/js/visibility.js"></script>
<script src="core/js/visibility.timers.js"></script>
</head>
<body>
<?php require_once('core/php/templateFiles/sidebar.php'); ?>
<?php require_once('core/php/templateFiles/header.php'); ?>
<div id="main" style="overflow: auto; overflow-y: auto; right: 0;" >
<div class="firstBoxDev">
<div class="innerFirstDevBox" >
<div class="devBoxTitle">
<b>Update</b>
</div>
<div class="devBoxContent">
Current Version <?php echo $configStatic['version']; ?>
<br><br>
Last Check for updates - <?php echo $configStatic['lastCheck'];?>
<br><br>
<button class="buttonButton" onclick="checkForUpdateDefinitely(true);" >Check for Update</button>
<form id="settingsCheckForUpdate" action="update/updater.php" method="post">
<?php
if($levelOfUpdate != 0)
{
echo '<br><br><button class="buttonButton" onclick="displayLoadingPopup();">Install '.$configStatic["newestVersion"].' Update</button>';
}
?>
</form>
<span id="noUpdate" <?php if($levelOfUpdate != 0){echo "style='display: none;'";} ?> >
<h2><img id="statusImage1" src="core/img/greenCheck.png" height="15px"> No new updates - You are on the current version!</h2>
</span>
<span id="minorUpdate" <?php if($levelOfUpdate != 1){echo "style='display: none;'";} ?> >
<h2><img id="statusImage2" src="core/img/yellowWarning.png" height="15px"> Minor Updates - <?php echo $configStatic['newestVersion'];?> - bug fixes </h2>
</span>
<span id="majorUpdate" <?php if($levelOfUpdate != 2){echo "style='display: none;'";} ?> >
<h2><img id="statusImage3" src="core/img/redWarning.png" height="15px"> Major Updates - <?php echo $configStatic['newestVersion'];?> - new features!</h2>
</span>
<span id="NewXReleaseUpdate" <?php if($levelOfUpdate != 3){echo "style='display: none;'";} ?> >
<h2><img id="statusImage3" src="core/img/redWarning.png" height="15px"><img id="statusImage3" src="core/img/redWarning.png" height="15px"><img id="statusImage3" src="core/img/redWarning.png" height="15px"> Very Major Updates - <?php echo $configStatic['newestVersion'];?> - a lot of new features!</h2>
</span>
</div>
</div>
</div>
<div class="firstBoxDev" <?php if($levelOfUpdate == 0): ?> style="display: none;" <?php endif; ?>>
<div class="innerFirstDevBox" style="width: 600px;" >
<div class="devBoxTitle">
Update - Release Notes
</div>
<div class="devBoxContent">
<ul id="settingsUl">
<?php
if(array_key_exists('versionList', $configStatic) && ($levelOfUpdate != 0))
{
foreach ($configStatic['versionList'] as $key => $value)
{
$version = explode('.', $configStatic['version']);
$newestVersion = explode('.', $key);
$newestVersionCount = count($newestVersion);
$versionCount = count($version);
$levelOfUpdate = findUpdateValue($newestVersionCount, $versionCount, $newestVersion, $version);
if($levelOfUpdate != 0)
{
echo "<li class='settingsUl' ><h2>Changelog For ".$key." update</h2></li>";
echo $value['releaseNotes'];
}
}
}
?>
</ul>
</div>
</div>
</div>
</div>
<script type="text/javascript">
<?php echo "var dontNotifyVersion = '".$dontNotifyVersion."';"; ?>
function calcuateWidth()
{
var left = "0px";
if(document.getElementById("sidebar").style.width == '100px')
{
left = "103px";
}
document.getElementById("main").style.left = left;
}
function showUpdateCheckPopup(data)
{
if(data)
{
location.reload();
}
}
</script>
<script src="core/js/allPages.js?v=<?php echo $configStatic['version']; ?>"></script>
<script src="core/js/updateCommon.js?v=<?php echo $configStatic['version']; ?>"></script>
<script type="text/javascript">
var successVerifyNum = <?php echo $successVerifyNum; ?>;
var updating = false;
<?php
echo "var currentVersion = '".$configStatic['version']."';";
?>
</script>
<?php readfile('core/html/popup.html') ?>
</body>