Initial commit
This commit is contained in:
commit
73c6b816c0
716 changed files with 170045 additions and 0 deletions
43
kirby/config/areas/system/dialogs.php
Normal file
43
kirby/config/areas/system/dialogs.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Panel\Field;
|
||||
|
||||
return [
|
||||
// license registration
|
||||
'registration' => [
|
||||
'load' => function () {
|
||||
return [
|
||||
'component' => 'k-form-dialog',
|
||||
'props' => [
|
||||
'fields' => [
|
||||
'license' => [
|
||||
'label' => t('license.register.label'),
|
||||
'type' => 'text',
|
||||
'required' => true,
|
||||
'counter' => false,
|
||||
'placeholder' => 'K3-',
|
||||
'help' => t('license.register.help')
|
||||
],
|
||||
'email' => Field::email([
|
||||
'required' => true
|
||||
])
|
||||
],
|
||||
'submitButton' => t('license.register'),
|
||||
'value' => [
|
||||
'license' => null,
|
||||
'email' => null
|
||||
]
|
||||
]
|
||||
];
|
||||
},
|
||||
'submit' => function () {
|
||||
// @codeCoverageIgnoreStart
|
||||
kirby()->system()->register(get('license'), get('email'));
|
||||
return [
|
||||
'event' => 'system.register',
|
||||
'message' => t('license.register.success')
|
||||
];
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
],
|
||||
];
|
47
kirby/config/areas/system/views.php
Normal file
47
kirby/config/areas/system/views.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Http\Server;
|
||||
|
||||
return [
|
||||
'system' => [
|
||||
'pattern' => 'system',
|
||||
'action' => function () {
|
||||
$kirby = kirby();
|
||||
$system = $kirby->system();
|
||||
$license = $system->license();
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
if ($license === true) {
|
||||
// valid license, but user is not admin
|
||||
$license = 'Kirby 3';
|
||||
} elseif ($license === false) {
|
||||
// no valid license
|
||||
$license = null;
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
$plugins = $system->plugins()->values(function ($plugin) {
|
||||
return [
|
||||
'author' => $plugin->authorsNames(),
|
||||
'license' => $plugin->license(),
|
||||
'link' => $plugin->link(),
|
||||
'name' => $plugin->name(),
|
||||
'version' => $plugin->version(),
|
||||
];
|
||||
});
|
||||
|
||||
return [
|
||||
'component' => 'k-system-view',
|
||||
'props' => [
|
||||
'debug' => $kirby->option('debug', false),
|
||||
'license' => $license,
|
||||
'plugins' => $plugins,
|
||||
'php' => phpversion(),
|
||||
'server' => $system->serverSoftware(),
|
||||
'https' => Server::https(),
|
||||
'version' => $kirby->version(),
|
||||
]
|
||||
];
|
||||
}
|
||||
],
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue