Upload via GUI (452 Dateien)
This commit is contained in:
@@ -50,6 +50,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action === 'catalog_update_all') {
|
||||
$res = plugin_catalog_update_all($pdo);
|
||||
if ($res['updated']) {
|
||||
audit_log($staff['id'], 'Plugins aus dem Katalog aktualisiert: ' . implode(', ', $res['updated']));
|
||||
flash('success', count($res['updated']) . ' Plugin(s) aktualisiert: ' . implode(', ', $res['updated']) . '.');
|
||||
} elseif (!$res['failed']) {
|
||||
flash('info', 'Alle Plugins sind aktuell.');
|
||||
}
|
||||
foreach ($res['failed'] as $failedSlug => $failedMsg) flash('error', $failedSlug . ': ' . $failedMsg);
|
||||
redirect('/staff/plugins.php');
|
||||
}
|
||||
|
||||
if ($action === 'catalog_install' && plugin_valid_slug($slug)) {
|
||||
$res = plugin_catalog_install($pdo, $slug);
|
||||
if ($res['ok']) {
|
||||
@@ -219,7 +231,8 @@ require __DIR__ . '/_header.php';
|
||||
</div>
|
||||
<?php foreach ($errors as $err): ?><div class="flash error"><?= e($err) ?></div><?php endforeach; ?>
|
||||
<?php if ($updates): ?>
|
||||
<div class="flash warning"><strong>Updates verfügbar:</strong> <?= e(implode(', ', array_map(fn($u) => $u['name'] . ' ' . $u['installed'] . ' → ' . $u['available'], $updates))) ?>. <a href="#" data-pl-tab="installed" data-pl-filter="update">Anzeigen</a> oder unter „Plugin hinzufügen“ mit „Aktualisieren“ installieren.</div>
|
||||
<div class="flash warning"><strong>Updates verfügbar:</strong> <?= e(implode(', ', array_map(fn($u) => $u['name'] . ' ' . $u['installed'] . ' → ' . $u['available'], $updates))) ?>. <a href="#" data-pl-tab="installed" data-pl-filter="update">Anzeigen</a>
|
||||
<form method="post" style="display:inline;margin:0 0 0 10px"><?= csrf_field() ?><input type="hidden" name="action" value="catalog_update_all"><button class="btn" type="submit" style="padding:3px 12px;font-size:.82rem" onclick="this.textContent='⏳ Wird aktualisiert …'"><?= count($updates) === 1 ? 'Jetzt aktualisieren' : 'Alle aktualisieren' ?></button></form></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($disabled): ?>
|
||||
<div class="flash error">Alle Plugins sind abgeschaltet (Datei <code>plugins/.disabled</code> oder Einstellung <code>plugins.enabled = false</code>). Bereits aktive Plugins werden nicht geladen.</div>
|
||||
@@ -272,7 +285,7 @@ require __DIR__ . '/_header.php';
|
||||
<button class="btn" type="submit" <?= $m ? '' : 'disabled' ?>>Aktivieren</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php if ($upd): ?><a class="pl-more" href="#" data-pl-tab="add">Jetzt aktualisieren</a><?php endif; ?>
|
||||
<?php if ($upd): ?><form method="post" style="margin:0;text-align:right"><?= csrf_field() ?><input type="hidden" name="action" value="catalog_install"><input type="hidden" name="slug" value="<?= e($slug) ?>"><button class="pl-more" type="submit" style="background:none;border:0;padding:0;cursor:pointer;font:inherit;text-decoration:underline" onclick="this.textContent='⏳ Wird aktualisiert …'">Jetzt aktualisieren</button></form><?php endif; ?>
|
||||
<a href="#" class="pl-more">Weitere Details</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user