forked from GDRCD/GDRCD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.php
More file actions
67 lines (62 loc) · 2.55 KB
/
installer.php
File metadata and controls
67 lines (62 loc) · 2.55 KB
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
<?php
$dont_check = true;
require 'header.inc.php'; /*Header comune*/
?>
<div class="pagina_ambientazione">
<?php
if(!empty($_POST['do_update'])) {
$target_migration = empty($_POST['target']) ? null : (int)$_POST['target'];
try {
DbMigrationEngine::updateDbSchema($target_migration);
echo '<div class="warning">' . gdrcd_filter('out', $MESSAGE['homepage']['installer']['done']) . '</div>';
}
catch (Exception $e){
echo '<div class="warning">' . gdrcd_filter('out', $e->getMessage()) . '</div>';
}
}
if (DbMigrationEngine::dbNeedsUpdate()) {
?>
<form method="post" action="installer.php">
<h2><?= $MESSAGE['homepage']['installer']['install_title'] ?></h2>
<p><?= $MESSAGE['homepage']['installer']['install_text'] ?></p>
<input type="submit" name="do_update" value="Installa" /> <a href="/">Annulla</a>
</form>
<?php
}
/* else{
?>
<div class="error"><?= $MESSAGE['homepage']['installer']['not_empty'] ?></div>
<form method="post" action="installer.php">
<fieldset>
<legend>Opzioni Avanzate</legend>
<div class='form_label'>
<?php echo gdrcd_filter('out', $MESSAGE['homepage']['installer']['migrate']); ?>
</div>
<div class="form_info">
<?php echo gdrcd_filter('out', $MESSAGE['homepage']['installer']['migrate_warn']); ?>
</div>
<div class='form_field'>
<select name="target" id="target">
<?php
$migrations = DbMigrationEngine::getAllAvailableMigrations();
foreach($migrations as $k => $m) {
echo '<option value="'.$m->getMigrationId().'" '
.($k == (count($migrations) -1) ? 'selected="selected"' : '')
.'>'.gdrcd_filter('out', get_class($m)).'</option>';
}
?>
</select>
</div>
<input type="submit" name="do_update" value="Esegui" />
</fieldset>
</form>
<?php
} */ ?>
<!-- Link di ritorno alla homepage -->
<div class="link_back">
<a href="index.php">
<?php echo gdrcd_filter('out', $PARAMETERS['info']['homepage_name']); ?>
</a>
</div>
</div>
<?php require('footer.inc.php'); /*Footer comune*/ ?>