aboutsummaryrefslogtreecommitdiffstats
path: root/lib/app.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-10-08 15:49:48 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-10-08 15:49:48 +0200
commitc701bed2e3572b3b5d5d192cbe3f801d016c881d (patch)
treeb5b5530ee9ced384a768f36a79663d6230445cf2 /lib/app.php
parent3affeb5bd77715c84c70230d744de8d0f577a378 (diff)
downloadnextcloud-server-c701bed2e3572b3b5d5d192cbe3f801d016c881d.tar.gz
nextcloud-server-c701bed2e3572b3b5d5d192cbe3f801d016c881d.zip
fix a lot of small layout bugs and make the apps page overall prettier plus add ratings finally
Diffstat (limited to 'lib/app.php')
-rwxr-xr-xlib/app.php37
1 files changed, 16 insertions, 21 deletions
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'] = '<img src="'.$img.'"> Score: '.$app['score'].'%';
$i++;
-
}
-
}
-
+
if ( empty( $app1 ) ) {
-
return false;
-
} else {
-
return $app1;
-
}
}