Files
webgui/emhttp/plugins/dynamix.plugin.manager/PluginInstall.page
Zack Spear a65c442db9 fix: enhance layout consistency in PluginInstall.page and default-base.css
- Added utility classes for width, height, and overflow to improve layout structure in PluginInstall.page.
- Removed the obsolete Plugins.css file as its styles are no longer needed.
- This change continues the effort to enhance visual consistency across the plugin.
2025-05-21 16:52:34 -07:00

72 lines
2.2 KiB
Plaintext

Menu="Plugins"
Title="Install Plugin"
Tag="download"
---
<?PHP
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<script>
const my = {};
function installPlugin(file) {
if (file == null) {
$('#plugin_file').val('');
openPlugin(my.cmd, my.title, my.plg);
return;
}
file = file.trim();
if (!file) return;
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php', {
cmd: 'alert'
}, function(data) {
const forceInstall = $('#force_install').prop('checked');
my.cmd = 'plugin install ' + file + (forceInstall ? ' force' : '');
my.title = "_(Install Plugin)_";
my.plg = file.replace(/^.*(\\|\/|\:)/, '').replace('.plg', '') + ':install';
if (data == 0) {
// no alert message - proceed with install
setTimeout(installPlugin);
} else {
// show alert message and ask for confirmation
openAlert("showchanges <?= $alerts ?>", "<?= _('Alert Message') ?>", 'installPlugin');
}
});
}
$(function() {
$('form[name="plugin_install"]').on('submit', function(e) {
e.preventDefault();
installPlugin($('#plugin_file').val());
});
});
</script>
<form name="plugin_install" method="POST" target="progressFrame">
<p><strong>_(Enter URL of remote plugin file or local plugin file)_</strong></p>
<div>
<input type="text" name="file" id="plugin_file" maxlength="1024" value="">
<label style="margin-right: 10px;" title="_(Allows you to install the same or older version of a plugin)_">
<input type="checkbox" id="force_install" name="force_install">
_(Force Install)_
</label>
<input type="submit" value="_(Install)_">
</div>
</form>
:plugin_install_help:
<div class="max-w-20 mx-auto">
<p><strong>_(Select local plugin file)_</strong></p>
<div id="plugin_tree" class="textarea h-50 overflow-y-scroll scrollbar-thin"></div>
</div>