Skip to content

Commit

Permalink
Merge pull request #41 from OGSteam/develop
Browse files Browse the repository at this point in the history
Mise à Jour CSS des pop ups
  • Loading branch information
darknoon29 authored Aug 15, 2024
2 parents 88d9202 + cf11475 commit 6195317
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 44 deletions.
50 changes: 28 additions & 22 deletions core/mod_upgrade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

global $db, $lang, $user_data, $server_config, $pub_confirmed, $pub_mod, $pub_tag, $pub_version, $pub_action, $pub_sub;
/**
* Autoupdate Tool Mod upgrade File
* @package [Mod] Autoupdate
Expand Down Expand Up @@ -57,55 +57,61 @@
file_put_contents('./mod/autoupdate/tmp/tarball.zip', $mod_file);

if (file_exists('./mod/autoupdate/tmp/tarball.zip')) {
echo '<table align="center" style="width : 400px">' . "\n";
if ($zip->open('./mod/autoupdate/tmp/tarball.zip') === TRUE) {
echo "<table class='og-table og-full-table'>" . "\n";
echo "<thead>" . "\n";
if ($zip->open('./mod/autoupdate/tmp/tarball.zip')) {
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJ_downok'] . '</td>' . "\n";
echo "\t\t" . '<th>' . $lang['autoupdate_MaJ_downok'] . '</th>' . "\n";
echo "\t" . '</tr>' . "\n";

echo "</thead>" . "\n";
$zip->extractTo("./mod/autoupdate/tmp/" . $modroot . "/"); //On extrait le mod dans le répertoire temporaire d'autoupdate
$zip->close();
unlink("./mod/autoupdate/tmp/tarball.zip");
$nom_répertoire = glob("./mod/autoupdate/tmp/" . $modroot . "/*-" . $modroot . "*", GLOB_ONLYDIR); //On récupère le nom du répertoire
$folder = explode('/', $nom_répertoire[0]);
$nom_repertoire = glob("./mod/autoupdate/tmp/" . $modroot . "/*-" . $modroot . "*", GLOB_ONLYDIR); //On récupère le nom du répertoire
$folder = explode('/', $nom_repertoire[0]);

if (check_ogspy_version_bcopy($modroot . "/" . $folder[5]) == true) {
if (check_ogspy_version_bcopy($modroot . "/" . $folder[5])) {
rcopy("./mod/autoupdate/tmp/" . $modroot . "/" . $folder[5], "./mod/" . $modroot); //Copie du répertoire dans le dossier des mods
rrmdir("./mod/autoupdate/tmp/" . $modroot);
echo "<tbody>" . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJ_unzipok'] . '</td>' . "\n";
echo "\t\t" . '<td>' . $lang['autoupdate_MaJ_unzipok'] . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . upgrade_ogspy_mod($modroot) . '</td>' . "\n";
echo "\t\t" . '<td>' . upgrade_ogspy_mod($modroot) . '</td>' . "\n";
} else {
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c"><span style="color:red">' . $lang['autoupdate_MaJ_errorversionogspy'] . '</span></td>' . "\n";
echo "\t\t" . '<td><span style="color:red">' . $lang['autoupdate_MaJ_errorversionogspy'] . '</span></td>' . "\n";
echo "\t" . '</tr>' . "\n";
}
}
}
} else {
echo '<table>' . "\n";
echo "<table class='og-table og-full-table'>" . "\n";
echo "<thead>" . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJ_wantupdate'] . $modroot . ' ' . $target_version . ' ?</td>' . "\n";
echo "\t\t" . '<th>' . $lang['autoupdate_MaJ_wantupdate'] . $modroot . ' ' . $target_version . ' ?</th>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "</thead>" . "\n";
echo "<tbody>" . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<th><a href="index.php?action=autoupdate&sub=mod_upgrade&confirmed=yes&mod=' . $modroot . '&tag=' . $mod_tag . '">' . $lang['autoupdate_MaJ_linkupdate'] . '</a></th>' . "\n";
echo "\t\t" . '<td><span class="og-button-small">' . ' <a href="index.php?action=autoupdate&sub=mod_upgrade&confirmed=yes&mod=' . $modroot . '&tag=' . $mod_tag . '">' . $lang['autoupdate_MaJ_linkupdate'] . '</a></span></td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "\t" . '<tr>' . "\n";
}

echo "\t" . '</tr>' . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c"><a href=index.php?action=autoupdate>' . $lang['autoupdate_tableau_back'] . '</a></td>' . "\n";
echo "\t\t" . '<td><a href=index.php?action=autoupdate>' . $lang['autoupdate_tableau_back'] . '</a></td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "</tbody>" . "\n";
echo '</table>' . "\n";
echo '<br>' . "\n";
} else {
echo $lang['autoupdate_MaJ_rights'];
}
echo '<br>' . "\n";
echo 'AutoUpdate ' . $lang['autoupdate_version'] . ' ' . versionmod();
echo '<br>' . "\n";
echo $lang['autoupdate_createdby'] . ' Jibus ' . $lang['autoupdate_and'] . ' Bartheleway.</div>';
?>
<div style="text-align: center">
AutoUpdate <?= $lang['autoupdate_version'] . ' ' . versionmod(); ?><br>
<?= $lang['autoupdate_createdby'] . ' Jibus ' . $lang['autoupdate_and'] . ' Bartheleway' ?>
</div>
<?php
require_once("views/page_tail.php");
?>
52 changes: 30 additions & 22 deletions core/tool_upgrade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
global $user_data, $lang;
global $user_data, $lang,$pub_confirmed,$pub_tool,$pub_tag,$pub_sub;

/**
* Autoupdate Tool upgrade File
Expand Down Expand Up @@ -39,12 +39,12 @@

if ($pub_sub == "tool_upgrade" && $pub_confirmed == "yes") {

echo '<table align="center" style="width : 400px">' . "\n";

echo "<table class='og-table og-full-table'>" . "\n";
echo "<thead>" . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJ_rightscheck'] . '</td>' . "\n";
echo "\t\t" . '<th>' . $lang['autoupdate_MaJ_rightscheck'] . '</th>' . "\n";
echo "\t" . '</tr>' . "\n";

echo "</thead>" . "\n";
if (!is_writeable(".")) {
die("Error: OGSpy folder must be writeable (755) " . __FILE__ . "(Ligne: " . __LINE__ . ")");
}
Expand All @@ -54,19 +54,19 @@
} else {
$toolzip = "https://github.com/OGSteam/" . $toolroot . "/releases/download/" . $version['release'] . "/$toolroot-" . $version['release'] . ".zip";
}

echo "<tbody>" . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJ_startdownload'] . '</td>' . "\n";
echo "\t\t" . '<td>' . $lang['autoupdate_MaJ_startdownload'] . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";

$tool_file = github_Request($toolzip);
file_put_contents('./mod/autoupdate/tmp/' . $toolroot . '.zip', $tool_file);

if (file_exists('./mod/autoupdate/tmp/' . $toolroot . '.zip')) {

echo "\t" . '<tr>' . "\n";
if ($zip->open('./mod/autoupdate/tmp/' . $toolroot . '.zip')) {
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJ_downok'] . '</td>' . "\n";
echo "\t\t" . '<td>' . $lang['autoupdate_MaJ_downok'] . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";

$zip->extractTo("./mod/autoupdate/tmp/" . $toolroot . "/"); //On extrait le mod dans le répertoire temporaire d'autoupdate
Expand Down Expand Up @@ -101,43 +101,51 @@
rrmdir("./install");

echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJ_unzipok'] . '</td>' . "\n";
echo "\t\t" . '<td>' . $lang['autoupdate_MaJ_unzipok'] . '</td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c"><a href=index.php?action=autoupdate>' . $lang['autoupdate_tableau_back'] . '</a></td>' . "\n";
echo "\t\t" . '<td><a href=index.php?action=autoupdate>' . $lang['autoupdate_tableau_back'] . '</a></td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "</tbody>" . "\n";
echo '</table>' . "\n";
echo '<br>' . "\n";
// Rechargement de la page
redirection("index.php");
} else {
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c"><span style="color:red">' . $lang['autoupdate_MaJ_unzipnotok'] . '</span></td>' . "\n";
echo "\t\t" . '<td><span style="color:red">' . $lang['autoupdate_MaJ_unzipnotok'] . '</span></td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "\t" . '<tr>' . "\n";

}
}
} else {
echo '<table>' . "\n";
echo "<table class='og-table og-full-table'>" . "\n";
echo "<thead>" . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c"><span style="color:red">' . $lang['autoupdate_MaJtool_wantbackup'] . '</span></td>' . "\n";
echo "\t\t" . '<th><span style="color:red">' . $lang['autoupdate_MaJtool_wantbackup'] . '</span></th>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "</thead>" . "\n";
echo "<tbody>" . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c">' . $lang['autoupdate_MaJtool_wantupdate'] . $toolroot . ' ' . $target_version . ' ?</td>' . "\n";
echo "\t\t" . '<td>' . $lang['autoupdate_MaJtool_wantupdate'] . $toolroot . ' ' . $target_version . ' ?</td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<th><a href="index.php?action=autoupdate&sub=tool_upgrade&confirmed=yes&tool=' . $toolroot . '&tag=' . $tool_tag . '">' . $lang['autoupdate_MaJ_linkupdate'] . '</a></th>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "\t" . '<tr>' . "\n";
echo "\t\t" . '<td class="c"><a href=index.php?action=autoupdate>' . $lang['autoupdate_tableau_back'] . '</a></td>' . "\n";
echo "\t\t" . '<td><a href=index.php?action=autoupdate>' . $lang['autoupdate_tableau_back'] . '</a></td>' . "\n";
echo "\t" . '</tr>' . "\n";
echo "</tbody>" . "\n";
echo '</table>' . "\n";
}
} else {
echo $lang['autoupdate_MaJ_rights'];
}
echo '<br>' . "\n";
echo 'AutoUpdate ' . $lang['autoupdate_version'] . ' ' . versionmod();
echo '<br>' . "\n";
echo $lang['autoupdate_createdby'] . ' Jibus ' . $lang['autoupdate_and'] . ' Bartheleway.</div>';
?>
<div style="text-align: center">
AutoUpdate <?= $lang['autoupdate_version'] . ' ' . versionmod(); ?><br>
<?= $lang['autoupdate_createdby'] . ' Jibus ' . $lang['autoupdate_and'] . ' Bartheleway' ?>
</div>
<?php
require_once("views/page_tail.php");
?>

0 comments on commit 6195317

Please sign in to comment.