]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move and fix app setting navigation detect
authorBart Visscher <bartv@thisnet.nl>
Sun, 28 Oct 2012 17:52:18 +0000 (18:52 +0100)
committerBart Visscher <bartv@thisnet.nl>
Mon, 29 Oct 2012 14:04:55 +0000 (15:04 +0100)
core/ajax/navigationdetect.php [deleted file]
settings/ajax/navigationdetect.php [new file with mode: 0644]
settings/js/apps.js
settings/routes.php

diff --git a/core/ajax/navigationdetect.php b/core/ajax/navigationdetect.php
deleted file mode 100644 (file)
index c7d0bd3..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-$RUNTIME_NOAPPS = true;
-
-require_once '../../lib/base.php';
-
-OC_Util::checkAdminUser();
-OCP\JSON::callCheck();
-
-$app = $_GET['app'];
-
-//load the one app and see what it adds to the navigation
-OC_App::loadApp($app);
-
-$navigation = OC_App::getNavigation();
-
-$navIds = array();
-foreach ($navigation as $nav) {
-       $navIds[] = $nav['id'];
-}
-
-OCP\JSON::success(array('nav_ids' => array_values($navIds), 'nav_entries' => $navigation));
diff --git a/settings/ajax/navigationdetect.php b/settings/ajax/navigationdetect.php
new file mode 100644 (file)
index 0000000..93acb50
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+OC_Util::checkAdminUser();
+OCP\JSON::callCheck();
+
+$app = $_GET['app'];
+
+//load the one app and see what it adds to the navigation
+OC_App::loadApp($app);
+
+$navigation = OC_App::getNavigation();
+
+$navIds = array();
+foreach ($navigation as $nav) {
+       $navIds[] = $nav['id'];
+}
+
+OCP\JSON::success(array('nav_ids' => array_values($navIds), 'nav_entries' => $navigation));
index e45abf9b3dde4f6ee895dbabe24dfd367fc49ba1..c4c36b4bb12a84b85c3deb0e47b58847e68af9ce 100644 (file)
@@ -91,7 +91,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
                return app;
        },
        removeNavigation: function(appid){
-               $.getJSON(OC.filePath('core','ajax','navigationdetect.php'), {app: appid}).done(function(response){
+               $.getJSON(OC.filePath('settings', 'ajax', 'navigationdetect.php'), {app: appid}).done(function(response){
                        if(response.status === 'success'){
                                var navIds=response.nav_ids;
                                for(var i=0; i< navIds.length; i++){
@@ -101,7 +101,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
                });
        },
        addNavigation: function(appid){
-               $.getJSON(OC.filePath('core','ajax','navigationdetect.php'), {app: appid}).done(function(response){
+               $.getJSON(OC.filePath('settings', 'ajax', 'navigationdetect.php'), {app: appid}).done(function(response){
                        if(response.status === 'success'){
                                var navEntries=response.nav_entries;
                                for(var i=0; i< navEntries.length; i++){
index 4f4f83e4542298b28c2631e910de268bf177789e..64f4650eb8c723360bb103b9ba4071440f14acc5 100644 (file)
@@ -51,6 +51,8 @@ $this->create('settings_ajax_enableapp', '/settings/ajax/enableapp.php')
        ->actionInclude('settings/ajax/enableapp.php');
 $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');
 // admin
 $this->create('settings_ajax_getlog', '/settings/ajax/getlog.php')
        ->actionInclude('settings/ajax/getlog.php');