From 3fdebaa5dc4a903e9db64f8bafe11929c5f50304 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Tue, 2 Oct 2012 12:10:45 +0200 Subject: automatically remove and prevent installation of apps with a require version less than the current one. We check now the first ad second part of the version number. Also increase the require tags of the core apps to 4.9 Please note that 4.9 is the internal versionnumber of the upcoming 4.5 release. You have to pu a 4.9 into the info.xml of your app to make it as compatible with 4.5 --- lib/app.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/app.php') diff --git a/lib/app.php b/lib/app.php index 7889339e420..90b5c58a448 100755 --- a/lib/app.php +++ b/lib/app.php @@ -664,8 +664,8 @@ class OC_App{ $version = OC_Util::getVersion(); foreach($apps as $app) { // check if the app is compatible with this version of ownCloud - $info = OC_App::getAppInfo($app); - if(!isset($info['require']) or ($version[0]>$info['require'])) { + $info = OC_App::getAppInfo($app); + if(!isset($info['require']) or (($version[0].'.'.$version[1])>$info['require'])) { OC_Log::write('core', 'App "'.$info['name'].'" ('.$app.') can\'t be used because it is not compatible with this version of ownCloud', OC_Log::ERROR); OC_App::disable( $app ); } -- cgit v1.2.3 From c701bed2e3572b3b5d5d192cbe3f801d016c881d Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Mon, 8 Oct 2012 15:49:48 +0200 Subject: fix a lot of small layout bugs and make the apps page overall prettier plus add ratings finally --- core/img/rating/s1.png | Bin 0 -> 454 bytes core/img/rating/s10.png | Bin 0 -> 848 bytes core/img/rating/s11.png | Bin 0 -> 724 bytes core/img/rating/s2.png | Bin 0 -> 731 bytes core/img/rating/s3.png | Bin 0 -> 918 bytes core/img/rating/s4.png | Bin 0 -> 989 bytes core/img/rating/s5.png | Bin 0 -> 939 bytes core/img/rating/s6.png | Bin 0 -> 992 bytes core/img/rating/s7.png | Bin 0 -> 939 bytes core/img/rating/s8.png | Bin 0 -> 987 bytes core/img/rating/s9.png | Bin 0 -> 908 bytes lib/app.php | 37 ++++++++++++++++--------------------- lib/ocsclient.php | 2 ++ settings/css/settings.css | 3 ++- settings/js/apps.js | 3 +++ settings/templates/apps.php | 2 ++ 16 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 core/img/rating/s1.png create mode 100644 core/img/rating/s10.png create mode 100644 core/img/rating/s11.png create mode 100644 core/img/rating/s2.png create mode 100644 core/img/rating/s3.png create mode 100644 core/img/rating/s4.png create mode 100644 core/img/rating/s5.png create mode 100644 core/img/rating/s6.png create mode 100644 core/img/rating/s7.png create mode 100644 core/img/rating/s8.png create mode 100644 core/img/rating/s9.png (limited to 'lib/app.php') diff --git a/core/img/rating/s1.png b/core/img/rating/s1.png new file mode 100644 index 00000000000..445d965ffeb Binary files /dev/null and b/core/img/rating/s1.png differ diff --git a/core/img/rating/s10.png b/core/img/rating/s10.png new file mode 100644 index 00000000000..b8d66c2a4c4 Binary files /dev/null and b/core/img/rating/s10.png differ diff --git a/core/img/rating/s11.png b/core/img/rating/s11.png new file mode 100644 index 00000000000..aee9f921560 Binary files /dev/null and b/core/img/rating/s11.png differ diff --git a/core/img/rating/s2.png b/core/img/rating/s2.png new file mode 100644 index 00000000000..4f860e74ca1 Binary files /dev/null and b/core/img/rating/s2.png differ diff --git a/core/img/rating/s3.png b/core/img/rating/s3.png new file mode 100644 index 00000000000..26c9baff55f Binary files /dev/null and b/core/img/rating/s3.png differ diff --git a/core/img/rating/s4.png b/core/img/rating/s4.png new file mode 100644 index 00000000000..47f1f694bf7 Binary files /dev/null and b/core/img/rating/s4.png differ diff --git a/core/img/rating/s5.png b/core/img/rating/s5.png new file mode 100644 index 00000000000..aa225b6a9a9 Binary files /dev/null and b/core/img/rating/s5.png differ diff --git a/core/img/rating/s6.png b/core/img/rating/s6.png new file mode 100644 index 00000000000..fd4f42e22c6 Binary files /dev/null and b/core/img/rating/s6.png differ diff --git a/core/img/rating/s7.png b/core/img/rating/s7.png new file mode 100644 index 00000000000..0d18a1dc025 Binary files /dev/null and b/core/img/rating/s7.png differ diff --git a/core/img/rating/s8.png b/core/img/rating/s8.png new file mode 100644 index 00000000000..951c3fd3be4 Binary files /dev/null and b/core/img/rating/s8.png differ diff --git a/core/img/rating/s9.png b/core/img/rating/s9.png new file mode 100644 index 00000000000..b1a654c85d2 Binary files /dev/null and b/core/img/rating/s9.png differ diff --git a/lib/app.php b/lib/app.php index 90b5c58a448..395230156f6 100755 --- a/lib/app.php +++ b/lib/app.php @@ -578,50 +578,45 @@ class OC_App{ * @return array, multi-dimensional array of apps. Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description */ public static function getAppstoreApps( $filter = 'approved' ) { - $catagoryNames = OC_OCSClient::getCategories(); - if ( is_array( $catagoryNames ) ) { - // Check that categories of apps were retrieved correctly if ( ! $categories = array_keys( $catagoryNames ) ) { - return false; - } $page = 0; - $remoteApps = OC_OCSClient::getApplications( $categories, $page, $filter ); - $app1 = array(); - $i = 0; - foreach ( $remoteApps as $app ) { - $app1[$i] = $app; - $app1[$i]['author'] = $app['personid']; - $app1[$i]['ocs_id'] = $app['id']; - $app1[$i]['internal'] = $app1[$i]['active'] = 0; - + + // rating img + if($app['score']>=0 and $app['score']<5) $img=OC_Helper::imagePath( "core", "rating/s1.png" ); + elseif($app['score']>=5 and $app['score']<15) $img=OC_Helper::imagePath( "core", "rating/s2.png" ); + elseif($app['score']>=15 and $app['score']<25) $img=OC_Helper::imagePath( "core", "rating/s3.png" ); + elseif($app['score']>=25 and $app['score']<35) $img=OC_Helper::imagePath( "core", "rating/s4.png" ); + elseif($app['score']>=35 and $app['score']<45) $img=OC_Helper::imagePath( "core", "rating/s5.png" ); + elseif($app['score']>=45 and $app['score']<55) $img=OC_Helper::imagePath( "core", "rating/s6.png" ); + elseif($app['score']>=55 and $app['score']<65) $img=OC_Helper::imagePath( "core", "rating/s7.png" ); + elseif($app['score']>=65 and $app['score']<75) $img=OC_Helper::imagePath( "core", "rating/s8.png" ); + elseif($app['score']>=75 and $app['score']<85) $img=OC_Helper::imagePath( "core", "rating/s9.png" ); + elseif($app['score']>=85 and $app['score']<95) $img=OC_Helper::imagePath( "core", "rating/s10.png" ); + elseif($app['score']>=95 and $app['score']<100) $img=OC_Helper::imagePath( "core", "rating/s11.png" ); + + $app1[$i]['score'] = ' Score: '.$app['score'].'%'; $i++; - } - } - + if ( empty( $app1 ) ) { - return false; - } else { - return $app1; - } } diff --git a/lib/ocsclient.php b/lib/ocsclient.php index fc2095f5c15..c5c4357313b 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -140,6 +140,7 @@ class OC_OCSClient{ $app['preview']=(string)$tmp[$i]->smallpreviewpic1; $app['changed']=strtotime($tmp[$i]->changed); $app['description']=(string)$tmp[$i]->description; + $app['score']=(string)$tmp[$i]->score; $apps[]=$app; } @@ -188,6 +189,7 @@ class OC_OCSClient{ $app['changed']=strtotime($tmp->changed); $app['description']=$tmp->description; $app['detailpage']=$tmp->detailpage; + $app['score']=$tmp->score; return $app; } diff --git a/settings/css/settings.css b/settings/css/settings.css index d5e826b33ce..60a42784661 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -50,7 +50,7 @@ li { color:#888; } li.active { color:#000; } 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; } -span.version { margin-left:3em; margin-right:3em; color:#555; } +span.version { margin-left:1em; margin-right:1em; color:#555; } .app { position: relative; display: inline-block; padding: 0.2em 0 0.2em 0 !important; text-overflow: hidden; overflow: hidden; white-space: nowrap; /*transition: .2s max-width linear; -o-transition: .2s max-width linear; -moz-transition: .2s max-width linear; -webkit-transition: .2s max-width linear; -ms-transition: .2s max-width linear;*/ } .app.externalapp { max-width: 12.5em; z-index: 100; } @@ -58,6 +58,7 @@ span.version { margin-left:3em; margin-right:3em; color:#555; } .app:hover, .app:active { max-width: inherit; } .appslink { text-decoration: underline; } +.score { color:#666; font-weight:bold; font-size:0.8em; } /* LOG */ #log { white-space:normal; } diff --git a/settings/js/apps.js b/settings/js/apps.js index 6ef33706f65..8de95100c4c 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -17,6 +17,7 @@ OC.Settings.Apps = OC.Settings.Apps || { } else { page.find('span.version').text(''); } + page.find('span.score').html(app.score); page.find('p.description').html(app.description); page.find('img.preview').attr('src', app.preview); page.find('small.externalapp').attr('style', 'visibility:visible'); @@ -28,11 +29,13 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find('input.enable').data('appid', app.id); page.find('input.enable').data('active', app.active); if (app.internal == false) { + page.find('span.score').show(); page.find('p.appslink').show(); page.find('a').attr('href', 'http://apps.owncloud.com/content/show.php?content=' + app.id); page.find('small.externalapp').hide(); } else { page.find('p.appslink').hide(); + page.find('span.score').hide(); } }, enableApp:function(appid, active, element) { diff --git a/settings/templates/apps.php b/settings/templates/apps.php index 0662148ebf2..1e9598de1e3 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -8,6 +8,7 @@