4
0

update 2023-06-30 08:04:32

This commit is contained in:
Robot 2023-06-30 08:04:32 +02:00
parent 4f053ffa35
commit 449d0fc72a
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
3 changed files with 98 additions and 42 deletions

View File

@ -201,8 +201,18 @@ final class DailyScripture
*/
private function replace(string $reference, string $name, int $number): string
{
// Use regex to replace the book name with the book number
return preg_replace('/^' . preg_quote($name, '/') . '\b/', $number, $reference);
// Split the reference into words
$words = preg_split('/(\s+)/u', $reference, -1, PREG_SPLIT_DELIM_CAPTURE);
// Find the first occurrence of the book name in the words and replace it with the book number
$index = array_search($name, $words);
if ($index !== false)
{
$words[$index] = $number;
}
// Join the words back together
return implode('', $words);
}
}

View File

@ -175,6 +175,16 @@
*/
private function replace(string $reference, string $name, int $number): string
{
// Use regex to replace the book name with the book number
return preg_replace('/^' . preg_quote($name, '/') . '\b/', $number, $reference);
// Split the reference into words
$words = preg_split('/(\s+)/u', $reference, -1, PREG_SPLIT_DELIM_CAPTURE);
// Find the first occurrence of the book name in the words and replace it with the book number
$index = array_search($name, $words);
if ($index !== false)
{
$words[$index] = $number;
}
// Join the words back together
return implode('', $words);
}

View File

@ -87,6 +87,15 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'access' => [
'name' => 'access',
'label' => 'COM_GETBIBLE_NOTE_ACCESS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'notes',
'store' => NULL,
'tab_name' => 'Details',
],
'guid' => [
'name' => 'guid',
'label' => 'COM_GETBIBLE_NOTE_GUID_LABEL',
@ -106,44 +115,6 @@ class Table extends BaseTable implements Tableinterface
'tab_name' => 'Details',
],
],
'tag' => [
'name' => [
'name' => 'name',
'label' => 'COM_GETBIBLE_TAG_NAME_LABEL',
'type' => 'text',
'title' => true,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'Details',
],
'linker' => [
'name' => 'linker',
'label' => 'COM_GETBIBLE_TAG_LINKER_LABEL',
'type' => 'linkers',
'title' => false,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'Details',
],
'guid' => [
'name' => 'guid',
'label' => 'COM_GETBIBLE_TAG_GUID_LABEL',
'type' => 'text',
'title' => false,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'publishing',
],
'description' => [
'name' => 'description',
'label' => 'COM_GETBIBLE_TAG_DESCRIPTION_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'Details',
],
],
'taged_verse' => [
'abbreviation' => [
'name' => 'abbreviation',
@ -154,6 +125,24 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL,
'tab_name' => 'Details',
],
'access' => [
'name' => 'access',
'label' => 'COM_GETBIBLE_TAGED_VERSE_ACCESS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'taged_verses',
'store' => NULL,
'tab_name' => 'Details',
],
'linker' => [
'name' => 'linker',
'label' => 'COM_GETBIBLE_TAGED_VERSE_LINKER_LABEL',
'type' => 'linkers',
'title' => false,
'list' => 'taged_verses',
'store' => NULL,
'tab_name' => 'Details',
],
'tag' => [
'name' => 'tag',
'label' => 'COM_GETBIBLE_TAGED_VERSE_TAG_LABEL',
@ -200,6 +189,53 @@ class Table extends BaseTable implements Tableinterface
'tab_name' => 'Details',
],
],
'tag' => [
'name' => [
'name' => 'name',
'label' => 'COM_GETBIBLE_TAG_NAME_LABEL',
'type' => 'text',
'title' => true,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'Details',
],
'linker' => [
'name' => 'linker',
'label' => 'COM_GETBIBLE_TAG_LINKER_LABEL',
'type' => 'linkers',
'title' => false,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'Details',
],
'access' => [
'name' => 'access',
'label' => 'COM_GETBIBLE_TAG_ACCESS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'Details',
],
'guid' => [
'name' => 'guid',
'label' => 'COM_GETBIBLE_TAG_GUID_LABEL',
'type' => 'text',
'title' => false,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'publishing',
],
'description' => [
'name' => 'description',
'label' => 'COM_GETBIBLE_TAG_DESCRIPTION_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'tags',
'store' => NULL,
'tab_name' => 'Details',
],
],
'translation' => [
'translation' => [
'name' => 'translation',