summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-01-17 14:05:39 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-01-17 14:56:25 +0100
commitbf0471a92ed4fca8fe3344839acd83d6918cf566 (patch)
tree8c6a944495a86850eb31bd7dd290c100eebfb1df
parent1df6bf997a5f4bb44902d237d07bd06eccf6a9fc (diff)
downloadnextcloud-server-bf0471a92ed4fca8fe3344839acd83d6918cf566.tar.gz
nextcloud-server-bf0471a92ed4fca8fe3344839acd83d6918cf566.zip
show link to app documentation
-rw-r--r--lib/private/app.php4
-rw-r--r--settings/css/settings.css6
-rw-r--r--settings/js/apps.js20
-rw-r--r--settings/templates/apps.php5
4 files changed, 34 insertions, 1 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 34c00e97fb9..0c60557914a 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -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;
}
diff --git a/settings/css/settings.css b/settings/css/settings.css
index a93c675d466..8a96885b789 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -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; }
diff --git a/settings/js/apps.js b/settings/js/apps.js
index a55c55e24cf..1d05d01e1f2 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -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);
@@ -110,7 +128,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
element.val(t('settings','Disable'));
}
},'json')
- .fail(function() {
+ .fail(function() {
OC.Settings.Apps.showErrorMessage(t('settings', 'Error while enabling app'));
appitem.data('errormsg', t('settings', 'Error while enabling app'));
appitem.data('active',false);
diff --git a/settings/templates/apps.php b/settings/templates/apps.php
index 0b76f775fea..ce48ef77d12 100644
--- a/settings/templates/apps.php
+++ b/settings/templates/apps.php
@@ -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>