From 090bea5a4f8814a9e450856308a693411b012e26 Mon Sep 17 00:00:00 2001 From: Praesidiarius Date: Fri, 6 Mar 2020 00:57:08 +0100 Subject: [PATCH] translate title --- .../Application/src/Controller/CoreApiController.php | 10 ++++++++++ module/Application/src/Controller/CoreController.php | 2 ++ .../src/Controller/CoreEntityController.php | 2 -- module/Application/view/partial/formheader.phtml | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/module/Application/src/Controller/CoreApiController.php b/module/Application/src/Controller/CoreApiController.php index bb8be3d..8b7d29c 100644 --- a/module/Application/src/Controller/CoreApiController.php +++ b/module/Application/src/Controller/CoreApiController.php @@ -225,6 +225,8 @@ public function listAction() { } break; case 'text': + case 'currency': + case 'number': case 'date': case 'textarea': $aPublicItem[$oField->fieldkey] = $translator->translate($oItem->getTextField($oField->fieldkey),$sEntityType,$sLang); @@ -256,6 +258,14 @@ public function listAction() { } } + if (array_key_exists($this->sSingleForm.'-api-list-before',CoreEntityController::$aEntityHooks)) { + foreach(CoreEntityController::$aEntityHooks[$this->sSingleForm.'-api-list-before'] as $oHook) { + $sHookFunc = $oHook->sFunction; + $aCustomData = $oHook->oItem->$sHookFunc($oItem); + $aPublicItem = array_merge($aPublicItem,$aCustomData); + } + } + # add item to list $aItems[] = $aPublicItem; } diff --git a/module/Application/src/Controller/CoreController.php b/module/Application/src/Controller/CoreController.php index a8cbd19..6ba7ac3 100644 --- a/module/Application/src/Controller/CoreController.php +++ b/module/Application/src/Controller/CoreController.php @@ -31,6 +31,8 @@ use Laminas\Mime\Part as MimePart; class CoreController extends AbstractActionController { + protected static $aEntityHooks = []; + /** * onePlace Session Object * diff --git a/module/Application/src/Controller/CoreEntityController.php b/module/Application/src/Controller/CoreEntityController.php index 8cfcf03..cf0f33d 100644 --- a/module/Application/src/Controller/CoreEntityController.php +++ b/module/Application/src/Controller/CoreEntityController.php @@ -30,8 +30,6 @@ use Laminas\Mime\Part as MimePart; class CoreEntityController extends CoreController { - private static $aEntityHooks = []; - /** * CoreEntityController constructor. * diff --git a/module/Application/view/partial/formheader.phtml b/module/Application/view/partial/formheader.phtml index 86feeee..184b815 100644 --- a/module/Application/view/partial/formheader.phtml +++ b/module/Application/view/partial/formheader.phtml @@ -1,3 +1,3 @@ -

sTitle?>

\ No newline at end of file +

translate($this->sTitle)?>

\ No newline at end of file