show error when installing an app has failed
This commit is contained in:
parent
d3bf013761
commit
d8864d4f4b
11
lib/app.php
11
lib/app.php
|
@ -139,13 +139,18 @@ class OC_App{
|
|||
if(!is_numeric($app)){
|
||||
OC_Installer::installShippedApp($app);
|
||||
}else{
|
||||
$download=OC_OCSClient::getApplicationDownload($app,1);
|
||||
if(isset($download['downloadlink']) and $download['downloadlink']<>'') {
|
||||
$download=OC_OCSClient::getApplicationDownload($app,1);
|
||||
if(isset($download['downloadlink']) and $download['downloadlink']!='') {
|
||||
$app=OC_Installer::installApp(array('source'=>'http','href'=>$download['downloadlink']));
|
||||
}
|
||||
}
|
||||
}
|
||||
OC_Appconfig::setValue( $app, 'enabled', 'yes' );
|
||||
if($app!==false){
|
||||
OC_Appconfig::setValue( $app, 'enabled', 'yes' );
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,4 +6,4 @@ OC_JSON::setContentTypeHeader();
|
|||
|
||||
OC_App::disable($_POST['appid']);
|
||||
|
||||
?>
|
||||
OC_JSON::success();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue