allow html inside app descriptions

This commit is contained in:
Robin Appelman 2012-08-30 22:17:54 +02:00
parent 7027742bd6
commit b5234a4f34
3 changed files with 8 additions and 5 deletions

View File

@ -437,6 +437,9 @@ class OC_App{
foreach($child->children() as $type){ foreach($child->children() as $type){
$data['types'][]=$type->getName(); $data['types'][]=$type->getName();
} }
}elseif($child->getName()=='description'){
$xml=(string)$child->asXML();
$data[$child->getName()]=substr($xml,13,-14);//script <description> tags
}else{ }else{
$data[$child->getName()]=(string)$child; $data[$child->getName()]=(string)$child;
} }

View File

@ -29,7 +29,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
} else { } else {
page.find('span.version').text(''); page.find('span.version').text('');
} }
page.find('p.description').text(app.description); page.find('p.description').html(app.description);
page.find('img.preview').attr('src', app.preview); page.find('img.preview').attr('src', app.preview);
page.find('small.externalapp').attr('style', 'visibility:visible'); page.find('small.externalapp').attr('style', 'visibility:visible');
page.find('span.author').text(app.author); page.find('span.author').text(app.author);
@ -100,7 +100,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
$(document).ready(function(){ $(document).ready(function(){
$('#leftcontent li').each(function(index,li){ $('#leftcontent li').each(function(index,li){
var app = $.parseJSON($(this).children('span').text()); var app = OC.get('appData_'+$(li).data('id'));
$(li).data('app',app); $(li).data('app',app);
$(this).find('span.hidden').remove(); $(this).find('span.hidden').remove();
}); });

View File

@ -14,9 +14,9 @@
<li <?php if($app['active']) echo 'class="active"'?> data-id="<?php echo $app['id'] ?>" <li <?php if($app['active']) echo 'class="active"'?> data-id="<?php echo $app['id'] ?>"
data-type="<?php echo $app['internal'] ? 'internal' : 'external' ?>" data-installed="1"> data-type="<?php echo $app['internal'] ? 'internal' : 'external' ?>" data-installed="1">
<a class="app<?php if(!$app['internal']) echo ' externalapp' ?>" href="?appid=<?php echo $app['id'] ?>"><?php echo htmlentities($app['name']) ?></a> <a class="app<?php if(!$app['internal']) echo ' externalapp' ?>" href="?appid=<?php echo $app['id'] ?>"><?php echo htmlentities($app['name']) ?></a>
<span class="hidden"> <script type="application/javascript">
<?php OC_JSON::encodedPrint($app,false) ?> appData_<?php echo $app['id'] ?>=<?php OC_JSON::encodedPrint($app,false) ?>;
</span> </script>
<?php if(!$app['internal']) echo '<small class="externalapp list">3rd party</small>' ?> <?php if(!$app['internal']) echo '<small class="externalapp list">3rd party</small>' ?>
</li> </li>
<?php endforeach;?> <?php endforeach;?>