mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-07 11:16:27 +02:00
restore tool - mostly working
This commit is contained in:
10
admin.php
10
admin.php
@@ -393,11 +393,19 @@ class AdminPlugin extends Plugin
|
||||
$manifestFiles = $manager->hasSnapshots() ? [true] : [];
|
||||
}
|
||||
|
||||
$tools = $event['tools'];
|
||||
Grav::instance()['log']->debug('[Admin] Tools before restore grav: ' . implode(',', array_keys($tools)));
|
||||
|
||||
if ($manifestFiles) {
|
||||
$event['tools']['restore-grav'] = [['admin.super'], 'PLUGIN_ADMIN.RESTORE_GRAV'];
|
||||
$tools['restore-grav'] = [['admin.super'], 'PLUGIN_ADMIN.RESTORE_GRAV'];
|
||||
Grav::instance()['log']->debug('[Admin] Restore Grav tool enabled');
|
||||
}
|
||||
|
||||
$event['tools'] = $tools;
|
||||
Grav::instance()['log']->debug('[Admin] Tools after register: ' . implode(',', array_keys($tools)));
|
||||
} catch (\Throwable $e) {
|
||||
// ignore availability errors, snapshots tool will simply stay hidden
|
||||
Grav::instance()['log']->warning('[Admin] Restore Grav detection failed: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user