/** * Load a local lang from a file. * merging with the existing local lang * * @param string $filename * * @return void */ public function loadLLFile($filename) { if (!$filename) { return; } // Find language file $basePath = tx_rnbase_util_Files::getFileAbsFileName($filename); // php or xml as source: In any case the charset will be that of the system language. // However, this function guarantees only return output for default language plus the specified language (which is different from how 3.7.0 dealt with it) $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); self::addLang($utility::readLLfile($basePath, self::getLLKey(), $GLOBALS['TSFE']->renderCharset)); if ($llKey = self::getLLKey(TRUE)) { self::addLang($utility::readLLfile($basePath, $llKey, $GLOBALS['TSFE']->renderCharset)); } }
/** * Erzeugt anhand von einer URL hidden Felder, welche mit übergeben werden. * Dabei werden die Get-Parameter aus der Action URL entfernt. * Das ist wichtig, wenn das Formular mit GET abgeschickt wird * und die Action URL bereits GET Parameter enthält. * Die in der URL enthaltenen Parameter gehen verloren! * * @author Michael Wagner * @param string $url * @return string */ public static function getHiddenFieldsForUrlParams($url) { $sysHidden = ''; $params = array(); if (strpos($url, '?') !== FALSE) { $params = substr($url, strpos($url, '?') + 1); $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); $params = $utility::explodeUrl2Array($params); $url = substr($url, 0, strpos($url, '?')); } foreach ($params as $name => $value) { $name = tx_rnbase_util_Strings::removeXSS($name); $value = tx_rnbase_util_Strings::removeXSS($value); $sysHidden .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />'; } return $sysHidden; }
/** * Wrapper method for t3lib_div::devLog() or \TYPO3\CMS\Core\Utility\GeneralUtility::devLog() * * @param string $msg Message (in english). * @param string $extKey Extension key (from which extension you are calling the log) * @param integer $severity Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message * @param mixed $dataVar Additional data you want to pass to the logger. * @return void */ public static function devLog($msg, $extKey, $severity = 0, $dataVar = FALSE) { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); $utility::devLog($msg, $extKey, $severity, $dataVar); }
/** * Wrapper method for t3lib_div::logDeprecatedFunction() or \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction() * * @return void */ public static function logDeprecatedFunction() { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); $utility::logDeprecatedFunction(); }
/** * constructor to log deprecation! * * @return void */ function __construct() { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); $utility::deprecationLog('Usage of "Tx_Rnbase_Util_TCATool" is deprecated' . 'Please use "Tx_Rnbase_Utility_TcaTool" instead!'); }
/** * (non-PHPdoc) * @see t3lib_div::isAllowedAbsPath() * @see TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedAbsPath() * * @param string $path File path to evaluate * @return bool */ public static function isAllowedAbsPath($path) { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return $utility::isAllowedAbsPath($path); }
/** * * @param Tx_Rnbase_Domain_Model_DataInterface $options * @param Tx_Rnbase_Domain_Model_Base $obj * @param tx_rnbase_util_FormTool $formTool * @return string */ private static function addLinker($options, $obj, $formTool) { $out = ''; $linkerArr = $options->getLinker(); if ((is_array($linkerArr) || $linkerArr instanceof Traversable) && !empty($linkerArr)) { $linkerimplode = $options->getLinkerimplode() ? $options->getLinkerimplode() : '<br />'; $currentPid = (int) $options->getPid(); foreach ($linkerArr as $linker) { if (!$linker instanceof tx_rnbase_mod_LinkerInterface) { // backward compatibility, the interface with the makeLink method is new! if (!is_callable(array($linker, 'makeLink'))) { throw new Exception('Linker "' . get_class($linker) . '" has to implement interface "tx_rnbase_mod_LinkerInterface".'); } $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); $utility::deprecationLog('Linker "' . get_class($linker) . '" has to implement interface "tx_rnbase_mod_LinkerInterface".'); } $out .= $linker->makeLink($obj, $formTool, $currentPid, $options); $out .= $linkerimplode; } } return $out; }
/** * Load a t3 class and make an instance * * Returns ux_ extension classname if any by, making use of t3lib_div::makeInstanceClassName * * @param string classname * @param string extension key that varies from classnames * @param string prefix of classname * @param string ending of classname * @return string classname or ux_ classname * @see t3lib_div::makeInstanceClassName * @see load() */ private static function makeInstanceClassNameT3($class, $alternativeKey = '', $prefix = 'class.', $suffix = '.php') { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return self::loadT3($class, $alternativeKey, $prefix, $suffix) ? $utility::makeInstanceClassName($class) : FALSE; }
/** * @see t3lib_div::locationHeaderUrl() * @see TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl() * * @param string $path URL / path to prepend full URL addressing to. * @return string */ public static function locationHeaderUrl($path) { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return $utility::locationHeaderUrl($path); }
/** * Returns the global $_POST array (or value from) normalized. * * @param string $var * * @see t3lib_div::_POST * @see \TYPO3\CMS\Core\Utility\GeneralUtility::_POST * * @return mixed */ public static function getPostParameters($var = NULL) { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return $utility::_POST($var); }
/** * Calculates the ImageGraph output filename/path based on a serialized, hashed value of $arrConf * * @param string Filename prefix, eg. "ImageGraph/" * @param array TS Configuration of the image * @param string Filename extension, eg. "png" * @return string The relative filepath (relative to PATH_site) * @access private */ private function getFileName($strPre, $arrConf, $strExtension) { $tempPath = 'typo3temp/'; // Path to the temporary directory $data = serialize($this->getDataProvider()) . serialize($arrConf); $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return $tempPath . $strPre . $utility::shortMD5($data) . '.' . $strExtension; }
/** * Returns the host of the message * * @return string */ public function getHost() { $host = $this->getProperty('host'); if (empty($host)) { $utility = \tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); $host = $utility::getIndpEnv('TYPO3_HOST_ONLY'); } if (empty($host)) { $host = gethostname(); } return $host; }
/** * @see t3lib_div::linkThisScript * @see \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript * * @param array $getParams Array of GET parameters to include * @return string */ public static function linkThisScript(array $getParams = array()) { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return $utility::linkThisScript($getParams); }
/** * Calls a user-defined function/method in class * Such a function/method should look like this: * "function proc(&$params, &$ref) {...}" * * @param string $funcName Function/Method reference or Closure * @param mixed $params Parameters to be pass along (REFERENCE!) * @param mixed $ref Reference to be passed along (REFERENCE!) * @param string $checkPrefix Not used anymore since 6.0 * @param int $errorMode Error mode * * @return mixed Content from call or FALSE */ public static function callUserFunction($funcName, &$params, &$ref, $checkPrefix = '', $errorMode = 0) { $util = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return $util::callUserFunction($funcName, $params, $ref, $checkPrefix, $errorMode); }
/** * @see \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array * @see t3lib_div::xml2array * * @param string $string XML content to convert into an array * @param string $NSprefix The tag-prefix resolve, eg. a namespace like "T3:" * @param boolean $reportDocTag If set, the document tag will be set in the key "_DOCUMENT_TAG" of the output array * @return mixed If the parsing had errors, a string with the error message is returned. Otherwise an array with the content. * @see array2xml(),xml2arrayProcess() */ public static function xml2array($string, $NSprefix = '', $reportDocTag = FALSE) { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); return $utility::xml2array($string, $NSprefix, $reportDocTag); }
/** * constructor to log deprecation! * * @return void */ function __construct() { $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(); $utility::deprecationLog('Usage of "Tx_Rnbase_Repository_AbstractRepository" is deprecated' . 'Please use "Tx_Rnbase_Domain_Repository_AbstractRepository" instead!'); }
/** * @return void */ protected function resetIndependentEnvironmentCache() { if (tx_rnbase_util_TYPO3::isTYPO76OrHigher()) { $property = new ReflectionProperty(tx_rnbase_util_Typo3Classes::getGeneralUtilityClass(), 'indpEnvCache'); $property->setAccessible(TRUE); $property->setValue(NULL, array()); } }