. if (!defined('EG')) die('Direct access not allowed!'); class Distributions { public static $allowed = array( 'blag_90001' => 'BLAG 90001', 'blag_120000' => 'BLAG 120000', 'blag_140000' => 'BLAG 140000', 'dragora_1_1' => 'Dragora 1.1', 'dragora_2_0' => 'Dragora 2.0 Ardi', 'dragora_2_2' => 'Dragora 2.0 Rafaela', 'dynebolic_2_5_2' => 'Dyne:bolic 2.5.2 DHORUBA', 'dynebolic_3_0_X' => 'Dyne:III 3.0.X MUNIR', 'gnewsense_2_3' => 'gNewSense 2.3 Deltah', 'gnewsense_3_0' => 'gNewSense 3.0 Metad (beta)', 'gnewsense_3_0_parkes' => 'gNewSense 3.0 Parkes', 'musix_2_0' => 'Musix GNU+Linux 2.0 R0', 'parabola' => 'Parabola GNU/Linux', 'trisquel_3_5' => 'Trisquel 3.5 Awen', 'trisquel_4_0' => 'Trisquel 4.0 Taranis', 'trisquel_4_5' => 'Trisquel 4.5 Slaine', 'trisquel_5_0' => 'Trisquel 5.0 Dagda', 'trisquel_5_5' => 'Trisquel 5.5 Brigantia', 'trisquel_6_0' => 'Trisquel 6.0 Toutatis', 'ututo_xs_2009' => 'UTUTO XS 2009', 'ututo_xs_2010' => 'UTUTO XS 2010', 'ututo_xs_2012_04' => 'UTUTO XS 2012.04', 'venenux_0_8' => 'VENENUX 0.8', 'venenux_0_8_2' => 'VENENUX-EC 0.8.2', 'venenux_0_9' => 'VENENUX 0.9', ); public static function getList() { return implode(' , ',array_keys(self::$allowed)); } public static function getName($distList = '') { $returnString = null; $returnArray = array(); $distArray = explode(',',$distList); foreach ($distArray as $dist) { $dist = trim($dist); if (array_key_exists($dist,self::$allowed)) { $returnArray[] = self::$allowed[$dist]; } } return implode("
",$returnArray); } public static function check($distString) { $distArray = explode(',',$distString); $allowedArray = array_keys(self::$allowed); foreach ($distArray as $dist) { $dist = trim($dist); if (!in_array($dist,$allowedArray)) return false; } return true; } public static function getFormHtml() { $str = "
"; $str .= "
"; foreach (self::$allowed as $value => $label) { $str .= "
$label
"; } $str .= "
"; $str .= ""; $str .= ""; $str .= "
"; return $str; } }