Changeset 3621 for branches/2.2/phpgwapi/inc/class.browser.inc.php
- Timestamp:
- 12/22/10 15:39:15 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/phpgwapi/inc/class.browser.inc.php
r2 r3621 33 33 var $data; 34 34 35 const PLATFORM_WINDOWS = 'Win'; 36 const PLATFORM_MAC = 'Mac'; 37 const PLATFORM_LINUX = 'Linux'; 38 const PLATFORM_BEOS = 'Beos'; 39 const PLATFORM_IPHONE = 'iPhone'; 40 const PLATFORM_IPOD = 'iPod'; 41 const PLATFORM_IPAD = 'iPad'; 42 const PLATFORM_BLACKBERRY = 'BlackBerry'; 43 const PLATFORM_NOKIA = 'Nokia'; 44 const PLATFORM_ANDROID = 'Android'; 45 const PLATFORM_UNIX = 'Unix'; 46 35 47 function browser() 36 48 { … … 76 88 Determine platform 77 89 */ 78 if(strstr($HTTP_USER_AGENT,'Win')) 79 { 80 $this->BROWSER_PLATFORM='Win'; 81 } 90 if(strstr($HTTP_USER_AGENT,'iPad')) 91 { 92 $this->BROWSER_PLATFORM = self::PLATFORM_IPAD; 93 } 94 elseif(strstr($HTTP_USER_AGENT,'iPod')) 95 { 96 $this->BROWSER_PLATFORM = self::PLATFORM_IPOD; 97 } 98 elseif(strstr($HTTP_USER_AGENT,'iPhone')) 99 { 100 $this->BROWSER_PLATFORM = self::PLATFORM_IPHONE; 101 } 102 elseif(strstr($HTTP_USER_AGENT,'BlackBerry')) 103 { 104 $this->BROWSER_PLATFORM = self::PLATFORM_BLACKBERRY; 105 } 106 elseif(strstr($HTTP_USER_AGENT,'Android')) 107 { 108 $this->BROWSER_PLATFORM = self::PLATFORM_ANDROID; 109 } 110 elseif(strstr($HTTP_USER_AGENT,'Nokia')) 111 { 112 $this->BROWSER_PLATFORM = self::PLATFORM_NOKIA; 113 } 82 114 elseif(strstr($HTTP_USER_AGENT,'Mac')) 83 115 { 84 $this->BROWSER_PLATFORM='Mac'; 85 } 116 $this->BROWSER_PLATFORM = self::PLATFORM_MAC; 117 } 118 elseif(strstr($HTTP_USER_AGENT,'Win')) 119 { 120 $this->BROWSER_PLATFORM = self::PLATFORM_WINDOWS; 121 } 86 122 elseif(strstr($HTTP_USER_AGENT,'Linux')) 87 123 { 88 $this->BROWSER_PLATFORM ='Linux';124 $this->BROWSER_PLATFORM = self::PLATFORM_LINUX; 89 125 } 90 126 elseif(strstr($HTTP_USER_AGENT,'Unix')) 91 127 { 92 $this->BROWSER_PLATFORM ='Unix';128 $this->BROWSER_PLATFORM = self::PLATFORM_UNIX; 93 129 } 94 130 elseif(strstr($HTTP_USER_AGENT,'Beos')) 95 131 { 96 $this->BROWSER_PLATFORM ='Beos';132 $this->BROWSER_PLATFORM = self::PLATFORM_BEOS; 97 133 } 98 134 else … … 155 191 function is_linux() 156 192 { 157 if($this->get_platform()=='Linux') 158 { 159 return true; 160 } 161 else 162 { 163 return false; 164 } 193 return ($this->get_platform()==self::PLATFORM_LINUX); 165 194 } 166 195 167 196 function is_unix() 168 197 { 169 if($this->get_platform()=='Unix') 170 { 171 return true; 172 } 173 else 174 { 175 return false; 176 } 198 return ($this->get_platform()==self::PLATFORM_UNIX); 177 199 } 178 200 179 201 function is_beos() 180 202 { 181 if($this->get_platform()=='Beos') 182 { 183 return true; 184 } 185 else 186 { 187 return false; 188 } 203 return ($this->get_platform()==self::PLATFORM_BEOS); 189 204 } 190 205 191 206 function is_mac() 192 207 { 193 if($this->get_platform()=='Mac') 194 { 195 return true; 196 } 197 else 198 { 199 return false; 200 } 208 return ($this->get_platform()==self::PLATFORM_MAC); 201 209 } 202 210 203 211 function is_windows() 204 212 { 205 if($this->get_platform()=='Win') 206 { 207 return true; 208 } 209 else 210 { 211 return false; 212 } 213 return ($this->get_platform()==self::PLATFORM_WINDOWS); 214 } 215 216 function is_ipad() 217 { 218 return ($this->get_platform()==self::PLATFORM_IPAD); 219 } 220 221 function is_iphone() 222 { 223 return ($this->get_platform()==self::PLATFORM_IPHONE); 224 } 225 226 function is_nokia() 227 { 228 return ($this->get_platform()==self::PLATFORM_NOKIA); 229 } 230 231 function is_ipod() 232 { 233 return ($this->get_platform()==self::PLATFORM_IPOD); 234 } 235 236 function is_blackberry() 237 { 238 return ($this->get_platform()==self::PLATFORM_BLACKBERRY); 239 } 240 241 function is_android() 242 { 243 return ($this->get_platform()==self::PLATFORM_ANDROID); 213 244 } 214 245
Note: See TracChangeset
for help on using the changeset viewer.