From 1a4465f41d3fe334f42782545e3130a19796e590 Mon Sep 17 00:00:00 2001 From: kondou Date: Tue, 6 Aug 2013 17:19:18 +0200 Subject: [PATCH 1/6] Improve app-management - Better error messages - Translate untranslated strings Basically picks non-app-dependency related stuff from #4017 --- lib/app.php | 9 +++++---- settings/ajax/enableapp.php | 11 +++++------ settings/js/apps.js | 18 +++++++++++++----- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/app.php b/lib/app.php index 2437896157..1ff18c799c 100644 --- a/lib/app.php +++ b/lib/app.php @@ -210,7 +210,8 @@ class OC_App{ /** * @brief enables an app * @param mixed $app app - * @return bool + * @throws \Exception + * @return void * * This function set an app as enabled in appconfig. */ @@ -228,6 +229,7 @@ class OC_App{ } } } + $l = OC_L10N::get('core'); if($app!==false) { // check if the app is compatible with this version of ownCloud $info=OC_App::getAppInfo($app); @@ -237,16 +239,15 @@ class OC_App{ 'App "'.$info['name'].'" can\'t be installed because it is' .' not compatible with this version of ownCloud', OC_Log::ERROR); - return false; + throw new \Exception($l->t("App can't be installed because it is not compatible with this version of ownCloud.")); }else{ OC_Appconfig::setValue( $app, 'enabled', 'yes' ); if(isset($appdata['id'])) { OC_Appconfig::setValue( $app, 'ocsid', $appdata['id'] ); } - return true; } }else{ - return false; + throw new \Exception($l->t("No app name specified")); } } diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index ab84aee516..0784736a65 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -3,10 +3,9 @@ OC_JSON::checkAdminUser(); OCP\JSON::callCheck(); -$appid = OC_App::enable(OC_App::cleanAppId($_POST['appid'])); -if($appid !== false) { - OC_JSON::success(array('data' => array('appid' => $appid))); -} else { - $l = OC_L10N::get('settings'); - OC_JSON::error(array("data" => array( "message" => $l->t("Could not enable app. ") ))); +try { + OC_App::enable(OC_App::cleanAppId($_POST['appid'])); + OC_JSON::success(); +} catch (Exception $e) { + OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); } diff --git a/settings/js/apps.js b/settings/js/apps.js index 0540d9b1c5..6b32686a69 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -61,7 +61,11 @@ OC.Settings.Apps = OC.Settings.Apps || { if(active) { $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) { if(!result || result.status !== 'success') { - OC.dialogs.alert('Error while disabling app', t('core', 'Error')); + if (result.data && result.data.message) { + OC.dialogs.alert(result.data.message, t('core', 'Error')); + } else { + OC.dialogs.alert(t('settings', 'Error while disabling app'), t('core', 'Error')); + } } else { element.data('active',false); @@ -73,16 +77,20 @@ OC.Settings.Apps = OC.Settings.Apps || { } else { $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:appid},function(result) { if(!result || result.status !== 'success') { - OC.dialogs.alert('Error while enabling app', t('core', 'Error')); - } - else { + if (result.data && result.data.message) { + OC.dialogs.alert(result.data.message, t('core', 'Error')); + } else { + OC.dialogs.alert(t('settings', 'Error while enabling app'), t('core', 'Error')); + } + element.val(t('settings','Enable')); + } else { OC.Settings.Apps.addNavigation(appid); element.data('active',true); element.val(t('settings','Disable')); } },'json') .fail(function() { - OC.dialogs.alert('Error while enabling app', t('core', 'Error')); + OC.dialogs.alert(t('settings', 'Error while enabling app'), t('core', 'Error')); element.data('active',false); OC.Settings.Apps.removeNavigation(appid); element.val(t('settings','Enable')); From 605050df9b42ba68b2d8c34a4075a5af4ebd312c Mon Sep 17 00:00:00 2001 From: kondou Date: Fri, 9 Aug 2013 18:01:49 +0200 Subject: [PATCH 2/6] Log exception at the catching code --- lib/app.php | 10 +++++----- settings/ajax/enableapp.php | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/app.php b/lib/app.php index 1ff18c799c..8ac4a16ffd 100644 --- a/lib/app.php +++ b/lib/app.php @@ -235,11 +235,11 @@ class OC_App{ $info=OC_App::getAppInfo($app); $version=OC_Util::getVersion(); if(!isset($info['require']) or !self::isAppVersionCompatible($version, $info['require'])) { - OC_Log::write('core', - 'App "'.$info['name'].'" can\'t be installed because it is' - .' not compatible with this version of ownCloud', - OC_Log::ERROR); - throw new \Exception($l->t("App can't be installed because it is not compatible with this version of ownCloud.")); + throw new \Exception( + $l->t("App \"%s\" can't be installed because it is not compatible with this version of ownCloud.", + array($info['name']) + ) + ); }else{ OC_Appconfig::setValue( $app, 'enabled', 'yes' ); if(isset($appdata['id'])) { diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index 0784736a65..735794360b 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -7,5 +7,6 @@ try { OC_App::enable(OC_App::cleanAppId($_POST['appid'])); OC_JSON::success(); } catch (Exception $e) { + OC_Log::write('core', $e->getMessage(), OC_Log::ERROR); OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); } From b24b208dce41d11ace0295a93d4303c75ffa38d4 Mon Sep 17 00:00:00 2001 From: kondou Date: Fri, 9 Aug 2013 21:57:01 +0200 Subject: [PATCH 3/6] Throw exceptions instead of only logging in \OC_Installer::installApp() --- lib/installer.php | 53 ++++++++++++++++------------------------------- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/lib/installer.php b/lib/installer.php index dcd29f9e1a..101c99e9c1 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -27,6 +27,7 @@ class OC_Installer{ /** * @brief Installs an app * @param $data array with all information + * @throws \Exception * @returns integer * * This function installs an app. All information needed are passed in the @@ -56,23 +57,22 @@ class OC_Installer{ * needed to get the app working. */ public static function installApp( $data = array()) { + $l = \OC_L10N::get('lib'); + if(!isset($data['source'])) { - OC_Log::write('core', 'No source specified when installing app', OC_Log::ERROR); - return false; + throw new \Exception($l->t("No source specified when installing app")); } //download the file if necesary if($data['source']=='http') { $path=OC_Helper::tmpFile(); if(!isset($data['href'])) { - OC_Log::write('core', 'No href specified when installing app from http', OC_Log::ERROR); - return false; + throw new \Exception($l->t("No href specified when installing app from http")); } copy($data['href'], $path); }else{ if(!isset($data['path'])) { - OC_Log::write('core', 'No path specified when installing app from local file', OC_Log::ERROR); - return false; + throw new \Exception($l->t("No path specified when installing app from local file")); } $path=$data['path']; } @@ -86,8 +86,7 @@ class OC_Installer{ rename($path, $path.'.tgz'); $path.='.tgz'; }else{ - OC_Log::write('core', 'Archives of type '.$mime.' are not supported', OC_Log::ERROR); - return false; + throw new \Exception($l->t("Archives of type %s are not supported", array($mime))); } //extract the archive in a temporary folder @@ -97,12 +96,11 @@ class OC_Installer{ if($archive=OC_Archive::open($path)) { $archive->extract($extractDir); } else { - OC_Log::write('core', 'Failed to open archive when installing app', OC_Log::ERROR); OC_Helper::rmdirr($extractDir); if($data['source']=='http') { unlink($path); } - return false; + throw new \Exception($l->t("Failed to open archive when installing app")); } //load the info.xml file of the app @@ -118,62 +116,48 @@ class OC_Installer{ } } if(!is_file($extractDir.'/appinfo/info.xml')) { - OC_Log::write('core', 'App does not provide an info.xml file', OC_Log::ERROR); OC_Helper::rmdirr($extractDir); if($data['source']=='http') { unlink($path); } - return false; + throw new \Exception($l->t("App does not provide an info.xml file")); } $info=OC_App::getAppInfo($extractDir.'/appinfo/info.xml', true); // check the code for not allowed calls if(!OC_Installer::checkCode($info['id'], $extractDir)) { - OC_Log::write('core', 'App can\'t be installed because of not allowed code in the App', OC_Log::ERROR); OC_Helper::rmdirr($extractDir); - return false; + throw new \Exception($l->t("App can't be installed because of not allowed code in the App")); } // check if the app is compatible with this version of ownCloud if( - !isset($info['require']) - or !OC_App::isAppVersionCompatible(OC_Util::getVersion(), $info['require']) - ) { - OC_Log::write('core', - 'App can\'t be installed because it is not compatible with this version of ownCloud', - OC_Log::ERROR); + !isset($info['require']) + or !OC_App::isAppVersionCompatible(OC_Util::getVersion(), $info['require']) + ) { OC_Helper::rmdirr($extractDir); - return false; + throw new \Exception($l->t("App can't be installed because it is not compatible with this version of ownCloud")); } // check if shipped tag is set which is only allowed for apps that are shipped with ownCloud if(isset($info['shipped']) and ($info['shipped']=='true')) { - OC_Log::write('core', - 'App can\'t be installed because it contains the true' - .' tag which is not allowed for non shipped apps', - OC_Log::ERROR); OC_Helper::rmdirr($extractDir); - return false; + throw new \Exception($l->t("App can't be installed because it contains the <shipped>true</shipped> tag which is not allowed for non shipped apps")); } // check if the ocs version is the same as the version in info.xml/version if(!isset($info['version']) or ($info['version']<>$data['appdata']['version'])) { - OC_Log::write('core', - 'App can\'t be installed because the version in info.xml/version is not the same' - .' as the version reported from the app store', - OC_Log::ERROR); OC_Helper::rmdirr($extractDir); - return false; + throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store")); } $basedir=OC_App::getInstallPath().'/'.$info['id']; //check if the destination directory already exists if(is_dir($basedir)) { - OC_Log::write('core', 'App directory already exists', OC_Log::WARN); OC_Helper::rmdirr($extractDir); if($data['source']=='http') { unlink($path); } - return false; + throw new \Exception($l->t("App directory already exists")); } if(isset($data['pretent']) and $data['pretent']==true) { @@ -182,12 +166,11 @@ class OC_Installer{ //copy the app to the correct place if(@!mkdir($basedir)) { - OC_Log::write('core', 'Can\'t create app folder. Please fix permissions. ('.$basedir.')', OC_Log::ERROR); OC_Helper::rmdirr($extractDir); if($data['source']=='http') { unlink($path); } - return false; + throw new \Exception($l->t("Can't create app folder. Please fix permissions. %s", array($basedir))); } OC_Helper::copyr($extractDir, $basedir); From 9f4bd7cb47af70bfd152a7b3bfb61ecd632fa28d Mon Sep 17 00:00:00 2001 From: kondou Date: Sun, 18 Aug 2013 13:49:34 +0200 Subject: [PATCH 4/6] Don't use an alert for displaying app-mgmt-errors Rather display a dominant div and mark the problematic app in the applist. Fix #305 --- lib/installer.php | 2 +- settings/css/settings.css | 16 +++++++++++++++- settings/js/apps.js | 37 ++++++++++++++++++++++++++++--------- settings/templates/apps.php | 1 + 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/lib/installer.php b/lib/installer.php index 101c99e9c1..c9d331551c 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -141,7 +141,7 @@ class OC_Installer{ // check if shipped tag is set which is only allowed for apps that are shipped with ownCloud if(isset($info['shipped']) and ($info['shipped']=='true')) { OC_Helper::rmdirr($extractDir); - throw new \Exception($l->t("App can't be installed because it contains the <shipped>true</shipped> tag which is not allowed for non shipped apps")); + throw new \Exception($l->t("App can't be installed because it contains the true tag which is not allowed for non shipped apps")); } // check if the ocs version is the same as the version in info.xml/version diff --git a/settings/css/settings.css b/settings/css/settings.css index 20df5d86d6..38c28dd33b 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -61,7 +61,7 @@ select.quota.active { background: #fff; } .ie8 table.hascontrols tbody tr{border-collapse:collapse;border: 1px solid #ddd !important;} /* APPS */ -.appinfo { margin: 1em; } +.appinfo { margin: 1em 40px; } h3 { font-size: 1.4em; font-weight: bold; } ul.applist a { height: 2.2em; @@ -72,6 +72,12 @@ ul.applist .app-external { } li { color:#888; } li.active { color:#000; } +#leftcontent .appwarning { + background: #fcc; +} +#leftcontent .appwarning:hover { + background: #fbb; +} small.externalapp { color:#FFF; background-color:#BBB; font-weight:bold; font-size: 0.6em; margin: 0; padding: 0.1em 0.2em; border-radius: 4px;} small.externalapp.list { float: right; } small.recommendedapp { color:#FFF; background-color:#888; font-weight:bold; font-size: 0.6em; margin: 0; padding: 0.1em 0.2em; border-radius: 4px;} @@ -86,6 +92,14 @@ span.version { margin-left:1em; margin-right:1em; color:#555; } .appslink { text-decoration: underline; } .score { color:#666; font-weight:bold; font-size:0.8em; } +.errormsg { + margin: 20px; + padding: 5px; + background: #fdd; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} /* LOG */ #log { white-space:normal; } diff --git a/settings/js/apps.js b/settings/js/apps.js index 6c835a5999..e49fd21a59 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -27,7 +27,7 @@ OC.Settings.Apps = OC.Settings.Apps || { } page.find('small.externalapp').attr('style', 'visibility:visible'); page.find('span.author').text(app.author); - page.find('span.licence').text(app.licence); + page.find('span.licence').text(app.license); if (app.update !== false) { page.find('input.update').show(); @@ -50,6 +50,12 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find('p.appslink').hide(); page.find('span.score').hide(); } + if (typeof($('#leftcontent li[data-id="'+app.id+'"]').data('errormsg')) !== "undefined") { + page.find(".errormsg").show(); + page.find(".errormsg").text($('#leftcontent li[data-id="'+app.id+'"]').data('errormsg')); + } else { + page.find(".errormsg").hide(); + } }, enableApp:function(appid, active, element) { console.log('enableApp:', appid, active, element); @@ -62,40 +68,48 @@ OC.Settings.Apps = OC.Settings.Apps || { $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) { if(!result || result.status !== 'success') { if (result.data && result.data.message) { - OC.dialogs.alert(result.data.message, t('core', 'Error')); + OC.Settings.Apps.showErrorMessage(result.data.message); + $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', result.data.message); } else { - OC.dialogs.alert(t('settings', 'Error while disabling app'), t('core', 'Error')); + OC.Settings.Apps.showErrorMessage(t('settings', 'Error while disabling app')); + $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', t('settings', 'Error while disabling app')); } + element.val(t('settings','Disable')); + $('#leftcontent li[data-id="'+appid+'"]').addClass('appwarning'); } else { element.data('active',false); OC.Settings.Apps.removeNavigation(appid); + $('#leftcontent li[data-id="'+appid+'"]').removeClass('active'); element.val(t('settings','Enable')); } },'json'); - $('#leftcontent li[data-id="'+appid+'"]').removeClass('active'); } else { $.post(OC.filePath('settings','ajax','enableapp.php'),{appid:appid},function(result) { if(!result || result.status !== 'success') { if (result.data && result.data.message) { - OC.dialogs.alert(result.data.message, t('core', 'Error')); + OC.Settings.Apps.showErrorMessage(result.data.message); + $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', result.data.message); } else { - OC.dialogs.alert(t('settings', 'Error while enabling app'), t('core', 'Error')); + OC.Settings.Apps.showErrorMessage(t('settings', 'Error while enabling app')); + $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', t('settings', 'Error while disabling app')); } element.val(t('settings','Enable')); + $('#leftcontent li[data-id="'+appid+'"]').addClass('appwarning'); } else { OC.Settings.Apps.addNavigation(appid); element.data('active',true); + $('#leftcontent li[data-id="'+appid+'"]').addClass('active'); element.val(t('settings','Disable')); } },'json') .fail(function() { - OC.dialogs.alert(t('settings', 'Error while enabling app'), t('core', 'Error')); + OC.Settings.Apps.showErrorMessage(t('settings', 'Error while enabling app')); + $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', t('settings', 'Error while enabling app')); element.data('active',false); OC.Settings.Apps.removeNavigation(appid); element.val(t('settings','Enable')); }); - $('#leftcontent li[data-id="'+appid+'"]').addClass('active'); } }, updateApp:function(appid, element) { @@ -103,7 +117,8 @@ OC.Settings.Apps = OC.Settings.Apps || { element.val(t('settings','Updating....')); $.post(OC.filePath('settings','ajax','updateapp.php'),{appid:appid},function(result) { if(!result || result.status !== 'success') { - OC.dialogs.alert(t('settings','Error while updating app'),t('settings','Error')); + OC.Settings.Apps.showErrorMessage(t('settings','Error while updating app'),t('settings','Error')); + element.val(t('settings','Update')); } else { element.val(t('settings','Updated')); @@ -175,6 +190,10 @@ OC.Settings.Apps = OC.Settings.Apps || { } } }); + }, + showErrorMessage: function(message) { + $('#rightcontent .errormsg').show(); + $('#rightcontent .errormsg').text(message); } }; diff --git a/settings/templates/apps.php b/settings/templates/apps.php index d60fd82f91..b6b731ac9c 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -41,5 +41,6 @@ print_unescaped($l->t('-licensed by '));?>

+ From db424cc86b005d2edfcfcf55ee7f5294dfffc8b6 Mon Sep 17 00:00:00 2001 From: kondou Date: Sun, 18 Aug 2013 14:49:11 +0200 Subject: [PATCH 5/6] Use appitem instead of always recreating a jquery object Also fix some wrong data storages --- settings/js/apps.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/settings/js/apps.js b/settings/js/apps.js index e49fd21a59..0ca1b5f771 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -60,27 +60,24 @@ OC.Settings.Apps = OC.Settings.Apps || { enableApp:function(appid, active, element) { console.log('enableApp:', appid, active, element); var appitem=$('#leftcontent li[data-id="'+appid+'"]'); - appData = appitem.data('app'); - appData.active = !active; - appitem.data('app', appData); element.val(t('settings','Please wait....')); if(active) { $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) { if(!result || result.status !== 'success') { if (result.data && result.data.message) { OC.Settings.Apps.showErrorMessage(result.data.message); - $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', result.data.message); + appitem.data('errormsg', result.data.message); } else { OC.Settings.Apps.showErrorMessage(t('settings', 'Error while disabling app')); - $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', t('settings', 'Error while disabling app')); + appitem.data('errormsg', t('settings', 'Error while disabling app')); } element.val(t('settings','Disable')); - $('#leftcontent li[data-id="'+appid+'"]').addClass('appwarning'); + appitem.addClass('appwarning'); } else { - element.data('active',false); + appitem.data('active',false); OC.Settings.Apps.removeNavigation(appid); - $('#leftcontent li[data-id="'+appid+'"]').removeClass('active'); + appitem.removeClass('active'); element.val(t('settings','Enable')); } },'json'); @@ -89,24 +86,25 @@ OC.Settings.Apps = OC.Settings.Apps || { if(!result || result.status !== 'success') { if (result.data && result.data.message) { OC.Settings.Apps.showErrorMessage(result.data.message); - $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', result.data.message); + appitem.data('errormsg', result.data.message); } else { OC.Settings.Apps.showErrorMessage(t('settings', 'Error while enabling app')); - $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', t('settings', 'Error while disabling app')); + appitem.data('errormsg', t('settings', 'Error while disabling app')); } element.val(t('settings','Enable')); - $('#leftcontent li[data-id="'+appid+'"]').addClass('appwarning'); + appitem.addClass('appwarning'); } else { OC.Settings.Apps.addNavigation(appid); - element.data('active',true); - $('#leftcontent li[data-id="'+appid+'"]').addClass('active'); + appitem.data('active',true); + appitem.addClass('active'); element.val(t('settings','Disable')); } },'json') .fail(function() { OC.Settings.Apps.showErrorMessage(t('settings', 'Error while enabling app')); - $('#leftcontent li[data-id="'+appid+'"]').data('errormsg', t('settings', 'Error while enabling app')); - element.data('active',false); + appitem.data('errormsg', t('settings', 'Error while enabling app')); + appitem.data('active',false); + appitem.addClass('appwarning'); OC.Settings.Apps.removeNavigation(appid); element.val(t('settings','Enable')); }); From 7c296a6cf915da6630422ceb8e253ebf9f004964 Mon Sep 17 00:00:00 2001 From: kondou Date: Sun, 18 Aug 2013 17:37:22 +0200 Subject: [PATCH 6/6] Move .errormsg from settings-css to .warning in core. Reusable! --- core/css/styles.css | 12 +++++++++++- settings/css/settings.css | 8 -------- settings/js/apps.js | 10 +++++----- settings/templates/apps.php | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index becf0af905..39121fccb2 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -389,7 +389,7 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } /* Warnings and errors are the same */ -.warning, .update, .error { +#body-login .warning, #body-login .update, #body-login .error { display: block; padding: 10px; color: #dd3b3b; @@ -401,6 +401,16 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } border-radius: 5px; cursor: default; } + +#body-user .warning, #body-settings .warning { + margin-top: 8px; + padding: 5px; + background: #fdd; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + .warning legend, .warning a, .error a { diff --git a/settings/css/settings.css b/settings/css/settings.css index 38c28dd33b..d5ffe44848 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -92,14 +92,6 @@ span.version { margin-left:1em; margin-right:1em; color:#555; } .appslink { text-decoration: underline; } .score { color:#666; font-weight:bold; font-size:0.8em; } -.errormsg { - margin: 20px; - padding: 5px; - background: #fdd; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} /* LOG */ #log { white-space:normal; } diff --git a/settings/js/apps.js b/settings/js/apps.js index 0ca1b5f771..d9817aff6b 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -51,10 +51,10 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find('span.score').hide(); } if (typeof($('#leftcontent li[data-id="'+app.id+'"]').data('errormsg')) !== "undefined") { - page.find(".errormsg").show(); - page.find(".errormsg").text($('#leftcontent li[data-id="'+app.id+'"]').data('errormsg')); + page.find(".warning").show(); + page.find(".warning").text($('#leftcontent li[data-id="'+app.id+'"]').data('errormsg')); } else { - page.find(".errormsg").hide(); + page.find(".warning").hide(); } }, enableApp:function(appid, active, element) { @@ -190,8 +190,8 @@ OC.Settings.Apps = OC.Settings.Apps || { }); }, showErrorMessage: function(message) { - $('#rightcontent .errormsg').show(); - $('#rightcontent .errormsg').text(message); + $('.appinfo .warning').show(); + $('.appinfo .warning').text(message); } }; diff --git a/settings/templates/apps.php b/settings/templates/apps.php index b6b731ac9c..0b76f775fe 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -41,6 +41,6 @@ print_unescaped($l->t('-licensed by '));?>

- +