Commit d43c35c1 authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added feature in TYpoScript data type "getText" to get values from GET arrays via "GPvar" key word. Now you can specify ".date = GPvar : tx_myext|mode|index" to get value of &tx_myext[mode][index]


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@227 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 48b99cda
2004-04-23 Kasper Skårhøj,,, <kasper@typo3.com>
* Added feature in TYpoScript data type "getText" to get values from GET arrays via "GPvar" key word. Now you can specify ".date = GPvar : tx_myext|mode|index" to get value of &tx_myext[mode][index]
2004-04-23 Kasper Skårhøj,,, <kasper@typo3.com>
* Added option "$TYPO3_CONF_VARS["GFX"]["gdlib_2"] = 'no_imagecopyresized_fix';" to avoid using the imagecopyresized workaround in stdgraphic class which has failed for some. Whether the workaround is needed anymore is not certain. Some people say it works fine without.
......
......@@ -4490,7 +4490,16 @@ class tslib_cObj {
if ((string)$key!='') {
switch(strtolower(trim($parts[0]))) {
case 'gpvar':
$retVal = t3lib_div::_GP($key);
list($firstKey, $rest) = explode('|', $key, 2);
if (strlen(trim($firstKey))) {
$retVal = t3lib_div::_GP(trim($firstKey));
// Look for deeper levels:
if (strlen(trim($rest))) {
$retVal = is_array($retVal) ? $this->getGlobal($rest, $retVal) : '';
}
// Check that output is not an array:
if (is_array($retVal)) $retVal = '';
}
break;
case 'tsfe':
$retVal = $GLOBALS['TSFE']->$key;
......@@ -4612,14 +4621,15 @@ class tslib_cObj {
* Example: $var = "HTTP_SERVER_VARS | something" will return the value $GLOBALS['HTTP_SERVER_VARS']['something'] value
*
* @param string Key, see description of functon
* @param array If you want another array that $GLOBALS used, then just put it in here!
* @return mixed Value from $GLOBALS
* @access private
* @see getData()
*/
function getGlobal($var) {
$vars = explode('|',$var);
function getGlobal($var, $source=NULL) {
$vars = explode('|', $var);
$c = count($vars);
$theVar = $GLOBALS[trim($vars[0])];
$theVar = isset($source) ? $source[trim($vars[0])] : $GLOBALS[trim($vars[0])];
for ($a=1;$a<$c;$a++) {
if (!isset($theVar)) {break;}
$theVar = $theVar[trim($vars[$a])];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment