show link to app documentation

This commit is contained in:
Bjoern Schiessle 2014-01-17 14:05:39 +01:00
parent 1df6bf997a
commit bf0471a92e
4 changed files with 34 additions and 1 deletions

View File

@ -555,6 +555,10 @@ class OC_App{
}elseif($child->getName()=='description') {
$xml=(string)$child->asXML();
$data[$child->getName()]=substr($xml, 13, -14);//script <description> tags
}elseif($child->getName()=='documentation') {
foreach($child as $subchild) {
$data["documentation"][$subchild->getName()] = (string)$subchild;
}
}else{
$data[$child->getName()]=(string)$child;
}

View File

@ -131,6 +131,12 @@ span.version { margin-left:1em; margin-right:1em; color:#555; }
.appslink { text-decoration: underline; }
.score { color:#666; font-weight:bold; font-size:0.8em; }
.appinfo .documentation {
margin-top: 1em;
margin-bottom: 1em;
}
/* LOG */
#log { white-space:normal; }
#lessLog { display:none; }

View File

@ -37,6 +37,24 @@ OC.Settings.Apps = OC.Settings.Apps || {
}
page.find('span.licence').text(appLicense);
var userDocumentation = false;
var adminDocumentation = false;
if (typeof(app.documentation.user) !== 'undefined') {
userDocumentation = true;
page.find('span.userDocumentation').html("<a href='" + app.documentation.user + "'>" + t('settings', 'User Documentation') + "</a>");
page.find('p.documentation').show();
}
if (typeof(app.documentation.admin) !== 'undefined') {
adminDocumentation = true;
page.find('span.adminDocumentation').html("<a href='" + app.documentation.admin + "'>" + t('settings', 'Admin Documentation') + "</a>");
page.find('p.documentation').show();
}
if(userDocumentation && adminDocumentation) {
page.find('span.userDocumentation').after(', ');
}
if (app.update !== false) {
page.find('input.update').show();
page.find('input.update').data('appid', app.id);

View File

@ -34,6 +34,11 @@
class="version"></span><small class="externalapp" style="visibility:hidden;"></small></h3>
<span class="score"></span>
<p class="description"></p>
<p class="documentation hidden">
<?php p($l->t("Documentation:"));?>
<span class="userDocumentation appslink"></span>
<span class="adminDocumentation appslink"></span>
</p>
<img src="" class="preview hidden" />
<p class="appslink hidden"><a href="#" target="_blank"><?php
p($l->t('See application page at apps.owncloud.com'));?></a></p>