summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--settings/apps.php1
-rw-r--r--settings/js/apps-custom.php24
-rw-r--r--settings/routes.php2
-rw-r--r--settings/templates/apps.php10
4 files changed, 30 insertions, 7 deletions
diff --git a/settings/apps.php b/settings/apps.php
index 9de7bdc80a7..384e92bfbb7 100644
--- a/settings/apps.php
+++ b/settings/apps.php
@@ -42,6 +42,7 @@ function app_sort( $a, $b ) {
}
+$combinedApps = OC_App::listAllApps();
usort( $combinedApps, 'app_sort' );
$tmpl = new OC_Template( "settings", "apps", "user" );
diff --git a/settings/js/apps-custom.php b/settings/js/apps-custom.php
new file mode 100644
index 00000000000..e0e7a2d6c79
--- /dev/null
+++ b/settings/js/apps-custom.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright (c) 2013 Lukas Reschke <lukas@statuscode.ch>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+// Check if admin user
+OC_Util::checkAdminUser();
+
+// Set the content type to JSON
+header('Content-type: application/json');
+
+// Disallow caching
+header("Cache-Control: no-cache, must-revalidate");
+header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
+
+$combinedApps = OC_App::listAllApps();
+
+foreach($combinedApps as $app) {
+ echo("appData_".$app['id']."=".json_encode($app));
+ echo("\n");
+} \ No newline at end of file
diff --git a/settings/routes.php b/settings/routes.php
index bac1f61fc50..1c766837dd1 100644
--- a/settings/routes.php
+++ b/settings/routes.php
@@ -53,6 +53,8 @@ $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php')
->actionInclude('settings/ajax/disableapp.php');
$this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php')
->actionInclude('settings/ajax/navigationdetect.php');
+$this->create('apps_custom', '/settings/js/apps-custom.js')
+ ->actionInclude('settings/js/apps-custom.php');
// admin
$this->create('settings_ajax_getlog', '/settings/ajax/getlog.php')
->actionInclude('settings/ajax/getlog.php');
diff --git a/settings/templates/apps.php b/settings/templates/apps.php
index 0490f63fb67..98b0e6c725c 100644
--- a/settings/templates/apps.php
+++ b/settings/templates/apps.php
@@ -3,9 +3,8 @@
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/?>
-<script type='text/javascript'>
- var appid = '<?php echo $_['appid']; ?>';
-</script>
+ <script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('apps_custom');?>"></script>
+
<div id="controls">
<a class="button" target="_blank" href="http://owncloud.org/dev/apps/getting-started/"><?php echo $l->t('Add your App');?></a>
<a class="button" target="_blank" href="http://apps.owncloud.com"><?php echo $l->t('More Apps');?></a>
@@ -15,9 +14,6 @@
<li <?php if($app['active']) echo 'class="active"'?> data-id="<?php echo $app['id'] ?>" <?php if ( isset( $app['ocs_id'] ) ) { echo "data-id-ocs=\"{$app['ocs_id']}\""; } ?>
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>
- <script>
- appData_<?php echo $app['id'] ?>=<?php OC_JSON::encodedPrint($app, false) ?>;
- </script>
<?php if(!$app['internal']) echo '<small class="externalapp list">3rd party</small>' ?>
</li>
<?php endforeach;?>
@@ -32,4 +28,4 @@
<p class="license hidden"><?php echo $l->t('<span class="licence"></span>-licensed by <span class="author"></span>');?></p>
<input class="enable hidden" type="submit" />
</div>
-</div>
+</div> \ No newline at end of file