[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/ -> Browser.php (sommaire)

(pas de description)

Poids: 1100 lignes (37 kb)
Inclus ou requis: 2 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Browser:: (29 méthodes):
  singleton()
  Browser()
  match()
  _setPlatform()
  getPlatform()
  setBrowser()
  isBrowser()
  isMobile()
  isRobot()
  getBrowser()
  getMajor()
  getMinor()
  getVersion()
  getAgentString()
  setQuirk()
  hasQuirk()
  getQuirk()
  setFeature()
  hasFeature()
  getFeature()
  usingSSLConnection()
  getHTTPProtocol()
  allowFileUploads()
  wasFileUploaded()
  downloadHeaders()
  isViewable()
  escapeJSCode()
  setIEVersion()
  getIEVersion()


Classe: Browser  - X-Ref

The Browser:: class provides capability information for the current
web client.

Browser identification is performed by examining the HTTP_USER_AGENT
environment variable provided by the web server.

$Horde: framework/Browser/Browser.php,v 1.153.2.47 2006/07/17 09:52:00 jan Exp $

Copyright 1999-2006 Chuck Hagenbuch <chuck@horde.org>
Copyright 1999-2006 Jon Parise <jon@horde.org>

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

singleton($userAgent = null, $accept = null)   X-Ref
Returns a reference to the global Browser object, only creating it
if it doesn't already exist.

This method must be invoked as:<pre>
$browser = &Browser::singleton([$userAgent[, $accept]]);</pre>

param: string $userAgent  The browser string to parse.
param: string $accept     The HTTP_ACCEPT settings to use.
return: Browser  The Browser object.

Browser($userAgent = null, $accept = null)   X-Ref
Create a browser instance (Constructor).

param: string $userAgent  The browser string to parse.
param: string $accept     The HTTP_ACCEPT settings to use.

match($userAgent = null, $accept = null)   X-Ref
Parses the user agent string and inititializes the object with
all the known features and quirks for the given browser.

param: string $userAgent  The browser string to parse.
param: string $accept     The HTTP_ACCEPT settings to use.

_setPlatform()   X-Ref
Match the platform of the browser.

This is a pretty simplistic implementation, but it's intended
to let us tell what line breaks to send, so it's good enough
for its purpose.


getPlatform()   X-Ref
Return the currently matched platform.

return: string  The user's platform.

setBrowser($browser)   X-Ref
Sets the current browser.

param: string $browser  The browser to set as current.

isBrowser($browser)   X-Ref
Determine if the given browser is the same as the current.

param: string $browser  The browser to check.
return: boolean  Is the given browser the same as the current?

isMobile()   X-Ref
Do we consider the current browser to be a mobile device?

return: boolean  True if we do, false if we don't.

isRobot()   X-Ref
Determines if the browser is a robot or not.

return: boolean  True if browser is a known robot.

getBrowser()   X-Ref
Retrieve the current browser.

return: string  The current browser.

getMajor()   X-Ref
Retrieve the current browser's major version.

return: integer  The current browser's major version.

getMinor()   X-Ref
Retrieve the current browser's minor version.

return: integer  The current browser's minor version.

getVersion()   X-Ref
Retrieve the current browser's version.

return: string  The current browser's version.

getAgentString()   X-Ref
Return the full browser agent string.

return: string  The browser agent string.

setQuirk($quirk, $value = true)   X-Ref
Set unique behavior for the current browser.

param: string $quirk  The behavior to set.
param: string $value  Special behavior parameter.

hasQuirk($quirk)   X-Ref
Check unique behavior for the current browser.

param: string $quirk  The behavior to check.
return: boolean  Does the browser have the behavior set?

getQuirk($quirk)   X-Ref
Retrieve unique behavior for the current browser.

param: string $quirk  The behavior to retrieve.
return: string  The value for the requested behavior.

setFeature($feature, $value = true)   X-Ref
Set capabilities for the current browser.

param: string $feature  The capability to set.
param: string $value    Special capability parameter.

hasFeature($feature)   X-Ref
Check the current browser capabilities.

param: string $feature  The capability to check.
return: boolean  Does the browser have the capability set?

getFeature($feature)   X-Ref
Retrieve the current browser capability.

param: string $feature  The capability to retrieve.
return: string  The value of the requested capability.

usingSSLConnection()   X-Ref
Determine if we are using a secure (SSL) connection.

return: boolean  True if using SSL, false if not.

getHTTPProtocol()   X-Ref
Returns the server protocol in use on the current server.

return: string  The HTTP server protocol version.

allowFileUploads()   X-Ref
Determine if files can be uploaded to the system.

return: integer  If uploads allowed, returns the maximum size of the

wasFileUploaded($field, $name = null)   X-Ref
Determines if the file was uploaded or not.  If not, will return the
appropriate error message.

param: string $field  The name of the field containing the uploaded
param: string $name   The file description string to use in the error
return: mixed  True on success, PEAR_Error on error.

downloadHeaders($filename = 'unknown', $cType = null,$inline = false, $cLength = null)   X-Ref
Returns the headers for a browser download.

param: string $filename  The filename of the download.
param: string $cType     The content-type description of the file.
param: boolean $inline   True if inline, false if attachment.
param: string $cLength   The content-length of this file.

isViewable($mimetype)   X-Ref
Determines if a browser can display a given MIME type.

param: string $mimetype  The MIME type to check.
return: boolean  True if the browser can display the MIME type.

escapeJSCode($code)   X-Ref
Escape characters in javascript code if the browser requires it.
%23, %26, and %2B (for some browsers) and %27 need to be escaped or
else javascript will interpret it as a single quote, pound sign, or
ampersand and refuse to work.

param: string $code  The JS code to escape.
return: string  The escaped code.

setIEVersion($ver)   X-Ref
Set the IE version in the session.

param: string $ver  The IE Version string.

getIEVersion()   X-Ref
Return the IE version stored in the session, if available.

return: mixed  The IE Version string or null if no string is stored.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7