Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00034 class ilMetaTechnicalRequirement
00035 {
00036 var $ilias;
00037 var $type;
00038 var $name;
00039 var $min_version;
00040 var $max_version;
00041
00042
00049 function ilMetaTechnicalRequirement($a_type)
00050 {
00051 global $ilias;
00052
00053 $this->type = $a_type;
00054 }
00055
00061 function setType($a_type)
00062 {
00063 $this->type = $a_type;
00064 }
00065
00069 function getType()
00070 {
00071 return $this->type;
00072 }
00073
00082 function setName($a_name)
00083 {
00084 $this->name = $a_name;
00085 }
00086
00090 function getName()
00091 {
00092 return $this->name;
00093 }
00094
00100 function setMinVersion($a_min_version)
00101 {
00102 $this->min_version = $a_min_version;
00103 }
00104
00108 function getMinVersion()
00109 {
00110 return $this->min_version;
00111 }
00112
00118 function setMaxVersion($a_max_version)
00119 {
00120 $this->max_version = $a_max_version;
00121 }
00122
00126 function getMaxVersion()
00127 {
00128 return $this->max_version;
00129 }
00130
00131 function getXML()
00132 {
00133 $xml = "<Requirement>";
00134 $xml.= "<Type>";
00135
00136 $min = ($this->getMinVersion != "")
00137 ? "MinimumVersion=\"".$this->getMinVersion()."\""
00138 : "";
00139 $max = ($this->getMaxVersion != "")
00140 ? "MaximumVersion=\"".$this->getMaxVersion()."\""
00141 : "";
00142
00143 switch ($this->getType())
00144 {
00145 case "OperatingSystem":
00146 $xml.= "<OperatingSystem Name=\"".$this->getName()."\" $min $max>";
00147 break;
00148
00149 case "Browser":
00150 $xml.= "<Browser Name=\"".$this->getName()."\" $min $max>";
00151 break;
00152
00153 default:
00154 return false;
00155 }
00156
00157 $xml.= "</Type>";
00158 $xml.= "</Requirement>";
00159
00160 return $xml;
00161 }
00162
00163 }
00164 ?>