Added a notice for apps with anti-features.

This commit is contained in:
Hans-Emil Skogh 2012-01-23 21:07:33 +01:00
parent 43d1e13a4f
commit dd1ff8b6d9

View file

@ -144,6 +144,8 @@ class FDroid
case "web": case "web":
$web=$el; $web=$el;
break; break;
case "antifeatures";
$antifeatures=$el;
case "package": case "package":
$thisapk=array(); $thisapk=array();
foreach($el->children() as $pel) { foreach($el->children() as $pel) {
@ -204,6 +206,15 @@ class FDroid
$out.="<p>".$desc."</p>"; $out.="<p>".$desc."</p>";
if(isset($antifeatures)) {
$antifeaturesArray = explode(',',$antifeatures);
foreach($antifeaturesArray as $antifeature) {
$antifeatureDesctiption = $this->get_antifeature_description($antifeature);
$out.='<p style="border:3px solid #CC0000;background-color:#FFDDDD;padding:5px;"><strong>'.$antifeatureDesctiption['name'].'</strong><br />';
$out.=$antifeatureDesctiption['description'].'</p>';
}
}
$out.="<p><b>License:</b> ".$license."</p>"; $out.="<p><b>License:</b> ".$license."</p>";
$out.="<p>"; $out.="<p>";
@ -390,6 +401,23 @@ class FDroid
return round($size,max(0,$i-1)).' '.$si_prefix[$i]; 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) { function get_apps($query_vars) {
$xml = simplexml_load_file($this->site_path."/repo/index.xml"); $xml = simplexml_load_file($this->site_path."/repo/index.xml");