Changeset 21962 for branches/version-2_12-dev/data
- Timestamp:
- 2012/07/09 08:53:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_Display.php
r21925 r21962 130 130 131 131 /** 132 * 機種を判別する。132 * Detect the viewing device. 133 133 * 134 * SC_Display::MOBILE = ガラケー= 1135 * SC_Display::SMARTPHONE = スマホ= 2134 * SC_Display::MOBILE = k-tai = 1 135 * SC_Display::SMARTPHONE = smart phone = 2 136 136 * SC_Display::PC = PC = 10 137 137 * 138 138 * @static 139 * @return integer 端末種別ID 139 * @param $reset boolean 140 * @return integer Device Type ID 140 141 */ 141 function detectDevice() { 142 $nu = new Net_UserAgent_Mobile(); 143 $su = new SC_SmartphoneUserAgent_Ex(); 144 if ($nu->isMobile()) { 145 return DEVICE_TYPE_MOBILE; 146 } elseif ($su->isSmartphone()) { 147 return DEVICE_TYPE_SMARTPHONE; 148 } else { 149 return DEVICE_TYPE_PC; 142 public static function detectDevice($reset = FALSE) { 143 if (empty(SC_Display_Ex::$device) || $reset) { 144 $nu = new Net_UserAgent_Mobile(); 145 $su = new SC_SmartphoneUserAgent_Ex(); 146 if ($nu->isMobile()) { 147 SC_Display_Ex::$device = DEVICE_TYPE_MOBILE; 148 } elseif ($su->isSmartphone()) { 149 SC_Display_Ex::$device = DEVICE_TYPE_SMARTPHONE; 150 } else { 151 SC_Display_Ex::$device = DEVICE_TYPE_PC; 152 } 150 153 } 154 return SC_Display_Ex::$device; 151 155 } 152 156
Note: See TracChangeset
for help on using the changeset viewer.