Skip to content

Commit

Permalink
Merge pull request #37 from OGSteam/feature/ui
Browse files Browse the repository at this point in the history
Update CSS
  • Loading branch information
darknoon29 authored Jul 22, 2024
2 parents c123438 + 630d6ae commit a566082
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 146 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.json
tmp/*
tmp/*
/vendor/
!/tmp/stats.answer
78 changes: 34 additions & 44 deletions autoupdate.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
global $lang,$ui_lang,$user_data,$server_config;

/**
* Autoupdate Controller
Expand All @@ -16,13 +17,13 @@

require_once("views/page_header.php");
if (!function_exists('random_bytes')) {
die("OGSpy cannot work anymore without Php Security Layers, please use PHP(>= 7.0)");
die("OGSpy cannot work anymore without Php Security Layers, please use PHP(>= 8.0)");
}
if (!function_exists('json_decode')) {
die("Autoupdate cannot work without the JSON Library, please use PHP(>= 5.2)");
die("Autoupdate cannot work without the PHP Module JSON Library");
}
if (!extension_loaded('zip')) {
die("Autoupdate cannot work without the ZIP Library, Please check your server configuration");
die("Autoupdate cannot work without the PHP Module ZIP");
}
if (!ini_get('allow_url_fopen')) {
die("Autoupdate cannot work without external connections (fopen), Please check your server configuration");
Expand All @@ -48,49 +49,38 @@
$sub = $pub_sub;
}

if ($user_data["user_admin"] == 1 || $user_data["user_coadmin"] == 1) {
if ($sub != "overview") {
$bouton1 = "\t\t" . "<td class='c' align='center' width='150' style='cursor:pointer' onclick=\"window.location = 'index.php?action=autoupdate&sub=overview';\">";
?>

$bouton1 .= "<span style=\"color: lime; \">" . $lang['autoupdate_autoupdate_table'] . "</span>";
$bouton1 .= "</td>\n";
} else {
$bouton1 = "\t\t" . "<th width='150'>";
$bouton1 .= "<span style=\"color: #5CCCE8; \">" . $lang['autoupdate_autoupdate_table'] . "</span>";
$bouton1 .= "</th>\n";
}
if ($sub != "down") {
$bouton2 = "\t\t" . "<td class='c' align='center' width='150' style='cursor:pointer' onclick=\"window.location = 'index.php?action=autoupdate&sub=down';\">";
$bouton2 .= "<span style=\"color: lime; \">" . $lang['autoupdate_autoupdate_down'] . "</span>";
$bouton2 .= "</td>\n";
} else {
$bouton2 = "\t\t" . "<th width='150'>";
$bouton2 .= "<span style=\"color: #5CCCE8; \">" . $lang['autoupdate_autoupdate_down'] . "</span>";
$bouton2 .= "</th>\n";
}
} else {
$bouton1 = "";
$bouton2 = "";
}
if ($user_data["user_admin"] == 1) {
if ($sub != "admin") {
$bouton3 = "\t\t" . "<td class='c' align='center' width='150' style='cursor:pointer' onclick=\"window.location = 'index.php?action=autoupdate&sub=admin';\">";
$bouton3 .= "<span style=\"color: lime; \">" . $lang['autoupdate_autoupdate_admin'] . "</span>";
$bouton3 .= "</td>\n";
} else {
$bouton3 = "\t\t" . "<th width='150'>";
$bouton3 .= "<span style=\"color: #5CCCE8; \">" . $lang['autoupdate_autoupdate_admin'] . "</span>";
$bouton3 .= "</th>\n";
}
} else {
$bouton3 = "";
}
echo "\n<table>\n";
echo "\t<tr>\n";
echo $bouton1 . $bouton2 . $bouton3;
echo "\t</tr><br>\n";
echo "</table>\n<br>\n";
<div class="og-msg ">
<h3 class="og-title">Autoupdate</h3>
<p class="og-content">Autoupdate permet d'installer ou de mettre à jour vos modules OGSpy</p>
<p class="og-content">Il permet aussi d'obtenir les préversions des modules ainsi que de soumettre des tickets à l'équipe de développement.</p>
</div>

<div class="nav-page-menu">

<div class="nav-page-menu-item">
<a class="nav-page-menu-link" href='index.php?action=autoupdate&sub=overview'>
<?= $lang['autoupdate_autoupdate_table'] ?>
</a>
</div>
<div class="nav-page-menu-item">
<a class="nav-page-menu-link" href='index.php?action=autoupdate&sub=down'>
<?= $lang['autoupdate_autoupdate_down'] ?>
</a>
</div>
<?php if ($user_data["user_admin"] == 1) { ?>
<div class="nav-page-menu-item">
<a class="nav-page-menu-link" href='index.php?action=autoupdate&sub=admin'>
<?= $lang['autoupdate_autoupdate_admin'] ?>
</a>
</div>
<?php } ?>
</div>


<br>
<?php
if (!isset($pub_sub)) {
$sub = 'overview';
} else {
Expand Down
Empty file removed tmp/stats.answer
Empty file.
68 changes: 43 additions & 25 deletions view/admin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

global $lang, $pub_cycle, $pub_majbeta, $pub_githubtoken;
/**
* Autoupdate Admin view File
* @package [Mod] Autoupdate
Expand All @@ -26,42 +26,60 @@
}

?>
<table>
<form action="index.php?action=autoupdate&sub=admin" method="post">

<table class='og-table og-full-table'>
<thead>
<tr>
<td class="c"><?php echo $lang['autoupdate_admin_option']; ?></td>
<td class="c" align="center"><?php echo $lang['autoupdate_admin_value']; ?>
<br /><?php echo $lang['autoupdate_admin_value1']; ?>
</td>
<th><?php echo $lang['autoupdate_admin_option']; ?></th>
<th><?php echo $lang['autoupdate_admin_value']; ?>
<br><?php echo $lang['autoupdate_admin_value1']; ?>
</th>
</tr>
<form action="index.php?action=autoupdate&sub=admin" method="post">
</thead>
<tbody>

<tr>
<th><?php echo $lang['autoupdate_admin_beta']; ?><br /><?php echo $lang['autoupdate_admin_beta1']; ?></th>
<th><input type="radio" name="majbeta" <?php echo (mod_get_option("MAJ_BETA") == 1) ? 'checked' : ''; ?> value="1" /> <span style="font-size: large; ">|</span> <input type="radio" name="majbeta" <?php echo (mod_get_option("MAJ_BETA") == 0) ? 'checked' : ''; ?> value="0" /></th>
<td><?php echo $lang['autoupdate_admin_beta']; ?><br /><?php echo $lang['autoupdate_admin_beta1']; ?></td>
<td>
<label>
<input type="radio" name="majbeta" <?php echo (mod_get_option("MAJ_BETA") == 1) ? 'checked' : ''; ?> value="1" />
</label>
<span>|</span>
<label>
<input type="radio" name="majbeta" <?php echo (mod_get_option("MAJ_BETA") == 0) ? 'checked' : ''; ?> value="0" />
</label>
</td>
</tr>
<tr>
<th><?php echo $lang['autoupdate_admin_frequency']; ?></th>
<th><input name="cycle" type="text" size="3" maxlength="2" value="<?php echo mod_get_option("CYCLEMAJ"); ?>">
</th>
<td><?php echo $lang['autoupdate_admin_frequency']; ?></td>
<td>
<label>
<input name="cycle" type="text" size="3" maxlength="2" value="<?php echo mod_get_option("CYCLEMAJ"); ?>">
</label>
</td>
</tr>
<tr>
<th><?php echo $lang['autoupdate_admin_githubtoken']; ?></th>
<th><input name="githubtoken" type="text" size="40" maxlength="40" value="<?php echo mod_get_option("GITHUBTOKEN"); ?>">
</th>
<td><?php echo $lang['autoupdate_admin_githubtoken']; ?></td>
<td>
<label>
<input name="githubtoken" type="text" size="40" maxlength="40" value="<?php echo mod_get_option("GITHUBTOKEN"); ?>">
</label>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="valid" value="<?php echo $lang['autoupdate_admin_valid']; ?>" /></td>
<td colspan="2"><input class="og-button og-button-little" type="submit" name="valid" value="<?php echo $lang['autoupdate_admin_valid']; ?>" /></td>
</tr>
</form>

</tbody>
</table>
<?php
</form>

echo "<br>\n";
echo 'AutoUpdate ' . $lang['autoupdate_version'] . ' ' . versionmod();
echo '<br>' . "\n";
echo $lang['autoupdate_createdby'] . ' Jibus ' . $lang['autoupdate_and'] . ' Bartheleway.</div><br>';
?>
<a href="https://github.com/ogsteam/mod-autoupdate" target="_blank"><img src="./mod/autoupdate/img/GitHub-Mark-Light-32px.png" /></a>
<div style="text-align: center">
AutoUpdate <?= $lang['autoupdate_version'] . ' ' . versionmod(); ?><br>
<?= $lang['autoupdate_createdby'] . ' Jibus ' . $lang['autoupdate_and'] . ' Bartheleway' ?><br>
<a href="https://github.com/ogsteam/mod-autoupdate" target="_blank" rel="noopener"><img src="./mod/autoupdate/img/GitHub-Mark-Light-32px.png" alt="Github"/></a>
</div>


<?php
Expand Down
55 changes: 34 additions & 21 deletions view/down.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
global $db, $lang, $user_data, $server_config, $installed_mods, $download_mod_list;

/**
* Autoupdate Downloader
Expand Down Expand Up @@ -31,25 +32,28 @@
$download_mod_list = getRepositorylist();

?>
<table width='60%'>
<table class='og-table og-full-table'>
<thead>
<?php
if (!is_writeable("./mod/")) {
echo "<tr><td class='c' colspan='100'><span style=\"color: red; \">" . $lang['autoupdate_tableau_error3'] . "</span></td></tr>";
echo "<tr><td class='og-error' colspan='100'><span style=\"color: red; \">" . $lang['autoupdate_tableau_error3'] . "</span></td></tr>";
}

?>
<tr>
<td class='c' colspan='4'><?php echo $lang['autoupdate_tableau_modnoinstall']; ?></td>
<th colspan='100'><?php echo $lang['autoupdate_tableau_modnoinstall']; ?></th>
</tr>

<tr>
<td class='c'><?php echo $lang['autoupdate_tableau_namemod']; ?></td>
<td class='c'><?php echo $lang['autoupdate_tableau_descmod']; ?></td>
<th><?php echo $lang['autoupdate_tableau_namemod']; ?></th>
<th><?php echo $lang['autoupdate_tableau_descmod']; ?></th>
<?php if ($user_data['user_admin'] == 1 || $user_data['user_coadmin'] == 1) {
echo '<td class=\'c\' width = "100">' . $lang['autoupdate_tableau_action'] . '</td>';
echo '<th>' . $lang['autoupdate_tableau_action'] . '</th>';
}
?>
</tr>
</thead>
<tbody>
<?php
//
foreach ($download_mod_list as $downloadmod) {
Expand All @@ -63,34 +67,43 @@
$install = true;
}
}
if ($install == false) {
if (!$install) {
$link = "<a href=\"?action=autoupdate&sub=mod_upgrade&mod=" . $cur_modname . "&tag=release\">" . $lang['autoupdate_tableau_install'] . "</a>";
echo "\t<tr>\n";
echo "\t\t<th>" . $cur_modname . "</th>\n";
echo "\t\t<th>" . $cur_description . "</th>\n";
echo "\t\t<th><span style=\"color: lime; \">" . $link . "</span></th>\n";
echo "\t\t<td>" . $cur_modname . "</td>\n";
echo "\t\t<td>" . $cur_description . "</td>\n";
echo "\t\t<td><span style=\"color: lime; \">" . $link . "</span></td>\n";
echo "\t</tr>\n";
}
}
?>
</tbody>
</table>
<table class='og-table og-full-table'>
<thead>
<tr>
<td class="c" colspan="100"><?php echo $lang['autoupdate_tableau_link']; ?></td>
<th colspan='100'><?= $lang['autoupdate_tableau_link']; ?></th>
</tr>
</thead>
<tbody>
<tr>
<th colspan="100"><a href="index.php?action=administration&subaction=mod"><?php echo $lang['autoupdate_tableau_pageadmin']; ?></a>
</th>
<td><a href="index.php?action=administration&subaction=mod"><?= $lang['autoupdate_tableau_pageadmin']; ?></a>
</td>
</tr>
<tr>
<th colspan="100"><a href="https://www.ogsteam.eu">ogsteam.eu</a></th>
<td><a href="https://www.ogsteam.eu">ogsteam.eu</a></td>
</tr>
</tbody>
</table><?php
} else {
die($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>';

require_once("views/page_tail.php");
?>
<br>
<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");
?>
Loading

0 comments on commit a566082

Please sign in to comment.