From: Hans-Emil Skogh Date: Mon, 23 Jan 2012 20:07:33 +0000 (+0100) Subject: Added a notice for apps with anti-features. X-Git-Tag: 0.1~1063^2~2^2~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=dd1ff8b6d952f5d4e107db9ccc729a4b40f82f08;p=fdroidserver.git Added a notice for apps with anti-features. --- diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 2319aa25..fc18f6d3 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -144,6 +144,8 @@ class FDroid case "web": $web=$el; break; + case "antifeatures"; + $antifeatures=$el; case "package": $thisapk=array(); foreach($el->children() as $pel) { @@ -204,6 +206,15 @@ class FDroid $out.="

".$desc."

"; + if(isset($antifeatures)) { + $antifeaturesArray = explode(',',$antifeatures); + foreach($antifeaturesArray as $antifeature) { + $antifeatureDesctiption = $this->get_antifeature_description($antifeature); + $out.='

'.$antifeatureDesctiption['name'].'
'; + $out.=$antifeatureDesctiption['description'].'

'; + } + } + $out.="

License: ".$license."

"; $out.="

"; @@ -390,6 +401,23 @@ class FDroid return round($size,max(0,$i-1)).' '.$si_prefix[$i]; } + private function get_antifeature_description($antifeature) { + // Anti feature names and descriptions + $antifeatureDesctiption['ads']['name'] = 'Advertising'; + $antifeatureDesctiption['ads']['description'] = 'This application contains advertising'; + $antifeatureDesctiption['tracking']['name'] = 'Tracks You'; + $antifeatureDesctiption['tracking']['description'] = 'This application tracks and reports your activity to somewhere'; + $antifeatureDesctiption['nonfreenet']['name'] = 'Non-Free Network Services'; + $antifeatureDesctiption['nonfreenet']['description'] = 'This application promotes a non-Free network service'; + $antifeatureDesctiption['nonfreeadd']['name'] = 'Non-Free Addons'; + $antifeatureDesctiption['nonfreeadd']['description'] = 'This application promotes non-Free add-ons'; + $antifeatureDesctiption['nonfreedep']['name'] = 'Non-Free Dependencies'; + $antifeatureDesctiption['nonfreedep']['description'] = 'This application depends on another non-Free application'; + + return $antifeatureDesctiption[strtolower($antifeature)]; + } + + function get_apps($query_vars) { $xml = simplexml_load_file($this->site_path."/repo/index.xml");