Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchy tree entity encoding. #8

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions themes/blueprint/js/hierarchyTree_JSTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -268,4 +268,26 @@ $(document).ready(function()
doTreeSearch();
}
});
});
});

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['<'] = '&lt;';

for (symbol in hash_map) {
entity = hash_map[symbol];
tmp_str = tmp_str.split(entity).join(symbol);
}
tmp_str = tmp_str.split('&#039;').join("'");

return tmp_str;
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<? if ($collectionRecord === null): ?>
<?=$this->render('collection/collection-record-error.phtml')?>
<? else: ?>
<?=$this->record($collectionRecord)->getCollectionBriefRecord()?>
<?=html_entity_decode($this->record($collectionRecord)->getCollectionBriefRecord())?>
<? endif; ?>
<? endif; ?>
</div>
Expand Down