diff --git a/module/finc/src/finc/Controller/AmslResourceController.php b/module/finc/src/finc/Controller/AmslResourceController.php index 70b355af1c1ea1dcb7b677d446e24695cee7fa39..07348329e9d5ef9032901c435e1b8022978416b5 100644 --- a/module/finc/src/finc/Controller/AmslResourceController.php +++ b/module/finc/src/finc/Controller/AmslResourceController.php @@ -124,7 +124,7 @@ class AmslResourceController extends AbstractBase ); } $rendered = $this->getViewRenderer()->render($view); - $this->setCacheData($rendered,'rendered'); + $this->setCacheData($rendered, 'rendered'); $view->rendered_html = $rendered; } @@ -154,7 +154,7 @@ class AmslResourceController extends AbstractBase ); break; } - + if (isset($amsl_sources)) { $results = $this->createSourceHierarchy($amsl_sources); } @@ -244,11 +244,23 @@ class AmslResourceController extends AbstractBase { $mapping = $this->config->get('Mapping'); - if (isset($mapping->sub_description_key) && isset($source[$mapping->sub_description_key])) { - if (!empty($mapping->show_description)) { + $showDescription = $mapping->show_description ?? false; + switch($showDescription) { + case 1: + case 'true': + case 'api': + if (isset($mapping->sub_description_key) && isset($source[$mapping->sub_description_key])) { $source["desc"] = $source[$mapping->sub_description_key]; + unset($source[$mapping->sub_description_key]); } - unset($source[$mapping->sub_description_key]); + break; + case 'local': + $source['desc'] = $this->translate('AMSLScopeNotes::'.$source[$mapping->sub_key], [], ''); + break; + case 0: + case 'false': + default: + // do nothing } if(!empty($mapping->show_link) && !empty($source[$mapping->sub_key])) { @@ -296,8 +308,8 @@ class AmslResourceController extends AbstractBase /** * Helper function for writing data to controller specific cache * - * @param string $value Cache value to write - * @param string $tag optional tag to be used for cache key + * @param string $value Cache value to write + * @param string $tag optional tag to be used for cache key * @throws \Exception */ private function setCacheData($value, $tag = '') @@ -320,7 +332,7 @@ class AmslResourceController extends AbstractBase /** * Helper function to generate config-specific cache key * - * @param string $tag optional tag to make cache more specific + * @param string $tag optional tag to make cache more specific * @return string */ protected function getCacheKey($tag = '')