+
{if is_array($record.title)}
{foreach from=$record.title item=title}
@@ -50,13 +50,13 @@ FIREBIRD TODOS:
{if $record.title2}
- {$record.title2|truncate:180:"..."|highlight:$lookfor}
+ {$record.title2|truncate:180:"..."|highlight:$lookfor}
{/if}
{if $record.vtitle}
- {$record.vtitle}
+ {$record.vtitle}
{/if}
@@ -73,10 +73,10 @@ FIREBIRD TODOS:
Author
{if is_array($record.author)}
{foreach from=$record.author item=author}
-
{$author|highlight:$lookfor}
+
{$author|highlight:$lookfor}
{/foreach}
{else}
-
{$record.author|highlight:$lookfor}
+
{$record.author|highlight:$lookfor}
{/if}
{/if}
diff --git a/services/Record/RecordUtils.php b/services/Record/RecordUtils.php
index 9108b61a..ae8107c4 100644
--- a/services/Record/RecordUtils.php
+++ b/services/Record/RecordUtils.php
@@ -43,6 +43,8 @@ class RecordUtils {
'wu' => 'WISC'
);
+ private $lang_codes;
+
// Get all 974s
function ht_fields($marc) {
return $marc->getFields('974');
@@ -245,6 +247,7 @@ function is_open_to_no_one($rcodes) {
function __construct() {
global $configArray;
+ $this->lang_codes = yaml_parse_file('conf/langCodes.yaml')['lang_codes'];
}
function getMarcRecord($record) {
@@ -504,6 +507,15 @@ function getSummaryAndContentAdvice($marc) {
}
return $data;
}
+
+ function getHtmlLang($record) {
+ $lang = $record['language008'];
+ if(array_key_exists($lang,$this->lang_codes)) {
+ $lang = $this->lang_codes[$lang];
+ }
+ return $lang;
+ }
+
}
?>
diff --git a/services/Search/Home.php b/services/Search/Home.php
index bf311e25..18c10f42 100644
--- a/services/Search/Home.php
+++ b/services/Search/Home.php
@@ -408,11 +408,10 @@ function search()
$marcRecord = $ru->getMarcRecord($record);
$result['record'][$num]['marc'] = $marcRecord;
$result['record'][$num]['title'] = $ru->getFullTitle($marcRecord);
+ $result['record'][$num]['html_lang'] = $ru->getHtmlLang($record);
$result['record'][$num]['googleLinks'] = implode(",", $ru->getLinkNums($marcRecord));
$url_list[$record['id']] = $ru->getURLs($marcRecord);
$id = $record['id'];
-
-
}