[ Index ]
 

Code source de Typo3 4.1.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/t3lib/ -> class.t3lib_matchcondition.php (sommaire)

Contains class for Matching TypoScript conditions $Id: class.t3lib_matchcondition.php 2052 2007-02-20 17:00:18Z mundaun $ Revised for TYPO3 3.6 July/2003 by Kasper Skaarhoj

Author: Kasper Skaarhoj <kasperYYYY@typo3.com>
Poids: 707 lignes (22 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

t3lib_matchCondition:: (11 méthodes):
  __construct()
  t3lib_matchCondition()
  match()
  evalConditionStr()
  testNumber()
  matchWild()
  whichDevice()
  browserInfo()
  browserInfo_version()
  getGlobal()
  getGP_ENV_TSFE()


Classe: t3lib_matchCondition  - X-Ref

Matching TypoScript conditions

Used with the TypoScript parser.
Matches browserinfo, IPnumbers for use with templates

__construct()   X-Ref
Constructor for this class

return: void

t3lib_matchCondition()   X-Ref
Constructor for this class

return: void

match($condition_line)   X-Ref
Matching TS condition

param: string        Line to match
return: boolean        True if matched

evalConditionStr($string)   X-Ref
Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"

param: string        The condition to match against its criterias.
return: boolean        Returns true or false based on the evaluation.

testNumber($test,$value)   X-Ref
Will evaluate a $value based on an operator: "<", ">" or "=" (default)

param: string        The value to compare with on the form [operator][number]. Eg. "< 123"
param: integer        The number
return: boolean        If $value is "50" and $test is "< 123" then it will return true.

matchWild($haystack,$needle)   X-Ref
Matching two strings against each other, supporting a "*" wildcard or (if wrapped in "/") PCRE regular expressions

param: string        The string in which to find $needle.
param: string        The string to find in $haystack
return: boolean        Returns true if $needle matches or is found in (according to wildcards) in $haystack. Eg. if $haystack is "Netscape 6.5" and $needle is "Net*" or "Net*ape" then it returns true.

whichDevice($useragent)   X-Ref
Returns a code for a browsing device based on the input useragent string

param: string        User agent string from browser, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
return: string        A code. See link.

browserInfo($useragent)   X-Ref
Generates an array with abstracted browser information
This method is used in the function match() in this class

param: string        The useragent string, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
return: array        Contains keys "browser", "version", "system"

browserInfo_version($tmp)   X-Ref
Returns the version of a browser; Basically getting doubleval() of the input string, stripping of any non-numeric values in the beginning of the string first.

param: string        A string with version number, eg. "/7.32 blablabla"
return: double        Returns double value, eg. "7.32"

getGlobal($var, $source=NULL)   X-Ref
Return global variable where the input string $var defines array keys separated by "|"
Example: $var = "HTTP_SERVER_VARS | something" will return the value $GLOBALS['HTTP_SERVER_VARS']['something'] value

param: string        Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the GET parameter "id" back.
param: array        Alternative array than $GLOBAL to get variables from.
return: mixed        Whatever value. If none, then blank string.

getGP_ENV_TSFE($var)   X-Ref
Returns GP / ENV / TSFE vars

param: string        Identifier
return: mixed        The value of the variable pointed to.



Généré le : Sun Nov 25 17:13:16 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics