From ea6ed249b3ba7b41797cdaf8369bd16ce491b0da Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Aug 2013 12:15:00 -0400 Subject: [PATCH] Hierarchy tree entity encoding. --- themes/blueprint/js/hierarchyTree_JSTree.js | 26 +++++++++++++++++-- .../RecordTab/collectionhierarchytree.phtml | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/themes/blueprint/js/hierarchyTree_JSTree.js b/themes/blueprint/js/hierarchyTree_JSTree.js index 8215c69ea43..f9bcc91f398 100644 --- a/themes/blueprint/js/hierarchyTree_JSTree.js +++ b/themes/blueprint/js/hierarchyTree_JSTree.js @@ -15,7 +15,7 @@ function getRecord(recordID) dataType: 'html', success: function(response) { if (response) { - $('#hierarchyRecord').html(response); + $('#hierarchyRecord').html(html_entity_decode(response)); // Remove the old path highlighting $('#hierarchyTree a').removeClass("jstree-highlight"); // Add Current path highlighting @@ -268,4 +268,26 @@ $(document).ready(function() doTreeSearch(); } }); -}); \ No newline at end of file +}); + +function html_entity_decode(string, quote_style) { + var hash_map = {}, + symbol = '', + tmp_str = '', + entity = ''; + tmp_str = string.toString(); + + delete(hash_map['&']); + hash_map['&'] = '&'; + hash_map['>'] = '>'; + hash_map['<'] = '<'; + + for (symbol in hash_map) { + entity = hash_map[symbol]; + tmp_str = tmp_str.split(entity).join(symbol); + } + tmp_str = tmp_str.split(''').join("'"); + + return tmp_str; +} + diff --git a/themes/blueprint/templates/RecordTab/collectionhierarchytree.phtml b/themes/blueprint/templates/RecordTab/collectionhierarchytree.phtml index 63084987769..0bd798160c3 100644 --- a/themes/blueprint/templates/RecordTab/collectionhierarchytree.phtml +++ b/themes/blueprint/templates/RecordTab/collectionhierarchytree.phtml @@ -10,7 +10,7 @@ render('collection/collection-record-error.phtml')?> - record($collectionRecord)->getCollectionBriefRecord()?> + record($collectionRecord)->getCollectionBriefRecord())?>