mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* some changes
* moved some admin html code from php to twig templates (.html files) * minimum PHP version required by installer is now 5.1.2, cause of spl_autoload_register functon. * depracated Twig to version 1.20.0 cause of Autoloader * removed unused admin stylish template
This commit is contained in:
@@ -12,26 +12,9 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Plugin manager';
|
||||
|
||||
require(SYSTEM . 'hooks.php');
|
||||
?>
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
<input type="hidden" name="upload_plugin" />
|
||||
<table cellspacing="3" border="0">
|
||||
<tr>
|
||||
<td colspan="2">Install plugin:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="file" name="plugin" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Upload" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/><br/>
|
||||
|
||||
<?php
|
||||
echo $twig->render('admin.plugins.form.html');
|
||||
|
||||
$message = '';
|
||||
if(isset($_FILES["plugin"]["name"]))
|
||||
{
|
||||
@@ -136,35 +119,30 @@ if(isset($_FILES["plugin"]["name"]))
|
||||
}
|
||||
|
||||
echo $message;
|
||||
?>
|
||||
<b>Installed plugins:</b>
|
||||
<table class="table" border="0" align="center">
|
||||
<tr>
|
||||
<th>Plugin name (Description on hover)</th>
|
||||
<th>Filename</th>
|
||||
<th>Version</th>
|
||||
<th>Author</th>
|
||||
<th>Contact</th>
|
||||
<?php
|
||||
$plugins = array();
|
||||
|
||||
$path = PLUGINS;
|
||||
foreach(scandir($path) as $file)
|
||||
{
|
||||
$file_info = explode('.', $file);
|
||||
if($file == '.' || $file == '..' || $file == 'disabled' || $file == 'example.json' || is_dir($path . $file) || !$file_info[1] || $file_info[1] != 'json')
|
||||
continue;
|
||||
|
||||
$string = file_get_contents(BASE . 'plugins/' . $file_info[0] . '.json');
|
||||
$plugin_info = json_decode($string, true);
|
||||
echo '<tr>
|
||||
<td><div title="' . $plugin_info['description'] . '">' . $plugin_info['name'] . '</div></td>
|
||||
<td>' . $file . '</td>
|
||||
<td>' . $plugin_info['version'] . '</td>
|
||||
<td>' . $plugin_info['author'] . '</td>
|
||||
<td>' . $plugin_info['contact'] . '</td>
|
||||
</tr>';
|
||||
}
|
||||
$plugins = array();
|
||||
$rows = array();
|
||||
|
||||
?>
|
||||
</table>
|
||||
$path = PLUGINS;
|
||||
foreach(scandir($path) as $file)
|
||||
{
|
||||
$file_info = explode('.', $file);
|
||||
if($file == '.' || $file == '..' || $file == 'disabled' || $file == 'example.json' || is_dir($path . $file) || !$file_info[1] || $file_info[1] != 'json')
|
||||
continue;
|
||||
|
||||
$string = file_get_contents(BASE . 'plugins/' . $file_info[0] . '.json');
|
||||
$plugin_info = json_decode($string, true);
|
||||
$rows[] = array(
|
||||
'name' => $plugin_info['name'],
|
||||
'description' => $plugin_info['description'],
|
||||
'version' => $plugin_info['version'],
|
||||
'author' => $plugin_info['author'],
|
||||
'contact' => $plugin_info['contact'],
|
||||
'file' => $file,
|
||||
);
|
||||
}
|
||||
|
||||
echo $twig->render('admin.plugins.html', array(
|
||||
'plugins' => $rows
|
||||
));
|
||||
?>
|
Reference in New Issue
Block a user