diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-04-14 12:57:03 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-04-14 12:57:10 +0200 |
commit | d8864d4f4bd54a314b1d7c7945578b95f24477d1 (patch) | |
tree | 96c19a72c77d3f5097c53a5e3c53931b91641ee9 /settings | |
parent | d3bf01376150ffd5de18cdc53f5e66b0c4979526 (diff) | |
download | nextcloud-server-d8864d4f4bd54a314b1d7c7945578b95f24477d1.tar.gz nextcloud-server-d8864d4f4bd54a314b1d7c7945578b95f24477d1.zip |
show error when installing an app has failed
Diffstat (limited to 'settings')
-rw-r--r-- | settings/ajax/disableapp.php | 2 | ||||
-rw-r--r-- | settings/ajax/enableapp.php | 8 | ||||
-rw-r--r-- | settings/js/apps.js | 12 |
3 files changed, 16 insertions, 6 deletions
diff --git a/settings/ajax/disableapp.php b/settings/ajax/disableapp.php index 06dd3c2ac6b..53e9be379e1 100644 --- a/settings/ajax/disableapp.php +++ b/settings/ajax/disableapp.php @@ -6,4 +6,4 @@ OC_JSON::setContentTypeHeader(); OC_App::disable($_POST['appid']); -?> +OC_JSON::success(); diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index 639df2aecc0..cb116ebe4e8 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -5,6 +5,8 @@ require_once('../../lib/base.php'); OC_JSON::checkAdminUser(); OC_JSON::setContentTypeHeader(); -OC_App::enable($_POST['appid']); - -?> +if(OC_App::enable($_POST['appid'])){ + OC_JSON::success(); +}else{ + OC_JSON::error(); +} diff --git a/settings/js/apps.js b/settings/js/apps.js index e2f882c6fec..0f9181a2c75 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -28,10 +28,18 @@ $(document).ready(function(){ var active=$(this).data('active'); if(app){ if(active){ - $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:app}); + $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:app},function(result){ + if(!result || result.status!='succes'){ + OC.dialogs.alert('Error','Error while enabling app'); + } + },'json'); $('#leftcontent li[data-id="'+app+'"]').removeClass('active'); }else{ - $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:app}); + $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:app},function(result){ + if(!result || result.status!='succes'){ + OC.dialogs.alert('Error','Error while disabling app'); + } + },'json'); $('#leftcontent li[data-id="'+app+'"]').addClass('active'); } active=!active; |