/** * Returns the type of an iso code: nr, 2, 3 * * @param string iso code * @return string iso code type */ public static function isoCodeType($isoCode) { $type = ''; $isoCodeAsInteger = tx_div2007_core::testInt($isoCode); if ($isoCodeAsInteger) { $type = 'nr'; } elseif (strlen($isoCode) == 2) { $type = '2'; } elseif (strlen($isoCode) == 3) { $type = '3'; } return $type; }
/** * Tests if the input can be interpreted as integer. * * @param mixed $var Any input variable to test * @return boolean Returns TRUE if string is an integer * @deprecated since TYPO3 4.6, will be removed in TYPO3 6.0 - Use t3lib_utility_Math::canBeInterpretedAsInteger() instead */ public static function testInt($var) { return tx_div2007_core::testInt($var); }
/** * Returns part of $sheetArray pointed to by the keys in $fieldNameArray * * @param array Multidimensiona array, typically FlexForm contents * @param array Array where each value points to a key in the FlexForms content - the input array will have the value returned pointed to by these keys. All integer keys will not take their integer counterparts, but rather traverse the current position in the array an return element number X (whether this is right behavior is not settled yet...) * @param string Value for outermost key, typ. "vDEF" depending on language. * @return mixed The value, typ. string. private */ function _getFFValueFromSheetArray($sheetArray, $fieldNameArr, $value) { $tempArr = $sheetArray; foreach ($fieldNameArr as $k => $v) { if (tx_div2007_core::testInt($v)) { if (is_array($tempArr)) { $c = 0; foreach ($tempArr as $values) { if ($c == $v) { $tempArr = $values; break; } $c++; } } } else { $tempArr = $tempArr[$v]; } } return $tempArr[$value]; }