Upgrade to 3.7.0

This commit is contained in:
Bastian Allgeier
2022-06-27 10:02:22 +02:00
parent 0751a6510d
commit 1c22148d7b
674 changed files with 5052 additions and 3082 deletions

53
kirby/config/areas/system/dialogs.php Normal file → Executable file
View File

@@ -1,8 +1,46 @@
<?php
use Kirby\Cms\App;
use Kirby\Panel\Field;
use Kirby\Toolkit\I18n;
return [
// license key
'license' => [
'load' => function () {
$license = App::instance()->system()->license();
// @codeCoverageIgnoreStart
// the system is registered but the license
// key is only visible for admins
if ($license === true) {
$license = 'Kirby 3';
}
// @codeCoverageIgnoreEnd
return [
'component' => 'k-form-dialog',
'props' => [
'size' => 'medium',
'fields' => [
'license' => [
'type' => 'info',
'label' => I18n::translate('license'),
'text' => $license ? $license : I18n::translate('license.unregistered.label'),
'theme' => $license ? 'code' : 'negative',
'help' => $license ?
// @codeCoverageIgnoreStart
'<a href="https://hub.getkirby.com">' . I18n::translate('license.manage') . ' &rarr;</a>' :
// @codeCoverageIgnoreEnd
'<a href="https://getkirby.com/buy">' . I18n::translate('license.buy') . ' &rarr;</a>'
]
],
'submitButton' => false,
'cancelButton' => false,
]
];
}
],
// license registration
'registration' => [
'load' => function () {
@@ -11,18 +49,18 @@ return [
'props' => [
'fields' => [
'license' => [
'label' => t('license.register.label'),
'label' => I18n::translate('license.register.label'),
'type' => 'text',
'required' => true,
'counter' => false,
'placeholder' => 'K3-',
'help' => t('license.register.help')
'help' => I18n::translate('license.register.help')
],
'email' => Field::email([
'required' => true
])
],
'submitButton' => t('license.register'),
'submitButton' => I18n::translate('license.register'),
'value' => [
'license' => null,
'email' => null
@@ -32,10 +70,15 @@ return [
},
'submit' => function () {
// @codeCoverageIgnoreStart
kirby()->system()->register(get('license'), get('email'));
$kirby = App::instance();
$kirby->system()->register(
$kirby->request()->get('license'),
$kirby->request()->get('email')
);
return [
'event' => 'system.register',
'message' => t('license.register.success')
'message' => I18n::translate('license.register.success')
];
// @codeCoverageIgnoreEnd
}

18
kirby/config/areas/system/views.php Normal file → Executable file
View File

@@ -1,12 +1,12 @@
<?php
use Kirby\Http\Server;
use Kirby\Cms\App;
return [
'system' => [
'pattern' => 'system',
'action' => function () {
$kirby = kirby();
$kirby = App::instance();
$system = $kirby->system();
$license = $system->license();
@@ -24,8 +24,10 @@ return [
return [
'author' => $plugin->authorsNames(),
'license' => $plugin->license(),
'link' => $plugin->link(),
'name' => $plugin->name(),
'name' => [
'text' => $plugin->name(),
'href' => $plugin->link(),
],
'version' => $plugin->version(),
];
});
@@ -38,8 +40,14 @@ return [
'plugins' => $plugins,
'php' => phpversion(),
'server' => $system->serverSoftware(),
'https' => Server::https(),
'https' => $kirby->environment()->https(),
'version' => $kirby->version(),
'urls' => [
'content' => $system->exposedFileUrl('content'),
'git' => $system->exposedFileUrl('git'),
'kirby' => $system->exposedFileUrl('kirby'),
'site' => $system->exposedFileUrl('site')
]
]
];
}