@@ -27,41 +27,41 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | class NameAccordionExtenderCollector extends AbstractHookCollector implements NameAccordionExtenderInterface |
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * {@inheritDoc} |
|
| 32 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | - */ |
|
| 34 | - public function title(): string |
|
| 35 | - { |
|
| 36 | - return I18N::translate('Individual names accordion extender'); |
|
| 37 | - } |
|
| 30 | + /** |
|
| 31 | + * {@inheritDoc} |
|
| 32 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::title() |
|
| 33 | + */ |
|
| 34 | + public function title(): string |
|
| 35 | + { |
|
| 36 | + return I18N::translate('Individual names accordion extender'); |
|
| 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 names accordion of on an individual’s page.'); |
|
| 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 names accordion of on an individual’s page.'); |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * {@inheritDoc} |
|
| 50 | - * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | - */ |
|
| 52 | - public function hookInterface(): string |
|
| 53 | - { |
|
| 54 | - return NameAccordionExtenderInterface::class; |
|
| 55 | - } |
|
| 48 | + /** |
|
| 49 | + * {@inheritDoc} |
|
| 50 | + * @see \MyArtJaub\Webtrees\Common\Hooks\AbstractHookCollector::hookInterface() |
|
| 51 | + */ |
|
| 52 | + public function hookInterface(): string |
|
| 53 | + { |
|
| 54 | + return NameAccordionExtenderInterface::class; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * {@inheritDoc} |
|
| 59 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\NameAccordionExtenderInterface::accordionCard() |
|
| 60 | - */ |
|
| 61 | - public function accordionCard(Individual $individual): string |
|
| 62 | - { |
|
| 63 | - return $this->hooks() |
|
| 64 | - ->map(fn(NameAccordionExtenderInterface $hook) => $hook->accordionCard($individual)) |
|
| 65 | - ->implode(''); |
|
| 66 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\NameAccordionExtenderInterface::accordionCard() |
|
| 60 | + */ |
|
| 61 | + public function accordionCard(Individual $individual): string |
|
| 62 | + { |
|
| 63 | + return $this->hooks() |
|
| 64 | + ->map(fn(NameAccordionExtenderInterface $hook) => $hook->accordionCard($individual)) |
|
| 65 | + ->implode(''); |
|
| 66 | + } |
|
| 67 | 67 | } |
@@ -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 = array_merge($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 = array_merge($result, $hook->sosaFamilyColumns($records)); |
|
| 66 | + } |
|
| 67 | + return $result; |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -27,52 +27,52 @@ |
||
| 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, string $source_record, int $level): string |
|
| 62 | - { |
|
| 63 | - return $this->hooks() |
|
| 64 | - ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 65 | - ->implode(''); |
|
| 66 | - } |
|
| 57 | + /** |
|
| 58 | + * {@inheritDoc} |
|
| 59 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourcePrepend() |
|
| 60 | + */ |
|
| 61 | + public function factSourcePrepend(Tree $tree, string $source_record, int $level): string |
|
| 62 | + { |
|
| 63 | + return $this->hooks() |
|
| 64 | + ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 65 | + ->implode(''); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * {@inheritDoc} |
|
| 70 | - * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourceAppend() |
|
| 71 | - */ |
|
| 72 | - public function factSourceAppend(Tree $tree, string $source_record, int $level): string |
|
| 73 | - { |
|
| 74 | - return $this->hooks() |
|
| 75 | - ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 76 | - ->implode(''); |
|
| 77 | - } |
|
| 68 | + /** |
|
| 69 | + * {@inheritDoc} |
|
| 70 | + * @see \MyArtJaub\Webtrees\Contracts\Hooks\FactSourceTextExtenderInterface::factSourceAppend() |
|
| 71 | + */ |
|
| 72 | + public function factSourceAppend(Tree $tree, string $source_record, int $level): string |
|
| 73 | + { |
|
| 74 | + return $this->hooks() |
|
| 75 | + ->map(fn(FactSourceTextExtenderInterface $hook) => $hook->factSourcePrepend($tree, $source_record, $level)) |
|
| 76 | + ->implode(''); |
|
| 77 | + } |
|
| 78 | 78 | } |
@@ -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 = array_merge($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 = array_merge($result, $hook->individualColumns($records)); |
|
| 66 | + } |
|
| 67 | + return $result; |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -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 = array_merge($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 = array_merge($result, $hook->sosaMissingColumns($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 = array_merge($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 = array_merge($result, $hook->sosaIndividualColumns($records)); |
|
| 66 | + } |
|
| 67 | + return $result; |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -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 = array_merge($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 = array_merge($result, $hook->familyColumns($records)); |
|
| 66 | + } |
|
| 67 | + return $result; |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -29,61 +29,61 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | class ModulesHooksAction extends AbstractModuleComponentAction |
| 31 | 31 | { |
| 32 | - protected HookService $hook_service; |
|
| 32 | + protected HookService $hook_service; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Constructor for ModulesHooksAction Request Handler |
|
| 36 | - * |
|
| 37 | - * @param ModuleService $module_service |
|
| 38 | - * @param TreeService $tree_service |
|
| 39 | - * @param HookService $hook_service |
|
| 40 | - */ |
|
| 41 | - public function __construct(ModuleService $module_service, TreeService $tree_service, HookService $hook_service) |
|
| 42 | - { |
|
| 43 | - parent::__construct($module_service, $tree_service); |
|
| 44 | - $this->hook_service = $hook_service; |
|
| 45 | - } |
|
| 34 | + /** |
|
| 35 | + * Constructor for ModulesHooksAction Request Handler |
|
| 36 | + * |
|
| 37 | + * @param ModuleService $module_service |
|
| 38 | + * @param TreeService $tree_service |
|
| 39 | + * @param HookService $hook_service |
|
| 40 | + */ |
|
| 41 | + public function __construct(ModuleService $module_service, TreeService $tree_service, HookService $hook_service) |
|
| 42 | + { |
|
| 43 | + parent::__construct($module_service, $tree_service); |
|
| 44 | + $this->hook_service = $hook_service; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * {@inheritDoc} |
|
| 49 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
| 50 | - */ |
|
| 51 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
| 52 | - { |
|
| 53 | - $hook_name = $request->getAttribute('hook_name'); |
|
| 54 | - $hook_collector = $this->hook_service->find($hook_name, true); |
|
| 55 | - if ($hook_collector === null) { |
|
| 56 | - FlashMessages::addMessage(I18N::translate('The hook with name “%s” does not exist.', $hook_name), 'danger'); |
|
| 57 | - return redirect(AdminConfigPage::class); |
|
| 58 | - } |
|
| 47 | + /** |
|
| 48 | + * {@inheritDoc} |
|
| 49 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
| 50 | + */ |
|
| 51 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
| 52 | + { |
|
| 53 | + $hook_name = $request->getAttribute('hook_name'); |
|
| 54 | + $hook_collector = $this->hook_service->find($hook_name, true); |
|
| 55 | + if ($hook_collector === null) { |
|
| 56 | + FlashMessages::addMessage(I18N::translate('The hook with name “%s” does not exist.', $hook_name), 'danger'); |
|
| 57 | + return redirect(AdminConfigPage::class); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - foreach ($hook_collector->hooks() as $hook) { |
|
| 61 | - $this->updateStatus(get_class($hook->module()), $request); |
|
| 62 | - } |
|
| 60 | + foreach ($hook_collector->hooks() as $hook) { |
|
| 61 | + $this->updateStatus(get_class($hook->module()), $request); |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - $this->updateHookOrder($hook_collector, $request); |
|
| 64 | + $this->updateHookOrder($hook_collector, $request); |
|
| 65 | 65 | |
| 66 | - FlashMessages::addMessage(I18N::translate('The hook preferences have been updated.'), 'success'); |
|
| 66 | + FlashMessages::addMessage(I18N::translate('The hook preferences have been updated.'), 'success'); |
|
| 67 | 67 | |
| 68 | - return redirect(route(ModulesHooksPage::class, ['hook_name' => $hook_name])); |
|
| 69 | - } |
|
| 68 | + return redirect(route(ModulesHooksPage::class, ['hook_name' => $hook_name])); |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Update the order of modules for a hook interface. |
|
| 73 | - * |
|
| 74 | - * @template THook of \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface |
|
| 75 | - * @param HookCollectorInterface<THook> $hook_collector |
|
| 76 | - * @param ServerRequestInterface $request |
|
| 77 | - */ |
|
| 78 | - protected function updateHookOrder(HookCollectorInterface $hook_collector, ServerRequestInterface $request): void |
|
| 79 | - { |
|
| 80 | - $params = (array) $request->getParsedBody(); |
|
| 71 | + /** |
|
| 72 | + * Update the order of modules for a hook interface. |
|
| 73 | + * |
|
| 74 | + * @template THook of \MyArtJaub\Webtrees\Contracts\Hooks\HookInterface |
|
| 75 | + * @param HookCollectorInterface<THook> $hook_collector |
|
| 76 | + * @param ServerRequestInterface $request |
|
| 77 | + */ |
|
| 78 | + protected function updateHookOrder(HookCollectorInterface $hook_collector, ServerRequestInterface $request): void |
|
| 79 | + { |
|
| 80 | + $params = (array) $request->getParsedBody(); |
|
| 81 | 81 | |
| 82 | - $order = (array) ($params['order'] ?? []); |
|
| 83 | - $order = array_flip($order); |
|
| 82 | + $order = (array) ($params['order'] ?? []); |
|
| 83 | + $order = array_flip($order); |
|
| 84 | 84 | |
| 85 | - foreach ($hook_collector->hooks() as $hook) { |
|
| 86 | - $this->hook_service->updateOrder($hook_collector, $hook->module(), $order[$hook->module()->name()] ?? 0); |
|
| 87 | - } |
|
| 88 | - } |
|
| 85 | + foreach ($hook_collector->hooks() as $hook) { |
|
| 86 | + $this->hook_service->updateOrder($hook_collector, $hook->module(), $order[$hook->module()->name()] ?? 0); |
|
| 87 | + } |
|
| 88 | + } |
|
| 89 | 89 | } |
@@ -77,9 +77,9 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | protected function updateHookOrder(HookCollectorInterface $hook_collector, ServerRequestInterface $request): void |
| 79 | 79 | { |
| 80 | - $params = (array) $request->getParsedBody(); |
|
| 80 | + $params = (array)$request->getParsedBody(); |
|
| 81 | 81 | |
| 82 | - $order = (array) ($params['order'] ?? []); |
|
| 82 | + $order = (array)($params['order'] ?? []); |
|
| 83 | 83 | $order = array_flip($order); |
| 84 | 84 | |
| 85 | 85 | foreach ($hook_collector->hooks() as $hook) { |
@@ -28,44 +28,44 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | class ModulesHooksPage implements RequestHandlerInterface |
| 30 | 30 | { |
| 31 | - use ViewResponseTrait; |
|
| 31 | + use ViewResponseTrait; |
|
| 32 | 32 | |
| 33 | - protected HookService $hook_service; |
|
| 33 | + protected HookService $hook_service; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Constructor for ModulesHooksPage request handler |
|
| 37 | - * |
|
| 38 | - * @param HookService $hook_service |
|
| 39 | - */ |
|
| 40 | - public function __construct(HookService $hook_service) |
|
| 41 | - { |
|
| 42 | - $this->hook_service = $hook_service; |
|
| 43 | - } |
|
| 35 | + /** |
|
| 36 | + * Constructor for ModulesHooksPage request handler |
|
| 37 | + * |
|
| 38 | + * @param HookService $hook_service |
|
| 39 | + */ |
|
| 40 | + public function __construct(HookService $hook_service) |
|
| 41 | + { |
|
| 42 | + $this->hook_service = $hook_service; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * {@inheritDoc} |
|
| 47 | - * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
| 48 | - */ |
|
| 49 | - public function handle(ServerRequestInterface $request): ResponseInterface |
|
| 50 | - { |
|
| 51 | - $this->layout = 'layouts/administration'; |
|
| 45 | + /** |
|
| 46 | + * {@inheritDoc} |
|
| 47 | + * @see \Psr\Http\Server\RequestHandlerInterface::handle() |
|
| 48 | + */ |
|
| 49 | + public function handle(ServerRequestInterface $request): ResponseInterface |
|
| 50 | + { |
|
| 51 | + $this->layout = 'layouts/administration'; |
|
| 52 | 52 | |
| 53 | - $hook_name = $request->getAttribute('hook_name'); |
|
| 54 | - $hook = $this->hook_service->find($hook_name, true); |
|
| 55 | - if ($hook === null) { |
|
| 56 | - throw new HttpNotFoundException(I18N::translate('The hook with name “%s” does not exist.', $hook_name)); |
|
| 57 | - } |
|
| 53 | + $hook_name = $request->getAttribute('hook_name'); |
|
| 54 | + $hook = $this->hook_service->find($hook_name, true); |
|
| 55 | + if ($hook === null) { |
|
| 56 | + throw new HttpNotFoundException(I18N::translate('The hook with name “%s” does not exist.', $hook_name)); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - $modules = $hook->hooks() |
|
| 60 | - ->sortKeys() |
|
| 61 | - ->mapWithKeys(fn(HookInterface $hook) => [$hook->module()->name() => $hook->module()]); |
|
| 59 | + $modules = $hook->hooks() |
|
| 60 | + ->sortKeys() |
|
| 61 | + ->mapWithKeys(fn(HookInterface $hook) => [$hook->module()->name() => $hook->module()]); |
|
| 62 | 62 | |
| 63 | - return $this->viewResponse('admin/components', [ |
|
| 64 | - 'description' => $hook->description(), |
|
| 65 | - 'modules' => $modules, |
|
| 66 | - 'title' => $hook->title(), |
|
| 67 | - 'uses_access' => false, |
|
| 68 | - 'uses_sorting' => true |
|
| 69 | - ]); |
|
| 70 | - } |
|
| 63 | + return $this->viewResponse('admin/components', [ |
|
| 64 | + 'description' => $hook->description(), |
|
| 65 | + 'modules' => $modules, |
|
| 66 | + 'title' => $hook->title(), |
|
| 67 | + 'uses_access' => false, |
|
| 68 | + 'uses_sorting' => true |
|
| 69 | + ]); |
|
| 70 | + } |
|
| 71 | 71 | } |