fix: extension manager is install-only, updates go through Joomla [skip ci]

Removed update_available status and update button — each package
registers its own update server URL, so updates are handled via
Joomla's native System > Update mechanism.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-06-02 11:15:38 -05:00
parent 2546f542e7
commit 29305f66bf
3 changed files with 6 additions and 25 deletions
@@ -17,5 +17,5 @@ COM_MOKOWAAS_TOGGLE_SUCCESS="Plugin state updated."
COM_MOKOWAAS_TOGGLE_FAIL="Failed to update plugin state."
COM_MOKOWAAS_CACHE_CLEARED="Cache cleared successfully."
COM_MOKOWAAS_EXTENSIONS_TITLE="Moko Extensions"
COM_MOKOWAAS_EXTENSIONS_INFO="Install and manage Moko Consulting Joomla packages. Extensions are downloaded from the official Gitea release server."
COM_MOKOWAAS_EXTENSIONS_INFO="Install Moko Consulting Joomla packages from the official release server. Updates are handled through Joomla's native System > Update mechanism — each package registers its own update server."
COM_MOKOWAAS_EXTENSIONS_LINK="Moko Extensions"
@@ -113,21 +113,7 @@ class ExtensionsModel extends BaseDatabaseModel
$remoteVersion = $release['version'] ?? '';
$downloadUrl = $release['download_url'] ?? '';
$status = 'not_installed';
if ($localVersion !== null)
{
$status = 'installed';
if ($remoteVersion && version_compare(
preg_replace('/[^0-9.]/', '', $remoteVersion),
preg_replace('/[^0-9.]/', '', $localVersion),
'>'
))
{
$status = 'update_available';
}
}
$status = ($localVersion !== null) ? 'installed' : 'not_installed';
$packages[] = (object) [
'repo' => $repo,
@@ -25,9 +25,8 @@ foreach ($packages as $pkg)
}
$statusBadge = [
'installed' => ['bg-success', 'Installed'],
'update_available' => ['bg-warning text-dark', 'Update Available'],
'not_installed' => ['bg-secondary', 'Not Installed'],
'installed' => ['bg-success', 'Installed'],
'not_installed' => ['bg-secondary', 'Not Installed'],
];
?>
@@ -64,10 +63,6 @@ $statusBadge = [
<div class="small text-muted">
<?php if ($pkg->local_version): ?>
v<?php echo htmlspecialchars($pkg->local_version); ?>
<?php if ($pkg->remote_version && $pkg->status === 'update_available'): ?>
<span class="icon-arrow-right" aria-hidden="true"></span>
<span class="text-warning"><?php echo htmlspecialchars($pkg->remote_version); ?></span>
<?php endif; ?>
<?php elseif ($pkg->remote_version): ?>
Latest: <?php echo htmlspecialchars($pkg->remote_version); ?>
<?php endif; ?>
@@ -76,14 +71,14 @@ $statusBadge = [
<a href="<?php echo htmlspecialchars($pkg->repo_url); ?>" target="_blank" class="btn btn-sm btn-outline-secondary" title="View on Gitea">
<span class="icon-code-branch" aria-hidden="true"></span>
</a>
<?php if ($pkg->download_url && $pkg->status !== 'installed'): ?>
<?php if ($pkg->download_url && $pkg->status === 'not_installed'): ?>
<button type="button" class="btn btn-sm btn-primary mokowaas-install-btn"
data-url="<?php echo Route::_('index.php?option=com_mokowaas&task=display.installExtension&format=json'); ?>"
data-download="<?php echo htmlspecialchars($pkg->download_url); ?>"
data-token="<?php echo $token; ?>"
data-label="<?php echo htmlspecialchars($pkg->label); ?>">
<span class="icon-download" aria-hidden="true"></span>
<?php echo $pkg->status === 'update_available' ? 'Update' : 'Install'; ?>
Install
</button>
<?php elseif ($pkg->status === 'installed'): ?>
<span class="btn btn-sm btn-outline-success disabled">