diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-10-08 15:49:48 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-10-08 15:49:48 +0200 |
commit | c701bed2e3572b3b5d5d192cbe3f801d016c881d (patch) | |
tree | b5b5530ee9ced384a768f36a79663d6230445cf2 /lib | |
parent | 3affeb5bd77715c84c70230d744de8d0f577a378 (diff) | |
download | nextcloud-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')
-rwxr-xr-x | lib/app.php | 37 | ||||
-rw-r--r-- | lib/ocsclient.php | 2 |
2 files changed, 18 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; - } } 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; } |