mobile.php File Reference

Go to the source code of this file.

Namespaces

namespace  MythWeb

Functions

 isMobileUser ()
 Return true if the user agent is mobile device.
 getScreenSize ()
 Return the screen size of the mobile user agent.
 browserAcceptsMediaType ($mediaTypes)
 Check if the browser accepts any of the media types given in the parameter array.
 getScreenWidth ()
 Return the width of the screen in pixels.
 getScreenHeight ()
 Return the height of the screen in pixels.


Function Documentation

isMobileUser (  ) 

Return true if the user agent is mobile device.

Otherwise return false. The user agent is determined based on the return value of getScreenSize() which is false if the user agent is not a mobile device.

Returns:
true or false

Definition at line 43 of file mobile.php.

getScreenSize (  ) 

Return the screen size of the mobile user agent.

This can be used to do very detailed modifications to the web site's layout for the mobile user agents. If the user is not regocnized to be a mobile device then return false. If the user is a known mobile device but the screen size is unknown then return an empty array. Mobile users are detected based on $_SERVER['HTTP_USER_AGENT'] and a list of known mobile user agent identification strings.

Returns:
array(width, height) or false

Definition at line 58 of file mobile.php.

browserAcceptsMediaType ( mediaTypes  ) 

Check if the browser accepts any of the media types given in the parameter array.

The media types can be either in the form of 'text/html' or just 'html'. All parameter values are turned upper case.

Returns:
true if the browser accepts any of the media types, false if none, and null if $mediaTypes is not an array

Definition at line 174 of file mobile.php.

getScreenWidth (  ) 

Return the width of the screen in pixels.

Meant to be called if isMobileUser() returns true. See also getScreensize().

Returns:
width of the screen in pixels if known or null

Definition at line 190 of file mobile.php.

getScreenHeight (  ) 

Return the height of the screen in pixels.

Meant to be called if isMobileUser() returns true. See also getScreensize().

Returns:
height of the screen in pixels

Definition at line 202 of file mobile.php.


Generated on Sat Dec 18 05:15:53 2010 for MythTV by  doxygen 1.5.5