public function getDevice()
 {
     global $wgUser, $wgTitle;
     $platforms = MobileWikihow::getPlatformConfigs();
     $device = $platforms['iphoneapp'];
     if ($wgUser->getID() > 0) {
         $device['show-ads'] = false;
     } elseif (wikihowAds::adExclusions($wgTitle)) {
         $device['show-ads'] = false;
     }
     return $device;
 }
예제 #2
0
 /**
  * Returns properties of device that we need to abstract in certain causes.
  * Sort of functions like a poor man's WURFL database.
  */
 public static function getDevice()
 {
     global $wgRequest, $wgUser, $wgTitle;
     $platforms = self::getPlatformConfigs();
     $platform = $wgRequest->getVal('platform', self::DEFAULT_DEVICE);
     if (!isset($platforms[$platform])) {
         $platform = self::DEFAULT_DEVICE;
     }
     $device = $platforms[$platform];
     if ($wgUser->getID() > 0) {
         $device['show-ads'] = false;
     } elseif (wikihowAds::adExclusions($wgTitle)) {
         $device['show-ads'] = false;
     }
     return $device;
 }