update 2023-06-30 08:04:32
This commit is contained in:
parent
4f053ffa35
commit
449d0fc72a
@ -201,8 +201,18 @@ final class DailyScripture
|
|||||||
*/
|
*/
|
||||||
private function replace(string $reference, string $name, int $number): string
|
private function replace(string $reference, string $name, int $number): string
|
||||||
{
|
{
|
||||||
// Use regex to replace the book name with the book number
|
// Split the reference into words
|
||||||
return preg_replace('/^' . preg_quote($name, '/') . '\b/', $number, $reference);
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,6 +175,16 @@
|
|||||||
*/
|
*/
|
||||||
private function replace(string $reference, string $name, int $number): string
|
private function replace(string $reference, string $name, int $number): string
|
||||||
{
|
{
|
||||||
// Use regex to replace the book name with the book number
|
// Split the reference into words
|
||||||
return preg_replace('/^' . preg_quote($name, '/') . '\b/', $number, $reference);
|
$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);
|
||||||
}
|
}
|
@ -87,6 +87,15 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
|
'access' => [
|
||||||
|
'name' => 'access',
|
||||||
|
'label' => 'COM_GETBIBLE_NOTE_ACCESS_LABEL',
|
||||||
|
'type' => 'radio',
|
||||||
|
'title' => false,
|
||||||
|
'list' => 'notes',
|
||||||
|
'store' => NULL,
|
||||||
|
'tab_name' => 'Details',
|
||||||
|
],
|
||||||
'guid' => [
|
'guid' => [
|
||||||
'name' => 'guid',
|
'name' => 'guid',
|
||||||
'label' => 'COM_GETBIBLE_NOTE_GUID_LABEL',
|
'label' => 'COM_GETBIBLE_NOTE_GUID_LABEL',
|
||||||
@ -106,44 +115,6 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'tab_name' => 'Details',
|
'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' => [
|
'taged_verse' => [
|
||||||
'abbreviation' => [
|
'abbreviation' => [
|
||||||
'name' => 'abbreviation',
|
'name' => 'abbreviation',
|
||||||
@ -154,6 +125,24 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'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' => [
|
'tag' => [
|
||||||
'name' => 'tag',
|
'name' => 'tag',
|
||||||
'label' => 'COM_GETBIBLE_TAGED_VERSE_TAG_LABEL',
|
'label' => 'COM_GETBIBLE_TAGED_VERSE_TAG_LABEL',
|
||||||
@ -200,6 +189,53 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'tab_name' => 'Details',
|
'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' => [
|
||||||
'translation' => [
|
'translation' => [
|
||||||
'name' => 'translation',
|
'name' => 'translation',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user