show error when installing an app has failed
This commit is contained in:
parent
d3bf013761
commit
d8864d4f4b
|
@ -140,12 +140,17 @@ class OC_App{
|
||||||
OC_Installer::installShippedApp($app);
|
OC_Installer::installShippedApp($app);
|
||||||
}else{
|
}else{
|
||||||
$download=OC_OCSClient::getApplicationDownload($app,1);
|
$download=OC_OCSClient::getApplicationDownload($app,1);
|
||||||
if(isset($download['downloadlink']) and $download['downloadlink']<>'') {
|
if(isset($download['downloadlink']) and $download['downloadlink']!='') {
|
||||||
$app=OC_Installer::installApp(array('source'=>'http','href'=>$download['downloadlink']));
|
$app=OC_Installer::installApp(array('source'=>'http','href'=>$download['downloadlink']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($app!==false){
|
||||||
OC_Appconfig::setValue( $app, 'enabled', 'yes' );
|
OC_Appconfig::setValue( $app, 'enabled', 'yes' );
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,4 +6,4 @@ OC_JSON::setContentTypeHeader();
|
||||||
|
|
||||||
OC_App::disable($_POST['appid']);
|
OC_App::disable($_POST['appid']);
|
||||||
|
|
||||||
?>
|
OC_JSON::success();
|
||||||
|
|
|
@ -5,6 +5,8 @@ require_once('../../lib/base.php');
|
||||||
OC_JSON::checkAdminUser();
|
OC_JSON::checkAdminUser();
|
||||||
OC_JSON::setContentTypeHeader();
|
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');
|
var active=$(this).data('active');
|
||||||
if(app){
|
if(app){
|
||||||
if(active){
|
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');
|
$('#leftcontent li[data-id="'+app+'"]').removeClass('active');
|
||||||
}else{
|
}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');
|
$('#leftcontent li[data-id="'+app+'"]').addClass('active');
|
||||||
}
|
}
|
||||||
active=!active;
|
active=!active;
|
||||||
|
|
Loading…
Reference in New Issue