1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 10:20:45 +02:00

Fixes "Updates to be Installed" functionality in Plugin Manager.

This commit is contained in:
Cameron
2020-12-31 10:24:13 -08:00
parent 8871cdd097
commit 60027348b4
2 changed files with 17 additions and 5 deletions

View File

@@ -348,6 +348,7 @@ class plugin_ui extends e_admin_ui
function renderHelp() function renderHelp()
{ {
$plg = e107::getPlug(); $plg = e107::getPlug();
$plg->clearCache();
if(!$list = $plg->getUpgradableList()) if(!$list = $plg->getUpgradableList())
{ {
return null; return null;
@@ -358,18 +359,17 @@ class plugin_ui extends e_admin_ui
foreach($list as $path=>$ver) foreach($list as $path=>$ver)
{ {
$plg->load($path); $plg->load($path);
$url = e_ADMIN."plugin.php?mode=installed&action=upgrade&id=".$path; $name = $plg->getName();
$url = e_ADMIN."plugin.php?mode=installed&action=upgrade&path=".$path;
$text .= "<li class='media'> $text .= "<li class='media'>
<div class='media-left'> <div class='media-left'>
<a href='".$url."'>".$plg->getIcon(32)."</a> <a href='".$url."'>".$plg->getIcon(32)."</a>
</div><div class='media-body'><a href='".$url."'>".$plg->getName()."</a></div></li>"; </div><div class='media-body'><a class='e-spinner' href='".$url."' title=\"".EPL_UPGRADE." ".$name." v".$ver."\">".$name."</a></div></li>";
} }
$text .= "</ul>"; $text .= "</ul>";
return array('caption'=>EPL_ADLAN_247, 'text'=>$text); return array('caption'=>EPL_ADLAN_247, 'text'=>$text);
} }
@@ -526,6 +526,7 @@ class plugin_ui extends e_admin_ui
function upgradePage() function upgradePage()
{ {
$this->pluginUpgrade(); $this->pluginUpgrade();
} }
@@ -609,11 +610,14 @@ class plugin_ui extends e_admin_ui
$_path = e_PLUGIN.$id.'/'; $_path = e_PLUGIN.$id.'/';
if(file_exists($_path.'plugin.xml')) if(file_exists($_path.'plugin.xml'))
{ {
$plugin->install_plugin_xml($id, 'upgrade'); $plugin->install_plugin_xml($id, 'upgrade');
$text = LAN_UPGRADE_SUCCESSFUL; $text = LAN_UPGRADE_SUCCESSFUL;
} }
else else
{ {
e107::getMessage()->addDebug("Running Legacy plugin upgrade. <b>".$_path."</b> not found."); // NO LAN
$eplug_folder = null; $eplug_folder = null;
$upgrade_alter_tables = null; $upgrade_alter_tables = null;
$upgrade_add_prefs = null; $upgrade_add_prefs = null;
@@ -623,7 +627,6 @@ class plugin_ui extends e_admin_ui
$eplug_version = null; $eplug_version = null;
include(e_PLUGIN.$plug['plugin_path'].'/plugin.php'); include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
$text = ''; $text = '';

View File

@@ -174,6 +174,15 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$(document).ready(function() $(document).ready(function()
{ {
$('a.e-spinner').on('click', function() {
var orig = $(this).text();
var spin = "<i class='fa fa-spin fa-spinner fa-fw'></i>";
$(this).html(orig + spin);
});
$('#e-modal-submit').click(function () { $('#e-modal-submit').click(function () {
$('#e-modal-iframe').contents().find('#etrigger-submit').trigger('click'); $('#e-modal-iframe').contents().find('#etrigger-submit').trigger('click');