Skip to content

Commit

Permalink
Merge branch 'v4/develop' into v4/enhancement/licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Nov 21, 2023
2 parents ce3ff18 + d0f505e commit 1a27e75
Show file tree
Hide file tree
Showing 55 changed files with 1,115 additions and 352 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Kirby core",
"license": "proprietary",
"type": "kirby-cms",
"version": "4.0.0-rc.1",
"version": "4.0.0-rc.2",
"keywords": [
"kirby",
"cms",
Expand Down Expand Up @@ -46,7 +46,7 @@
"phpmailer/phpmailer": "6.8.1",
"symfony/polyfill-intl-idn": "1.28.0",
"symfony/polyfill-mbstring": "1.28.0",
"symfony/yaml": "6.3.7"
"symfony/yaml": "6.3.8"
},
"replace": {
"symfony/polyfill-php72": "*"
Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions config/methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\NotFoundException;
use Kirby\Image\QrCode;
use Kirby\Toolkit\A;
use Kirby\Toolkit\Dom;
use Kirby\Toolkit\Str;
use Kirby\Toolkit\V;
use Kirby\Toolkit\Xml;
use Kirby\Uuid\Uuid;

/**
* Field method setup
Expand Down Expand Up @@ -461,6 +464,42 @@
return $field;
},

/**
* Parses the field value as DOM and replaces
* any permalinks in href/src attributes with
* the regular url
*
* This method is still experimental! You can use
* it to solve potential problems with permalinks
* already, but it might change in the future.
*/
'permalinksToUrls' => function (Field $field): Field {
if ($field->isNotEmpty() === true) {
$dom = new Dom($field->value);
$attributes = ['href', 'src'];
$elements = $dom->query('//*[' . implode(' | ', A::map($attributes, fn ($attribute) => '@' . $attribute)) . ']');

foreach ($elements as $element) {
foreach ($attributes as $attribute) {
if ($element->hasAttribute($attribute) && $url = $element->getAttribute($attribute)) {
try {
if ($uuid = Uuid::for($url)) {
$url = $uuid->model()?->url();
$element->setAttribute($attribute, $url);
}
} catch (InvalidArgumentException) {
// ignore anything else than permalinks
}
}
}
}

$field->value = $dom->toString();
}

return $field;
},

/**
* Uses the field value as Kirby query
*/
Expand Down
28 changes: 24 additions & 4 deletions i18n/translations/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

"drawer.fields.empty": "This drawer has no fields",

"domain": "Domain",
"download": "Download",
"duplicate": "Duplicate",

Expand Down Expand Up @@ -132,8 +133,9 @@
"error.layout.validation.block": "There's an error on the \"{field}\" field in block {blockIndex} using the \"{fieldset}\" block type in layout {layoutIndex}",
"error.layout.validation.settings": "There's an error in layout {index} settings",

"error.license.format": "Please enter a valid license key",
"error.license.domain": "The domain for the license is missing",
"error.license.email": "Моля въведете валиден email адрес",
"error.license.format": "Please enter a valid license key",
"error.license.verification": "The license could not be verified",

"error.login.totp.confirm.invalid": "Invalid code",
Expand Down Expand Up @@ -416,13 +418,26 @@
"license.activate.label": "Please activate your license",
"license.activate.domain": "Your license will be activated for <strong>{host}</strong>.",
"license.activate.local": "You are about to activate your Kirby license for your local domain <strong>{host}</strong>. If this site will be deployed to a public domain, please activate it there instead. If {host} is the domain you want to use your license for, please continue.",
"license.activated": "Activated",
"license.buy": "Купи лиценз",
"license.code": "Код",
"license.code.help": "You received your license code after the purchase via email. Please copy and paste it here.",
"license.code.label": "Please enter your license code",
"license.status.active.info": "Includes new major versions until {date}",
"license.status.active.label": "Valid license",
"license.status.inactive.info": "Renew license to update to new major versions",
"license.status.inactive.label": "No new major versions",
"license.status.legacy.bubble": "Ready to renew your license?",
"license.status.legacy.info": "Your license does not cover this version",
"license.status.legacy.label": "Please renew your license",
"license.status.missing.bubble": "Ready to launch your site?",
"license.status.missing.info": "No valid license",
"license.status.missing.label": "Please activate your license",
"license.manage": "Manage your licenses",
"license.ready": "Ready to launch your site?",
"license.purchased": "Purchased",
"license.success": "Thank you for supporting Kirby",
"license.unregistered.label": "Unregistered",
"license.updates": "Includes free updates until",

"link": "\u0412\u0440\u044a\u0437\u043a\u0430",
"link.text": "Текстова връзка",
Expand Down Expand Up @@ -461,12 +476,12 @@
"login.totp.enable.confirm.text": "Your app generates a new one‑time code every 30 seconds. Enter the current code to complete the setup:",
"login.totp.enable.confirm.label": "Current code",
"login.totp.enable.confirm.help": "After this setup, we will ask you for a one‑time code every time you log in.",
"login.totp.enable.success": "Activated one‑time codes",
"login.totp.enable.success": "One‑time codes enabled",
"login.totp.disable.option": "Disable one‑time codes",
"login.totp.disable.label": "Enter your password to disable one‑time codes",
"login.totp.disable.help": "In the future, a different second factor like a login code sent via email will be requested when you log in. You can always set up one‑time codes again later.",
"login.totp.disable.admin": "<p>This will disable one‑time codes for <strong>{user}</strong>.</p><p>In the future, a different second factor like a login code sent via email will be requested when they log in. {user} can set up one‑time codes again after their next login.</p>",
"login.totp.disable.success": "Disabled one‑time codes",
"login.totp.disable.success": "One‑time codes disabled",

"logout": "Изход",

Expand Down Expand Up @@ -555,6 +570,7 @@
"preview": "Preview",
"remove": "Премахни",
"rename": "Преименувай",
"renew": "Renew",
"replace": "\u0417\u0430\u043c\u0435\u0441\u0442\u0438",
"replace.with": "Replace with",
"retry": "\u041e\u043f\u0438\u0442\u0430\u0439 \u043f\u0430\u043a",
Expand Down Expand Up @@ -592,6 +608,8 @@
"split": "Split",

"stats.empty": "No reports",
"status": "Status",

"system.issues.content": "The content folder seems to be exposed",
"system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates",
"system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates",
Expand Down Expand Up @@ -648,6 +666,8 @@
"translation.name": "Български",
"translation.locale": "bg_BG",

"type": "Type",

"upload": "Прикачи",
"upload.error.cantMove": "The uploaded file could not be moved",
"upload.error.cantWrite": "Failed to write file to disk",
Expand Down
28 changes: 24 additions & 4 deletions i18n/translations/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

"drawer.fields.empty": "This drawer has no fields",

"domain": "Domain",
"download": "Descarregar",
"duplicate": "Duplicar",

Expand Down Expand Up @@ -132,8 +133,9 @@
"error.layout.validation.block": "There's an error on the \"{field}\" field in block {blockIndex} using the \"{fieldset}\" block type in layout {layoutIndex}",
"error.layout.validation.settings": "There's an error in layout {index} settings",

"error.license.format": "Introduïu una clau de llicència vàlida",
"error.license.domain": "The domain for the license is missing",
"error.license.email": "Si us plau, introdueix una adreça de correu electrònic vàlida",
"error.license.format": "Introduïu una clau de llicència vàlida",
"error.license.verification": "No s’ha pogut verificar la llicència",

"error.login.totp.confirm.invalid": "Codi invàlid",
Expand Down Expand Up @@ -416,13 +418,26 @@
"license.activate.label": "Please activate your license",
"license.activate.domain": "Your license will be activated for <strong>{host}</strong>.",
"license.activate.local": "You are about to activate your Kirby license for your local domain <strong>{host}</strong>. If this site will be deployed to a public domain, please activate it there instead. If {host} is the domain you want to use your license for, please continue.",
"license.activated": "Activated",
"license.buy": "Comprar una llicència",
"license.code": "Codi",
"license.code.help": "You received your license code after the purchase via email. Please copy and paste it here.",
"license.code.label": "Si us plau, introdueixi el seu codi de llicència",
"license.status.active.info": "Includes new major versions until {date}",
"license.status.active.label": "Valid license",
"license.status.inactive.info": "Renew license to update to new major versions",
"license.status.inactive.label": "No new major versions",
"license.status.legacy.bubble": "Ready to renew your license?",
"license.status.legacy.info": "Your license does not cover this version",
"license.status.legacy.label": "Please renew your license",
"license.status.missing.bubble": "Ready to launch your site?",
"license.status.missing.info": "No valid license",
"license.status.missing.label": "Please activate your license",
"license.manage": "Manage your licenses",
"license.ready": "Ready to launch your site?",
"license.purchased": "Purchased",
"license.success": "Gràcies per donar suport a Kirby",
"license.unregistered.label": "Unregistered",
"license.updates": "Includes free updates until",

"link": "Enlla\u00e7",
"link.text": "Enllaç de text",
Expand Down Expand Up @@ -461,12 +476,12 @@
"login.totp.enable.confirm.text": "Your app generates a new one‑time code every 30 seconds. Enter the current code to complete the setup:",
"login.totp.enable.confirm.label": "Current code",
"login.totp.enable.confirm.help": "After this setup, we will ask you for a one‑time code every time you log in.",
"login.totp.enable.success": "Activated one‑time codes",
"login.totp.enable.success": "One‑time codes enabled",
"login.totp.disable.option": "Disable one‑time codes",
"login.totp.disable.label": "Enter your password to disable one‑time codes",
"login.totp.disable.help": "In the future, a different second factor like a login code sent via email will be requested when you log in. You can always set up one‑time codes again later.",
"login.totp.disable.admin": "<p>This will disable one‑time codes for <strong>{user}</strong>.</p><p>In the future, a different second factor like a login code sent via email will be requested when they log in. {user} can set up one‑time codes again after their next login.</p>",
"login.totp.disable.success": "Disabled one‑time codes",
"login.totp.disable.success": "One‑time codes disabled",

"logout": "Tancar sessió",

Expand Down Expand Up @@ -555,6 +570,7 @@
"preview": "Preview",
"remove": "Eliminar",
"rename": "Canviar el nom",
"renew": "Renew",
"replace": "Reempla\u00e7ar",
"replace.with": "Replace with",
"retry": "Reintentar",
Expand Down Expand Up @@ -592,6 +608,8 @@
"split": "Split",

"stats.empty": "No reports",
"status": "Estat",

"system.issues.content": "The content folder seems to be exposed",
"system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates",
"system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates",
Expand Down Expand Up @@ -648,6 +666,8 @@
"translation.name": "Catalan",
"translation.locale": "ca_ES",

"type": "Type",

"upload": "Carregar",
"upload.error.cantMove": "El fitxer carregat no s'ha pogut moure",
"upload.error.cantWrite": "No s'ha pogut escriure el fitxer al disc",
Expand Down
Loading

0 comments on commit 1a27e75

Please sign in to comment.