@@ -25,45 +25,45 @@ |
||
25 | 25 | * @extends AbstractHookCollector<SosaMissingDatatablesExtenderInterface> |
26 | 26 | */ |
27 | 27 | class SosaMissingDatatablesExtenderCollector extends AbstractHookCollector implements |
28 | - SosaMissingDatatablesExtenderInterface |
|
28 | + SosaMissingDatatablesExtenderInterface |
|
29 | 29 | { |
30 | - /** |
|
31 | - * {@inheritDoc} |
|
32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | - */ |
|
34 | - public function title(): string |
|
35 | - { |
|
36 | - return I18N::translate('Columns extender for tables of missing ancestors'); |
|
37 | - } |
|
30 | + /** |
|
31 | + * {@inheritDoc} |
|
32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | + */ |
|
34 | + public function title(): string |
|
35 | + { |
|
36 | + return I18N::translate('Columns extender for tables of missing ancestors'); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * {@inheritDoc} |
|
41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | - */ |
|
43 | - public function description(): string |
|
44 | - { |
|
45 | - return I18N::translate('Add additional columns to tables of missing ancestors'); |
|
46 | - } |
|
39 | + /** |
|
40 | + * {@inheritDoc} |
|
41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | + */ |
|
43 | + public function description(): string |
|
44 | + { |
|
45 | + return I18N::translate('Add additional columns to tables of missing ancestors'); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritDoc} |
|
50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | - */ |
|
52 | - public function hookInterface(): string |
|
53 | - { |
|
54 | - return SosaMissingDatatablesExtenderInterface::class; |
|
55 | - } |
|
48 | + /** |
|
49 | + * {@inheritDoc} |
|
50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | + */ |
|
52 | + public function hookInterface(): string |
|
53 | + { |
|
54 | + return SosaMissingDatatablesExtenderInterface::class; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * {@inheritDoc} |
|
59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaMissingDatatablesExtenderInterface::sosaMissingColumns() |
|
60 | - */ |
|
61 | - public function sosaMissingColumns(iterable $records): array |
|
62 | - { |
|
63 | - $result = []; |
|
64 | - foreach ($this->hooks() as $hook) { |
|
65 | - $result += $hook->sosaMissingColumns($records); |
|
66 | - } |
|
67 | - return $result; |
|
68 | - } |
|
57 | + /** |
|
58 | + * {@inheritDoc} |
|
59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaMissingDatatablesExtenderInterface::sosaMissingColumns() |
|
60 | + */ |
|
61 | + public function sosaMissingColumns(iterable $records): array |
|
62 | + { |
|
63 | + $result = []; |
|
64 | + foreach ($this->hooks() as $hook) { |
|
65 | + $result += $hook->sosaMissingColumns($records); |
|
66 | + } |
|
67 | + return $result; |
|
68 | + } |
|
69 | 69 | } |
@@ -25,45 +25,45 @@ |
||
25 | 25 | * @extends AbstractHookCollector<SosaFamilyDatatablesExtenderInterface> |
26 | 26 | */ |
27 | 27 | class SosaFamilyDatatablesExtenderCollector extends AbstractHookCollector implements |
28 | - SosaFamilyDatatablesExtenderInterface |
|
28 | + SosaFamilyDatatablesExtenderInterface |
|
29 | 29 | { |
30 | - /** |
|
31 | - * {@inheritDoc} |
|
32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | - */ |
|
34 | - public function title(): string |
|
35 | - { |
|
36 | - return I18N::translate('Columns extender for tables of ancestors’ families'); |
|
37 | - } |
|
30 | + /** |
|
31 | + * {@inheritDoc} |
|
32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | + */ |
|
34 | + public function title(): string |
|
35 | + { |
|
36 | + return I18N::translate('Columns extender for tables of ancestors’ families'); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * {@inheritDoc} |
|
41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | - */ |
|
43 | - public function description(): string |
|
44 | - { |
|
45 | - return I18N::translate('Add additional columns to tables of ancestors’ families'); |
|
46 | - } |
|
39 | + /** |
|
40 | + * {@inheritDoc} |
|
41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | + */ |
|
43 | + public function description(): string |
|
44 | + { |
|
45 | + return I18N::translate('Add additional columns to tables of ancestors’ families'); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritDoc} |
|
50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | - */ |
|
52 | - public function hookInterface(): string |
|
53 | - { |
|
54 | - return SosaFamilyDatatablesExtenderInterface::class; |
|
55 | - } |
|
48 | + /** |
|
49 | + * {@inheritDoc} |
|
50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | + */ |
|
52 | + public function hookInterface(): string |
|
53 | + { |
|
54 | + return SosaFamilyDatatablesExtenderInterface::class; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * {@inheritDoc} |
|
59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaFamilyDatatablesExtenderInterface::sosaFamilyColumns() |
|
60 | - */ |
|
61 | - public function sosaFamilyColumns(iterable $records): array |
|
62 | - { |
|
63 | - $result = []; |
|
64 | - foreach ($this->hooks() as $hook) { |
|
65 | - $result += $hook->sosaFamilyColumns($records); |
|
66 | - } |
|
67 | - return $result; |
|
68 | - } |
|
57 | + /** |
|
58 | + * {@inheritDoc} |
|
59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaFamilyDatatablesExtenderInterface::sosaFamilyColumns() |
|
60 | + */ |
|
61 | + public function sosaFamilyColumns(iterable $records): array |
|
62 | + { |
|
63 | + $result = []; |
|
64 | + foreach ($this->hooks() as $hook) { |
|
65 | + $result += $hook->sosaFamilyColumns($records); |
|
66 | + } |
|
67 | + return $result; |
|
68 | + } |
|
69 | 69 | } |
@@ -25,45 +25,45 @@ |
||
25 | 25 | * @extends AbstractHookCollector<SosaIndividualDatatablesExtenderInterface> |
26 | 26 | */ |
27 | 27 | class SosaIndividualDatatablesExtenderCollector extends AbstractHookCollector implements |
28 | - SosaIndividualDatatablesExtenderInterface |
|
28 | + SosaIndividualDatatablesExtenderInterface |
|
29 | 29 | { |
30 | - /** |
|
31 | - * {@inheritDoc} |
|
32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | - */ |
|
34 | - public function title(): string |
|
35 | - { |
|
36 | - return I18N::translate('Columns extender for tables of ancestors'); |
|
37 | - } |
|
30 | + /** |
|
31 | + * {@inheritDoc} |
|
32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | + */ |
|
34 | + public function title(): string |
|
35 | + { |
|
36 | + return I18N::translate('Columns extender for tables of ancestors'); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * {@inheritDoc} |
|
41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | - */ |
|
43 | - public function description(): string |
|
44 | - { |
|
45 | - return I18N::translate('Add additional columns to tables of ancestors'); |
|
46 | - } |
|
39 | + /** |
|
40 | + * {@inheritDoc} |
|
41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | + */ |
|
43 | + public function description(): string |
|
44 | + { |
|
45 | + return I18N::translate('Add additional columns to tables of ancestors'); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritDoc} |
|
50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | - */ |
|
52 | - public function hookInterface(): string |
|
53 | - { |
|
54 | - return SosaIndividualDatatablesExtenderInterface::class; |
|
55 | - } |
|
48 | + /** |
|
49 | + * {@inheritDoc} |
|
50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | + */ |
|
52 | + public function hookInterface(): string |
|
53 | + { |
|
54 | + return SosaIndividualDatatablesExtenderInterface::class; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * {@inheritDoc} |
|
59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaIndividualDatatablesExtenderInterface::sosaIndividualColumns() |
|
60 | - */ |
|
61 | - public function sosaIndividualColumns(iterable $records): array |
|
62 | - { |
|
63 | - $result = []; |
|
64 | - foreach ($this->hooks() as $hook) { |
|
65 | - $result += $hook->sosaIndividualColumns($records); |
|
66 | - } |
|
67 | - return $result; |
|
68 | - } |
|
57 | + /** |
|
58 | + * {@inheritDoc} |
|
59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\SosaIndividualDatatablesExtenderInterface::sosaIndividualColumns() |
|
60 | + */ |
|
61 | + public function sosaIndividualColumns(iterable $records): array |
|
62 | + { |
|
63 | + $result = []; |
|
64 | + foreach ($this->hooks() as $hook) { |
|
65 | + $result += $hook->sosaIndividualColumns($records); |
|
66 | + } |
|
67 | + return $result; |
|
68 | + } |
|
69 | 69 | } |
@@ -27,56 +27,56 @@ |
||
27 | 27 | */ |
28 | 28 | class FactSourceTextExtenderCollector extends AbstractHookCollector implements FactSourceTextExtenderInterface |
29 | 29 | { |
30 | - /** |
|
31 | - * {@inheritDoc} |
|
32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | - */ |
|
34 | - public function title(): string |
|
35 | - { |
|
36 | - return I18N::translate('Text extender for source citations’ title'); |
|
37 | - } |
|
30 | + /** |
|
31 | + * {@inheritDoc} |
|
32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | + */ |
|
34 | + public function title(): string |
|
35 | + { |
|
36 | + return I18N::translate('Text extender for source citations’ title'); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * {@inheritDoc} |
|
41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | - */ |
|
43 | - public function description(): string |
|
44 | - { |
|
45 | - return I18N::translate('Extends the title of source citations with additional text or icons.'); |
|
46 | - } |
|
39 | + /** |
|
40 | + * {@inheritDoc} |
|
41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | + */ |
|
43 | + public function description(): string |
|
44 | + { |
|
45 | + return I18N::translate('Extends the title of source citations with additional text or icons.'); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritDoc} |
|
50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | - */ |
|
52 | - public function hookInterface(): string |
|
53 | - { |
|
54 | - return FactSourceTextExtenderInterface::class; |
|
55 | - } |
|
48 | + /** |
|
49 | + * {@inheritDoc} |
|
50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | + */ |
|
52 | + public function hookInterface(): string |
|
53 | + { |
|
54 | + return FactSourceTextExtenderInterface::class; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * {@inheritDoc} |
|
59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourcePrepend() |
|
60 | - */ |
|
61 | - public function factSourcePrepend(Tree $tree, $fact): string |
|
62 | - { |
|
63 | - return $this->hooks() |
|
64 | - ->map( |
|
65 | - fn(FactSourceTextExtenderInterface $hook) => |
|
66 | - $hook->factSourcePrepend($tree, $fact) |
|
67 | - )->implode(''); |
|
68 | - } |
|
57 | + /** |
|
58 | + * {@inheritDoc} |
|
59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourcePrepend() |
|
60 | + */ |
|
61 | + public function factSourcePrepend(Tree $tree, $fact): string |
|
62 | + { |
|
63 | + return $this->hooks() |
|
64 | + ->map( |
|
65 | + fn(FactSourceTextExtenderInterface $hook) => |
|
66 | + $hook->factSourcePrepend($tree, $fact) |
|
67 | + )->implode(''); |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * {@inheritDoc} |
|
72 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourceAppend() |
|
73 | - */ |
|
74 | - public function factSourceAppend(Tree $tree, $fact): string |
|
75 | - { |
|
76 | - return $this->hooks() |
|
77 | - ->map( |
|
78 | - fn(FactSourceTextExtenderInterface $hook) => |
|
79 | - $hook->factSourcePrepend($tree, $fact) |
|
80 | - )->implode(''); |
|
81 | - } |
|
70 | + /** |
|
71 | + * {@inheritDoc} |
|
72 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourceAppend() |
|
73 | + */ |
|
74 | + public function factSourceAppend(Tree $tree, $fact): string |
|
75 | + { |
|
76 | + return $this->hooks() |
|
77 | + ->map( |
|
78 | + fn(FactSourceTextExtenderInterface $hook) => |
|
79 | + $hook->factSourcePrepend($tree, $fact) |
|
80 | + )->implode(''); |
|
81 | + } |
|
82 | 82 | } |
@@ -25,45 +25,45 @@ |
||
25 | 25 | * @extends AbstractHookCollector<FamilyDatatablesExtenderInterface> |
26 | 26 | */ |
27 | 27 | class FamilyDatatablesExtenderCollector extends AbstractHookCollector implements |
28 | - FamilyDatatablesExtenderInterface |
|
28 | + FamilyDatatablesExtenderInterface |
|
29 | 29 | { |
30 | - /** |
|
31 | - * {@inheritDoc} |
|
32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | - */ |
|
34 | - public function title(): string |
|
35 | - { |
|
36 | - return I18N::translate('Columns extender for tables of families'); |
|
37 | - } |
|
30 | + /** |
|
31 | + * {@inheritDoc} |
|
32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | + */ |
|
34 | + public function title(): string |
|
35 | + { |
|
36 | + return I18N::translate('Columns extender for tables of families'); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * {@inheritDoc} |
|
41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | - */ |
|
43 | - public function description(): string |
|
44 | - { |
|
45 | - return I18N::translate('Add additional columns to tables of families'); |
|
46 | - } |
|
39 | + /** |
|
40 | + * {@inheritDoc} |
|
41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | + */ |
|
43 | + public function description(): string |
|
44 | + { |
|
45 | + return I18N::translate('Add additional columns to tables of families'); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritDoc} |
|
50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | - */ |
|
52 | - public function hookInterface(): string |
|
53 | - { |
|
54 | - return FamilyDatatablesExtenderInterface::class; |
|
55 | - } |
|
48 | + /** |
|
49 | + * {@inheritDoc} |
|
50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | + */ |
|
52 | + public function hookInterface(): string |
|
53 | + { |
|
54 | + return FamilyDatatablesExtenderInterface::class; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * {@inheritDoc} |
|
59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\FamilyDatatablesExtenderInterface::familyColumns() |
|
60 | - */ |
|
61 | - public function familyColumns(iterable $records): array |
|
62 | - { |
|
63 | - $result = []; |
|
64 | - foreach ($this->hooks() as $hook) { |
|
65 | - $result += $hook->familyColumns($records); |
|
66 | - } |
|
67 | - return $result; |
|
68 | - } |
|
57 | + /** |
|
58 | + * {@inheritDoc} |
|
59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\FamilyDatatablesExtenderInterface::familyColumns() |
|
60 | + */ |
|
61 | + public function familyColumns(iterable $records): array |
|
62 | + { |
|
63 | + $result = []; |
|
64 | + foreach ($this->hooks() as $hook) { |
|
65 | + $result += $hook->familyColumns($records); |
|
66 | + } |
|
67 | + return $result; |
|
68 | + } |
|
69 | 69 | } |
@@ -25,45 +25,45 @@ |
||
25 | 25 | * @extends AbstractHookCollector<IndividualDatatablesExtenderInterface> |
26 | 26 | */ |
27 | 27 | class IndividualDatatablesExtenderCollector extends AbstractHookCollector implements |
28 | - IndividualDatatablesExtenderInterface |
|
28 | + IndividualDatatablesExtenderInterface |
|
29 | 29 | { |
30 | - /** |
|
31 | - * {@inheritDoc} |
|
32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | - */ |
|
34 | - public function title(): string |
|
35 | - { |
|
36 | - return I18N::translate('Columns extender for tables of individuals'); |
|
37 | - } |
|
30 | + /** |
|
31 | + * {@inheritDoc} |
|
32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
33 | + */ |
|
34 | + public function title(): string |
|
35 | + { |
|
36 | + return I18N::translate('Columns extender for tables of individuals'); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * {@inheritDoc} |
|
41 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | - */ |
|
43 | - public function description(): string |
|
44 | - { |
|
45 | - return I18N::translate('Add additional columns to tables of individuals'); |
|
46 | - } |
|
39 | + /** |
|
40 | + * {@inheritDoc} |
|
41 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::description() |
|
42 | + */ |
|
43 | + public function description(): string |
|
44 | + { |
|
45 | + return I18N::translate('Add additional columns to tables of individuals'); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritDoc} |
|
50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | - */ |
|
52 | - public function hookInterface(): string |
|
53 | - { |
|
54 | - return IndividualDatatablesExtenderInterface::class; |
|
55 | - } |
|
48 | + /** |
|
49 | + * {@inheritDoc} |
|
50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
51 | + */ |
|
52 | + public function hookInterface(): string |
|
53 | + { |
|
54 | + return IndividualDatatablesExtenderInterface::class; |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * {@inheritDoc} |
|
59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\IndividualDatatablesExtenderInterface::individualColumns() |
|
60 | - */ |
|
61 | - public function individualColumns(iterable $records): array |
|
62 | - { |
|
63 | - $result = []; |
|
64 | - foreach ($this->hooks() as $hook) { |
|
65 | - $result += $hook->individualColumns($records); |
|
66 | - } |
|
67 | - return $result; |
|
68 | - } |
|
57 | + /** |
|
58 | + * {@inheritDoc} |
|
59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\IndividualDatatablesExtenderInterface::individualColumns() |
|
60 | + */ |
|
61 | + public function individualColumns(iterable $records): array |
|
62 | + { |
|
63 | + $result = []; |
|
64 | + foreach ($this->hooks() as $hook) { |
|
65 | + $result += $hook->individualColumns($records); |
|
66 | + } |
|
67 | + return $result; |
|
68 | + } |
|
69 | 69 | } |
@@ -21,13 +21,13 @@ |
||
21 | 21 | */ |
22 | 22 | class Migration0 implements MigrationInterface |
23 | 23 | { |
24 | - /** |
|
25 | - * {@inheritDoc} |
|
26 | - * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade() |
|
27 | - */ |
|
28 | - public function upgrade(): void |
|
29 | - { |
|
24 | + /** |
|
25 | + * {@inheritDoc} |
|
26 | + * @see \Fisharebest\Webtrees\Schema\MigrationInterface::upgrade() |
|
27 | + */ |
|
28 | + public function upgrade(): void |
|
29 | + { |
|
30 | 30 | |
31 | - // This migration has been superseded by migration 1. |
|
32 | - } |
|
31 | + // This migration has been superseded by migration 1. |
|
32 | + } |
|
33 | 33 | } |
@@ -29,44 +29,44 @@ |
||
29 | 29 | */ |
30 | 30 | class ModulesHooksPage implements RequestHandlerInterface |
31 | 31 | { |
32 | - use ViewResponseTrait; |
|
32 | + use ViewResponseTrait; |
|
33 | 33 | |
34 | - protected HookService $hook_service; |
|
34 | + protected HookService $hook_service; |
|
35 | 35 | |
36 | - /** |
|
37 | - * Constructor for ModulesHooksPage request handler |
|
38 | - * |
|
39 | - * @param HookService $hook_service |
|
40 | - */ |
|
41 | - public function __construct(HookService $hook_service) |
|
42 | - { |
|
43 | - $this->hook_service = $hook_service; |
|
44 | - } |
|
36 | + /** |
|
37 | + * Constructor for ModulesHooksPage request handler |
|
38 | + * |
|
39 | + * @param HookService $hook_service |
|
40 | + */ |
|
41 | + public function __construct(HookService $hook_service) |
|
42 | + { |
|
43 | + $this->hook_service = $hook_service; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * {@inheritDoc} |
|
48 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
49 | - */ |
|
50 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
51 | - { |
|
52 | - $this->layout = 'layouts/administration'; |
|
46 | + /** |
|
47 | + * {@inheritDoc} |
|
48 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
49 | + */ |
|
50 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
51 | + { |
|
52 | + $this->layout = 'layouts/administration'; |
|
53 | 53 | |
54 | - $hook_name = Validator::attributes($request)->string('hook_name', ''); |
|
55 | - $hook = $this->hook_service->find($hook_name, true); |
|
56 | - if ($hook === null) { |
|
57 | - throw new HttpNotFoundException(I18N::translate('The hook with name “%s” does not exist.', $hook_name)); |
|
58 | - } |
|
54 | + $hook_name = Validator::attributes($request)->string('hook_name', ''); |
|
55 | + $hook = $this->hook_service->find($hook_name, true); |
|
56 | + if ($hook === null) { |
|
57 | + throw new HttpNotFoundException(I18N::translate('The hook with name “%s” does not exist.', $hook_name)); |
|
58 | + } |
|
59 | 59 | |
60 | - $modules = $hook->hooks() |
|
61 | - ->sortKeys() |
|
62 | - ->mapWithKeys(fn(HookInterface $hook) => [$hook->module()->name() => $hook->module()]); |
|
60 | + $modules = $hook->hooks() |
|
61 | + ->sortKeys() |
|
62 | + ->mapWithKeys(fn(HookInterface $hook) => [$hook->module()->name() => $hook->module()]); |
|
63 | 63 | |
64 | - return $this->viewResponse('admin/components', [ |
|
65 | - 'description' => $hook->description(), |
|
66 | - 'modules' => $modules, |
|
67 | - 'title' => $hook->title(), |
|
68 | - 'uses_access' => false, |
|
69 | - 'uses_sorting' => true |
|
70 | - ]); |
|
71 | - } |
|
64 | + return $this->viewResponse('admin/components', [ |
|
65 | + 'description' => $hook->description(), |
|
66 | + 'modules' => $modules, |
|
67 | + 'title' => $hook->title(), |
|
68 | + 'uses_access' => false, |
|
69 | + 'uses_sorting' => true |
|
70 | + ]); |
|
71 | + } |
|
72 | 72 | } |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function loadRoutes(Map $router): void |
64 | 64 | { |
65 | - $router->attach('', '', static function (Map $router): void { |
|
65 | + $router->attach('', '', static function(Map $router): void { |
|
66 | 66 | |
67 | - $router->attach('', '/module-maj/welcomeblock/{block_id}', static function (Map $router): void { |
|
67 | + $router->attach('', '/module-maj/welcomeblock/{block_id}', static function(Map $router): void { |
|
68 | 68 | $router->tokens(['block_id' => '\d+']); |
69 | 69 | $router->get(MatomoStats::class, '/matomostats', MatomoStats::class); |
70 | 70 | }); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $fab_login_block_view = app(\Fisharebest\Webtrees\Module\LoginBlockModule::class) |
95 | 95 | ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED); |
96 | 96 | |
97 | - $content = view($this->name() . '::block-embed', [ |
|
97 | + $content = view($this->name().'::block-embed', [ |
|
98 | 98 | 'block_id' => $block_id, |
99 | 99 | 'fab_welcome_block_view' => $fab_welcome_block_view, |
100 | 100 | 'fab_login_block_view' => $fab_login_block_view, |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function editBlockConfiguration(Tree $tree, int $block_id): string |
132 | 132 | { |
133 | - return view($this->name() . '::config', $this->matomoSettings($block_id)); |
|
133 | + return view($this->name().'::config', $this->matomoSettings($block_id)); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | $this |
163 | 163 | ->setBlockSetting($block_id, 'matomo_url', $matomo_url) |
164 | 164 | ->setBlockSetting($block_id, 'matomo_token', $matomo_token) |
165 | - ->setBlockSetting($block_id, 'matomo_siteid', (string) $matomo_siteid); |
|
165 | + ->setBlockSetting($block_id, 'matomo_siteid', (string)$matomo_siteid); |
|
166 | 166 | |
167 | - Registry::cache()->file()->forget($this->name() . '-matomovisits-yearly-' . $block_id); |
|
167 | + Registry::cache()->file()->forget($this->name().'-matomovisits-yearly-'.$block_id); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | 'matomo_enabled' => $this->isMatomoEnabled($block_id), |
191 | 191 | 'matomo_url' => $this->getBlockSetting($block_id, 'matomo_url'), |
192 | 192 | 'matomo_token' => $this->getBlockSetting($block_id, 'matomo_token'), |
193 | - 'matomo_siteid' => (int) $this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
193 | + 'matomo_siteid' => (int)$this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
194 | 194 | ]; |
195 | 195 | } |
196 | 196 | } |
@@ -34,163 +34,163 @@ |
||
34 | 34 | */ |
35 | 35 | class WelcomeBlockModule extends AbstractModule implements ModuleMyArtJaubInterface, ModuleBlockInterface |
36 | 36 | { |
37 | - use ModuleMyArtJaubTrait; |
|
38 | - use ModuleBlockTrait; |
|
39 | - |
|
40 | - /** |
|
41 | - * {@inheritDoc} |
|
42 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::title() |
|
43 | - */ |
|
44 | - public function title(): string |
|
45 | - { |
|
46 | - return /* I18N: Name of the “WelcomeBlock” module */ I18N::translate('MyArtJaub Welcome Block'); |
|
47 | - } |
|
48 | - |
|
49 | - /** |
|
50 | - * {@inheritDoc} |
|
51 | - * @see \Fisharebest\Webtrees\Module\AbstractModule::description() |
|
52 | - */ |
|
53 | - public function description(): string |
|
54 | - { |
|
55 | - //phpcs:ignore Generic.Files.LineLength.TooLong |
|
56 | - return /* I18N: Description of the “WelcomeBlock” module */ I18N::translate('The MyArtJaub Welcome block welcomes the visitor to the site, allows a quick login to the site, and displays statistics on visits.'); |
|
57 | - } |
|
58 | - |
|
59 | - /** |
|
60 | - * {@inheritDoc} |
|
61 | - * @see \MyArtJaub\Webtrees\Module\ModuleMyArtJaubInterface::loadRoutes() |
|
62 | - */ |
|
63 | - public function loadRoutes(Map $router): void |
|
64 | - { |
|
65 | - $router->attach('', '', static function (Map $router): void { |
|
66 | - |
|
67 | - $router->attach('', '/module-maj/welcomeblock/{block_id}', static function (Map $router): void { |
|
68 | - $router->tokens(['block_id' => '\d+']); |
|
69 | - $router->get(MatomoStats::class, '/matomostats', MatomoStats::class); |
|
70 | - }); |
|
71 | - }); |
|
72 | - } |
|
73 | - |
|
74 | - /** |
|
75 | - * {@inheritDoc} |
|
76 | - * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion() |
|
77 | - */ |
|
78 | - public function customModuleVersion(): string |
|
79 | - { |
|
80 | - return '2.1.3-v.1'; |
|
81 | - } |
|
82 | - |
|
83 | - /** |
|
84 | - * {@inheritDoc} |
|
85 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::getBlock() |
|
86 | - * |
|
87 | - * @param mixed[] $config |
|
88 | - */ |
|
89 | - public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string |
|
90 | - { |
|
91 | - $fab_welcome_block_view = app(\Fisharebest\Webtrees\Module\WelcomeBlockModule::class) |
|
92 | - ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED); |
|
93 | - |
|
94 | - $fab_login_block_view = app(\Fisharebest\Webtrees\Module\LoginBlockModule::class) |
|
95 | - ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED); |
|
96 | - |
|
97 | - $content = view($this->name() . '::block-embed', [ |
|
98 | - 'block_id' => $block_id, |
|
99 | - 'fab_welcome_block_view' => $fab_welcome_block_view, |
|
100 | - 'fab_login_block_view' => $fab_login_block_view, |
|
101 | - 'matomo_enabled' => $this->isMatomoEnabled($block_id), |
|
102 | - 'js_script_url' => $this->assetUrl('js/welcomeblock.min.js') |
|
103 | - ]); |
|
104 | - |
|
105 | - if ($context !== self::CONTEXT_EMBED) { |
|
106 | - return view('modules/block-template', [ |
|
107 | - 'block' => Str::kebab($this->name()), |
|
108 | - 'id' => $block_id, |
|
109 | - 'config_url' => $this->configUrl($tree, $context, $block_id), |
|
110 | - 'title' => e($tree->title()), |
|
111 | - 'content' => $content, |
|
112 | - ]); |
|
113 | - } |
|
114 | - |
|
115 | - return $content; |
|
116 | - } |
|
117 | - |
|
118 | - /** |
|
119 | - * {@inheritDoc} |
|
120 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::isTreeBlock() |
|
121 | - */ |
|
122 | - public function isTreeBlock(): bool |
|
123 | - { |
|
124 | - return true; |
|
125 | - } |
|
126 | - |
|
127 | - /** |
|
128 | - * {@inheritDoc} |
|
129 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::editBlockConfiguration() |
|
130 | - */ |
|
131 | - public function editBlockConfiguration(Tree $tree, int $block_id): string |
|
132 | - { |
|
133 | - return view($this->name() . '::config', $this->matomoSettings($block_id)); |
|
134 | - } |
|
135 | - |
|
136 | - /** |
|
137 | - * {@inheritDoc} |
|
138 | - * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::saveBlockConfiguration() |
|
139 | - */ |
|
140 | - public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void |
|
141 | - { |
|
142 | - $matomo_enabled = Validator::parsedBody($request)->string('matomo_enabled', '') === 'yes'; |
|
143 | - $this->setBlockSetting($block_id, 'matomo_enabled', $matomo_enabled ? 'yes' : 'no'); |
|
144 | - if (!$matomo_enabled) { |
|
145 | - return; |
|
146 | - } |
|
147 | - |
|
148 | - $matomo_url = trim(Validator::parsedBody($request)->string('matomo_url', '')); |
|
149 | - if (filter_var($matomo_url, FILTER_VALIDATE_URL) === false) { |
|
150 | - FlashMessages::addMessage(I18N::translate('The Matomo URL provided is not valid.'), 'danger'); |
|
151 | - return; |
|
152 | - } |
|
153 | - |
|
154 | - $matomo_siteid = Validator::parsedBody($request)->integer('matomo_siteid', -1); |
|
155 | - if ($matomo_siteid === -1) { |
|
156 | - FlashMessages::addMessage(I18N::translate('The Matomo Site ID provided is not valid.'), 'danger'); |
|
157 | - return; |
|
158 | - } |
|
159 | - |
|
160 | - $matomo_token = trim(Validator::parsedBody($request)->string('matomo_token', '')); |
|
161 | - |
|
162 | - $this |
|
163 | - ->setBlockSetting($block_id, 'matomo_url', $matomo_url) |
|
164 | - ->setBlockSetting($block_id, 'matomo_token', $matomo_token) |
|
165 | - ->setBlockSetting($block_id, 'matomo_siteid', (string) $matomo_siteid); |
|
166 | - |
|
167 | - Registry::cache()->file()->forget($this->name() . '-matomovisits-yearly-' . $block_id); |
|
168 | - } |
|
169 | - |
|
170 | - /** |
|
171 | - * Returns whether Matomo statistics is enabled for a specific MyArtJaub WelcomeBlock block |
|
172 | - * |
|
173 | - * @param int $block_id |
|
174 | - * @return bool |
|
175 | - */ |
|
176 | - public function isMatomoEnabled(int $block_id): bool |
|
177 | - { |
|
178 | - return $this->getBlockSetting($block_id, 'matomo_enabled', 'no') === 'yes'; |
|
179 | - } |
|
180 | - |
|
181 | - /** |
|
182 | - * Returns settings for retrieving Matomo statistics for a specific MyArtJaub WelcomeBlock block |
|
183 | - * |
|
184 | - * @param int $block_id |
|
185 | - * @return array<string, mixed> |
|
186 | - */ |
|
187 | - public function matomoSettings(int $block_id): array |
|
188 | - { |
|
189 | - return [ |
|
190 | - 'matomo_enabled' => $this->isMatomoEnabled($block_id), |
|
191 | - 'matomo_url' => $this->getBlockSetting($block_id, 'matomo_url'), |
|
192 | - 'matomo_token' => $this->getBlockSetting($block_id, 'matomo_token'), |
|
193 | - 'matomo_siteid' => (int) $this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
194 | - ]; |
|
195 | - } |
|
37 | + use ModuleMyArtJaubTrait; |
|
38 | + use ModuleBlockTrait; |
|
39 | + |
|
40 | + /** |
|
41 | + * {@inheritDoc} |
|
42 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::title() |
|
43 | + */ |
|
44 | + public function title(): string |
|
45 | + { |
|
46 | + return /* I18N: Name of the “WelcomeBlock” module */ I18N::translate('MyArtJaub Welcome Block'); |
|
47 | + } |
|
48 | + |
|
49 | + /** |
|
50 | + * {@inheritDoc} |
|
51 | + * @see \Fisharebest\Webtrees\Module\AbstractModule::description() |
|
52 | + */ |
|
53 | + public function description(): string |
|
54 | + { |
|
55 | + //phpcs:ignore Generic.Files.LineLength.TooLong |
|
56 | + return /* I18N: Description of the “WelcomeBlock” module */ I18N::translate('The MyArtJaub Welcome block welcomes the visitor to the site, allows a quick login to the site, and displays statistics on visits.'); |
|
57 | + } |
|
58 | + |
|
59 | + /** |
|
60 | + * {@inheritDoc} |
|
61 | + * @see \MyArtJaub\Webtrees\Module\ModuleMyArtJaubInterface::loadRoutes() |
|
62 | + */ |
|
63 | + public function loadRoutes(Map $router): void |
|
64 | + { |
|
65 | + $router->attach('', '', static function (Map $router): void { |
|
66 | + |
|
67 | + $router->attach('', '/module-maj/welcomeblock/{block_id}', static function (Map $router): void { |
|
68 | + $router->tokens(['block_id' => '\d+']); |
|
69 | + $router->get(MatomoStats::class, '/matomostats', MatomoStats::class); |
|
70 | + }); |
|
71 | + }); |
|
72 | + } |
|
73 | + |
|
74 | + /** |
|
75 | + * {@inheritDoc} |
|
76 | + * @see \Fisharebest\Webtrees\Module\ModuleCustomInterface::customModuleVersion() |
|
77 | + */ |
|
78 | + public function customModuleVersion(): string |
|
79 | + { |
|
80 | + return '2.1.3-v.1'; |
|
81 | + } |
|
82 | + |
|
83 | + /** |
|
84 | + * {@inheritDoc} |
|
85 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::getBlock() |
|
86 | + * |
|
87 | + * @param mixed[] $config |
|
88 | + */ |
|
89 | + public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string |
|
90 | + { |
|
91 | + $fab_welcome_block_view = app(\Fisharebest\Webtrees\Module\WelcomeBlockModule::class) |
|
92 | + ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED); |
|
93 | + |
|
94 | + $fab_login_block_view = app(\Fisharebest\Webtrees\Module\LoginBlockModule::class) |
|
95 | + ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED); |
|
96 | + |
|
97 | + $content = view($this->name() . '::block-embed', [ |
|
98 | + 'block_id' => $block_id, |
|
99 | + 'fab_welcome_block_view' => $fab_welcome_block_view, |
|
100 | + 'fab_login_block_view' => $fab_login_block_view, |
|
101 | + 'matomo_enabled' => $this->isMatomoEnabled($block_id), |
|
102 | + 'js_script_url' => $this->assetUrl('js/welcomeblock.min.js') |
|
103 | + ]); |
|
104 | + |
|
105 | + if ($context !== self::CONTEXT_EMBED) { |
|
106 | + return view('modules/block-template', [ |
|
107 | + 'block' => Str::kebab($this->name()), |
|
108 | + 'id' => $block_id, |
|
109 | + 'config_url' => $this->configUrl($tree, $context, $block_id), |
|
110 | + 'title' => e($tree->title()), |
|
111 | + 'content' => $content, |
|
112 | + ]); |
|
113 | + } |
|
114 | + |
|
115 | + return $content; |
|
116 | + } |
|
117 | + |
|
118 | + /** |
|
119 | + * {@inheritDoc} |
|
120 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::isTreeBlock() |
|
121 | + */ |
|
122 | + public function isTreeBlock(): bool |
|
123 | + { |
|
124 | + return true; |
|
125 | + } |
|
126 | + |
|
127 | + /** |
|
128 | + * {@inheritDoc} |
|
129 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::editBlockConfiguration() |
|
130 | + */ |
|
131 | + public function editBlockConfiguration(Tree $tree, int $block_id): string |
|
132 | + { |
|
133 | + return view($this->name() . '::config', $this->matomoSettings($block_id)); |
|
134 | + } |
|
135 | + |
|
136 | + /** |
|
137 | + * {@inheritDoc} |
|
138 | + * @see \Fisharebest\Webtrees\Module\ModuleBlockInterface::saveBlockConfiguration() |
|
139 | + */ |
|
140 | + public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void |
|
141 | + { |
|
142 | + $matomo_enabled = Validator::parsedBody($request)->string('matomo_enabled', '') === 'yes'; |
|
143 | + $this->setBlockSetting($block_id, 'matomo_enabled', $matomo_enabled ? 'yes' : 'no'); |
|
144 | + if (!$matomo_enabled) { |
|
145 | + return; |
|
146 | + } |
|
147 | + |
|
148 | + $matomo_url = trim(Validator::parsedBody($request)->string('matomo_url', '')); |
|
149 | + if (filter_var($matomo_url, FILTER_VALIDATE_URL) === false) { |
|
150 | + FlashMessages::addMessage(I18N::translate('The Matomo URL provided is not valid.'), 'danger'); |
|
151 | + return; |
|
152 | + } |
|
153 | + |
|
154 | + $matomo_siteid = Validator::parsedBody($request)->integer('matomo_siteid', -1); |
|
155 | + if ($matomo_siteid === -1) { |
|
156 | + FlashMessages::addMessage(I18N::translate('The Matomo Site ID provided is not valid.'), 'danger'); |
|
157 | + return; |
|
158 | + } |
|
159 | + |
|
160 | + $matomo_token = trim(Validator::parsedBody($request)->string('matomo_token', '')); |
|
161 | + |
|
162 | + $this |
|
163 | + ->setBlockSetting($block_id, 'matomo_url', $matomo_url) |
|
164 | + ->setBlockSetting($block_id, 'matomo_token', $matomo_token) |
|
165 | + ->setBlockSetting($block_id, 'matomo_siteid', (string) $matomo_siteid); |
|
166 | + |
|
167 | + Registry::cache()->file()->forget($this->name() . '-matomovisits-yearly-' . $block_id); |
|
168 | + } |
|
169 | + |
|
170 | + /** |
|
171 | + * Returns whether Matomo statistics is enabled for a specific MyArtJaub WelcomeBlock block |
|
172 | + * |
|
173 | + * @param int $block_id |
|
174 | + * @return bool |
|
175 | + */ |
|
176 | + public function isMatomoEnabled(int $block_id): bool |
|
177 | + { |
|
178 | + return $this->getBlockSetting($block_id, 'matomo_enabled', 'no') === 'yes'; |
|
179 | + } |
|
180 | + |
|
181 | + /** |
|
182 | + * Returns settings for retrieving Matomo statistics for a specific MyArtJaub WelcomeBlock block |
|
183 | + * |
|
184 | + * @param int $block_id |
|
185 | + * @return array<string, mixed> |
|
186 | + */ |
|
187 | + public function matomoSettings(int $block_id): array |
|
188 | + { |
|
189 | + return [ |
|
190 | + 'matomo_enabled' => $this->isMatomoEnabled($block_id), |
|
191 | + 'matomo_url' => $this->getBlockSetting($block_id, 'matomo_url'), |
|
192 | + 'matomo_token' => $this->getBlockSetting($block_id, 'matomo_token'), |
|
193 | + 'matomo_siteid' => (int) $this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
194 | + ]; |
|
195 | + } |
|
196 | 196 | } |