Skip to content

Commit

Permalink
translate title
Browse files Browse the repository at this point in the history
  • Loading branch information
Praesidiarius committed Mar 5, 2020
1 parent 0610d63 commit 090bea5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions module/Application/src/Controller/CoreApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions module/Application/src/Controller/CoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
use Laminas\Mime\Part as MimePart;

class CoreController extends AbstractActionController {
protected static $aEntityHooks = [];

/**
* onePlace Session Object
*
Expand Down
2 changes: 0 additions & 2 deletions module/Application/src/Controller/CoreEntityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
use Laminas\Mime\Part as MimePart;

class CoreEntityController extends CoreController {
private static $aEntityHooks = [];

/**
* CoreEntityController constructor.
*
Expand Down
2 changes: 1 addition & 1 deletion module/Application/view/partial/formheader.phtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
?>
<h2><i><?=$this->sTitle?></i></h2>
<h2><i><?=$this->translate($this->sTitle)?></i></h2>

0 comments on commit 090bea5

Please sign in to comment.