Skip to content
Snippets Groups Projects
Commit 7ddd5009 authored by Dorian Merz's avatar Dorian Merz
Browse files

refs #18962 [finc] enable local scope notes for AMSL sources

parent 0a11e662
Branches
Tags
No related merge requests found
......@@ -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 = '')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment