diff --git a/core/img/rating/s1.png b/core/img/rating/s1.png new file mode 100644 index 0000000000..445d965ffe 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 0000000000..b8d66c2a4c 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 0000000000..aee9f92156 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 0000000000..4f860e74ca 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 0000000000..26c9baff55 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 0000000000..47f1f694bf 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 0000000000..aa225b6a9a 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 0000000000..fd4f42e22c 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 0000000000..0d18a1dc02 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 0000000000..951c3fd3be 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 0000000000..b1a654c85d Binary files /dev/null and b/core/img/rating/s9.png differ diff --git a/lib/app.php b/lib/app.php index 90b5c58a44..395230156f 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 fc2095f5c1..c5c4357313 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 d5e826b33c..60a4278466 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 6ef33706f6..8de95100c4 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 0662148ebf..1e9598de1e 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -8,6 +8,7 @@
t('Add your App');?> + t('More Apps');?>