/** * Constructor: * initializes locking, check input parameters and set variables accordingly. * * Parameters $loops and $step only apply to the locking method LOCKING_METHOD_SIMPLE. * * @param string $id ID to identify this lock in the system * @param string $method Define which locking method to use. Use one of the LOCKING_METHOD_* constants. Defaults to LOCKING_METHOD_SIMPLE. Use '' to use setting from Install Tool. * @param int $loops Number of times a locked resource is tried to be acquired. * @param int $step Milliseconds after lock acquire is retried. $loops * $step results in the maximum delay of a lock. * @throws \RuntimeException * @throws \InvalidArgumentException * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8 */ public function __construct($id, $method = self::LOCKING_METHOD_SIMPLE, $loops = 0, $step = 0) { GeneralUtility::logDeprecatedFunction(); // Force ID to be string $id = (string) $id; if ((int) $loops) { $this->loops = (int) $loops; } if ((int) $step) { $this->step = (int) $step; } if ($method === '' && isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['lockingMode'])) { $method = (string) $GLOBALS['TYPO3_CONF_VARS']['SYS']['lockingMode']; } switch ($method) { case self::LOCKING_METHOD_SIMPLE: // intended fall through // intended fall through case self::LOCKING_METHOD_FLOCK: $this->id = md5($id); $this->createPathIfNeeded(); break; case self::LOCKING_METHOD_SEMAPHORE: $this->id = abs(crc32($id)); break; case self::LOCKING_METHOD_DISABLED: break; default: throw new \InvalidArgumentException('No such locking method "' . $method . '"', 1294586097); } $this->method = $method; }
/** * Returns a selector box with charset encodings * * @deprecated since 6.0, will be removed two versions later - Language pack should be re-created * * @param string $elementName it the form elements name, probably something like "SET[...]" * @param string $currentKey is the key to be selected currently. * @param string $firstEntry is the key to be placed on top as first (default) entry. * @param string $unsetEntries List of keys that should be removed (comma list). * @return string HTML code for selector box */ function getEncodingSelect($elementName, $currentKey, $firstEntry = '', $unsetEntries = '') { \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(); $menuItems = array('utf-8' => 'UTF-8'); if ($firstEntry && $menuItems[$firstEntry]) { $entry = array($firstEntry => $menuItems[$firstEntry]); unset($menuItems[$firstEntry]); $menuItems = array_merge($entry, $menuItems); } $unsetEntries = explode(',', $unsetEntries); foreach ($unsetEntries as $entry) { unset($menuItems[$entry]); } $options = array(); foreach ($menuItems as $value => $label) { $options[] = '<option value="' . htmlspecialchars($value) . '"' . (!strcmp($currentKey, $value) ? ' selected="selected"' : '') . '>' . \TYPO3\CMS\Core\Utility\GeneralUtility::deHSCentities(htmlspecialchars($label)) . '</option>'; } if (count($options)) { return ' <!-- charset encoding menu --> <select name="' . $elementName . '"> ' . implode(' ', $options) . ' </select> '; } }
/** * Escapes special characters with their escaped counterparts as needed. * * @param string $value * @param string $type The type, one of html, entities, url * @param string $encoding * @return string the altered string. */ public function render($value = NULL, $type = 'html', $encoding = NULL) { \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction('<f:escape> is deprecated. Please use the <f:format.*> ViewHelpers instead.'); if ($value === NULL) { $value = $this->renderChildren(); } if (!is_string($value)) { return $value; } if ($encoding === NULL) { $encoding = $this->resolveDefaultEncoding(); } switch ($type) { case 'html': return htmlspecialchars($value, ENT_COMPAT, $encoding); break; case 'entities': return htmlentities($value, ENT_COMPAT, $encoding); break; case 'url': return rawurlencode($value); default: return $value; break; } }
/** * Gets instance of PageRenderer * * @return PageRenderer * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 */ public function getPageRenderer() { GeneralUtility::logDeprecatedFunction(); if (!isset($this->pageRenderer)) { $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); } return $this->pageRenderer; }
/** * Create a flash message for a file that is marked as missing * * @param AbstractFile $file * @return FlashMessage * @deprecated since TYPO3 v8, will be removed in TYPO3 v9 */ public static function getFlashMessageForMissingFile(AbstractFile $file) { GeneralUtility::logDeprecatedFunction(); /** @var LanguageService $lang */ $lang = $GLOBALS['LANG']; /** @var FlashMessage $flashMessage */ $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing_text') . ' <abbr title="' . htmlspecialchars($file->getStorage()->getName() . ' :: ' . $file->getIdentifier()) . '">' . htmlspecialchars($file->getName()) . '</abbr>', $lang->sL('LLL:EXT:lang/locallang_core.xlf:warning.file_missing'), FlashMessage::ERROR); return $flashMessage; }
/** * Returns an icon image tag, 18x16 pixels, based on input information. * This function is recommended to use in your backend modules. * * @param string $table The table name * @param array $row The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!) * @param string $backPath The backpath to the main TYPO3 directory (relative path back to PATH_typo3) * @param string $params Additional attributes for the image tag * @param boolean $shaded If set, the icon will be grayed/shaded * @return string <img>-tag * @see getIcon() * @deprecated since TYPO3 6.1 will be removed in 7.0, should not be used anymore as only sprite icons are used since TYPO3 4.4 */ public static function getIconImage($table, $row = array(), $backPath, $params = '', $shaded = FALSE) { GeneralUtility::logDeprecatedFunction(); $str = '<img' . self::skinImg($backPath, self::getIcon($table, $row, $shaded), 'width="18" height="16"') . (trim($params) ? ' ' . trim($params) : ''); if (!stristr($str, 'alt="')) { $str .= ' alt=""'; } $str .= ' />'; return $str; }
/** * Constructor, initializes several variables * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, not in use, as everything can be done via the ModuleMenuRepository directly */ public function __construct() { GeneralUtility::logDeprecatedFunction(); if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) { $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xlf'); } $this->backPath = ''; $this->linkModules = true; // Loads the backend modules available for the logged in user. $this->moduleLoader = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Module\ModuleLoader::class); $this->moduleLoader->observeWorkspaces = true; $this->moduleLoader->load($GLOBALS['TBE_MODULES']); $this->loadedModules = $this->moduleLoader->modules; }
/** * Main content generated * * @return void * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 */ public function main() { GeneralUtility::logDeprecatedFunction(); $GLOBALS['TBE_TEMPLATE']->divClass = ''; $this->content .= $this->getDocumentTemplate()->startPage('List Frame Loader'); $this->content .= $this->getDocumentTemplate()->wrapScriptTags(' var theUrl = top.getModuleUrl(""); if (theUrl) window.location.href=theUrl; '); // End page: $this->content .= $this->getDocumentTemplate()->endPage(); // Output: echo $this->content; }
/** * Prints the palette in the frontend editing (forms-on-page?) * * @param array $paletteArray The palette array to print * @return string HTML output * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 */ public function printPalette(array $paletteArray) { GeneralUtility::logDeprecatedFunction(); $out = ''; $bgColor = ' bgcolor="#D6DAD0"'; foreach ($paletteArray as $content) { $hRow[] = '<td' . $bgColor . '><font face="verdana" size="1"> </font></td><td nowrap="nowrap"' . $bgColor . '><font color="#666666" face="verdana" size="1">' . $content['NAME'] . '</font></td>'; $iRow[] = '<td valign="top">' . '<img name="req_' . $content['TABLE'] . '_' . $content['ID'] . '_' . $content['FIELD'] . '" src="clear.gif" width="10" height="10" alt="" /></td><td nowrap="nowrap" valign="top">' . $content['ITEM'] . $content['HELP_ICON'] . '</td>'; } $out = '<table border="0" cellpadding="0" cellspacing="0"> <tr><td><img src="clear.gif" width="1" height="1" alt="" /></td>' . implode('', $hRow) . '</tr> <tr><td></td>' . implode('', $iRow) . '</tr> </table>'; return $out; }
/** * Proxy for the PHP mail() function. Adds possibility to hook in and send the mails in a different way. * The hook can be used by adding function to the configuration array: * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'] * * @param string $to Email address to send to. * @param string $subject Subject line, non-encoded. (see PHP function mail()) * @param string $messageBody Message content, non-encoded. (see PHP function mail()) * @param string $additionalHeaders Additional headers for the mail (see PHP function mail()) * @param string $additionalParameters Additional flags for the sending mail tool (see PHP function mail()) * @return boolean Indicates whether the mail has been sent or not * @see PHP function mail() [] * @link http://www.php.net/manual/en/function.mail.php * @deprecated since 6.1, will be removed two versions later - Use \TYPO3\CMS\Core\Mail\Mailer instead */ public static function mail($to, $subject, $messageBody, $additionalHeaders = NULL, $additionalParameters = NULL) { GeneralUtility::logDeprecatedFunction(); $success = TRUE; // If the mail does not have a From: header, fall back to the default in TYPO3_CONF_VARS. if (!preg_match('/^From:/im', $additionalHeaders) && $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress']) { if (!is_null($additionalHeaders) && substr($additionalHeaders, -1) != LF) { $additionalHeaders .= LF; } if ($GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName']) { $additionalHeaders .= 'From: "' . $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName'] . '" <' . $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'] . '>'; } else { $additionalHeaders .= 'From: ' . $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress']; } } if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'])) { $parameters = array('to' => $to, 'subject' => $subject, 'messageBody' => $messageBody, 'additionalHeaders' => $additionalHeaders, 'additionalParameters' => $additionalParameters); $fakeThis = FALSE; foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'] as $hookSubscriber) { $hookSubscriberContainsArrow = strpos($hookSubscriber, '->'); if ($hookSubscriberContainsArrow !== FALSE) { throw new \RuntimeException($hookSubscriber . ' is an invalid hook implementation. Please consider using an implementation of TYPO3\\CMS\\Core\\Mail\\MailerAdapter.', 1322287600); } else { $mailerAdapter = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($hookSubscriber); if ($mailerAdapter instanceof \TYPO3\CMS\Core\Mail\MailerAdapterInterface) { $success = $success && $mailerAdapter->mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters, $fakeThis); } else { throw new \RuntimeException($hookSubscriber . ' is not an implementation of TYPO3\\CMS\\Core\\Mail\\MailerAdapter, but must implement that interface to be used in the substituteMailDelivery hook.', 1294062286); } } } } else { if (is_null($additionalParameters)) { $success = @mail($to, $subject, $messageBody, $additionalHeaders); } else { $success = @mail($to, $subject, $messageBody, $additionalHeaders, $additionalParameters); } } if (!$success) { \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog('Mail to "' . $to . '" could not be sent (Subject: "' . $subject . '").', 'Core', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR); } return $success; }
/** * Set workspace * * @param $parameter * @return array * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, not in use anymore */ public function setWorkspace($parameter) { \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(); $workspaceId = (int) $parameter->workSpaceId; $pageId = (int) $parameter->pageId; $GLOBALS['BE_USER']->setWorkspace($workspaceId); while ($pageId) { $page = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages', $pageId, '*', ' AND pages.t3ver_wsid IN (0, ' . $workspaceId . ')'); if ($page) { if ($GLOBALS['BE_USER']->doesUserHaveAccess($page, 1)) { break; } } else { $page = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $pageId); } $pageId = $page['pid']; } return array('title' => \TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($workspaceId), 'id' => $workspaceId, 'page' => isset($page['uid']) && $parameter->pageId == $page['uid'] ? NULL : (int) $page['uid']); }
/** * @param array $arguments * @param callable $renderChildrenClosure * @param RenderingContextInterface $renderingContext * @return string * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use \TYPO3\CMS\Core\ViewHelpers\IconViewHelper instead */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { GeneralUtility::logDeprecatedFunction(); $uri = $arguments['uri']; $icon = $arguments['icon']; $title = $arguments['title']; $additionalAttributes = $arguments['additionalAttributes']; $additionalTagAttributes = ''; $iconFactory = GeneralUtility::makeInstance(IconFactory::class); $icon = '<span title="' . htmlspecialchars($title) . '">' . $iconFactory->getIcon($icon, Icon::SIZE_SMALL)->render() . '</span>'; if (empty($uri)) { return $icon; } if ($additionalAttributes) { foreach ($additionalAttributes as $argumentKey => $argumentValue) { $additionalTagAttributes .= ' ' . $argumentKey . '="' . htmlspecialchars($argumentValue) . '"'; } } return '<a href="' . $uri . '"' . $additionalTagAttributes . '>' . $icon . '</a>'; }
/** * Move content element to a position and/or column. * * Function is called from the Page module javascript. * * @param int $sourceElement Id attribute of content element which must be moved * @param string $destinationColumn Column to move the content element to * @param int $destinationElement Id attribute of the element it was dropped on * @return array * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 */ public function moveContentElement($sourceElement, $destinationColumn, $destinationElement) { GeneralUtility::logDeprecatedFunction(); $moveElementUid = 0; $afterElementUid = -1; $targetColumn = 0; $targetPage = 0; list($_, $table, $uid) = GeneralUtility::trimExplode('-', $sourceElement); if ($table === 'tt_content' && MathUtility::canBeInterpretedAsInteger($uid)) { $moveElementUid = (int) $uid; } list($_, $table, $uid) = GeneralUtility::trimExplode('-', $destinationElement); if ($table === 'tt_content' && MathUtility::canBeInterpretedAsInteger($uid)) { $afterElementUid = (int) $uid; } else { // it's dropped in an empty column $afterElementUid = -1; } list($prefix, $column, $prefix2, $page, $_) = GeneralUtility::trimExplode('-', $destinationColumn); if ($prefix === 'colpos' && MathUtility::canBeInterpretedAsInteger($column) && $prefix2 === 'page' && MathUtility::canBeInterpretedAsInteger($page)) { $targetColumn = (int) $column; $targetPage = (int) $page; } // move to empty column if ($afterElementUid === -1) { $action['cmd']['tt_content'][$moveElementUid]['move'] = $targetPage; } else { $action['cmd']['tt_content'][$moveElementUid]['move'] = -$afterElementUid; } $action['data']['tt_content'][$moveElementUid]['colPos'] = $targetColumn; GeneralUtility::devLog('Dragdrop', 'core', -1, array('action' => $action, 'sourceElement' => $sourceElement, 'destinationColumn' => $destinationColumn, 'destinationElement' => $destinationElement)); /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */ $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class); $tce->stripslashes_values = 0; $tce->start($action['data'], $action['cmd']); $tce->process_datamap(); $tce->process_cmdmap(); return array('success' => true); }
/** * Takes the last part of a query, eg. "... uid=123 GROUP BY title ORDER BY title LIMIT 5,2" and splits each part into a table (WHERE, GROUPBY, ORDERBY, LIMIT) * Work-around function for use where you know some userdefined end to an SQL clause is supplied and you need to separate these factors. * * @param string $str Input string * @return array * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 */ public function splitGroupOrderLimit($str) { GeneralUtility::logDeprecatedFunction(); // Prepending a space to make sure "[[:space:]]+" will find a space there // for the first element. $str = ' ' . $str; // Init output array: $wgolParts = array('WHERE' => '', 'GROUPBY' => '', 'ORDERBY' => '', 'LIMIT' => ''); // Find LIMIT $reg = array(); if (preg_match('/^(.*)[[:space:]]+LIMIT[[:space:]]+([[:alnum:][:space:],._]+)$/i', $str, $reg)) { $wgolParts['LIMIT'] = trim($reg[2]); $str = $reg[1]; } // Find ORDER BY $reg = array(); if (preg_match('/^(.*)[[:space:]]+ORDER[[:space:]]+BY[[:space:]]+([[:alnum:][:space:],._]+)$/i', $str, $reg)) { $wgolParts['ORDERBY'] = trim($reg[2]); $str = $reg[1]; } // Find GROUP BY $reg = array(); if (preg_match('/^(.*)[[:space:]]+GROUP[[:space:]]+BY[[:space:]]+([[:alnum:][:space:],._]+)$/i', $str, $reg)) { $wgolParts['GROUPBY'] = trim($reg[2]); $str = $reg[1]; } // Rest is assumed to be "WHERE" clause $wgolParts['WHERE'] = $str; return $wgolParts; }
/** * Checks, if a path is within the mountpoints of the backend user * * @param string $folder Absolute filepath * @return boolean If the input path is found in the backend users filemounts, then return TRUE. * @deprecated since 6.2 - will be removed two versions later without replacement */ public function checkFolder($folder) { GeneralUtility::logDeprecatedFunction(); return $this->fileProcessor->checkPathAgainstMounts(rtrim($folder, '/') . '/') ? TRUE : FALSE; }
/** * @return string Path to layout root directory * @deprecated since fluid 6.2, will be removed two versions later. Use getLayoutRootPaths() instead */ protected function getLayoutRootPath() { GeneralUtility::logDeprecatedFunction(); $layoutRootPaths = $this->getLayoutRootPaths(); return array_shift($layoutRootPaths); }
/** * This is the magic __wakeup() method. It's invoked by the unserialize statement in the reconstitution process * of the object. If you want to implement your own __wakeup() method in your Domain Object you have to call * parent::__wakeup() first! * * @return void * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Objects are instantiated differently calling parent::__wakeup() is no longer necessary. */ public function __wakeup() { GeneralUtility::logDeprecatedFunction(); }
/** * Initialize workspace preview * * @return void * @deprecated since TYPO3 4.7, will be removed in TYPO3 6.1 as this is part of Tx_Version now */ public function workspacePreviewInit() { \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(); $previewWS = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('ADMCMD_previewWS'); if ($this->beUserLogin && is_object($GLOBALS['BE_USER']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($previewWS)) { if ($previewWS == 0 || $previewWS >= -1 && $GLOBALS['BE_USER']->checkWorkspace($previewWS)) { // Check Access to workspace. Live (0) is OK to preview for all. $this->workspacePreview = intval($previewWS); } else { // No preview, will default to "Live" at the moment $this->workspacePreview = -99; } } }
/** * Loads "columns" of a $TCA table definition if extracted * to a "dynamicConfigFile". This method is called after each * single ext_tables.php files was included to immediately have * the full $TCA ready for the next extension. * * $TCA[$tableName]['ctrl']['dynamicConfigFile'] must be the * absolute path to a file. * * Be aware that 'dynamicConfigFile' is obsolete, and all TCA * table definitions should be moved to Configuration/TCA/tablename.php * to be fully loaded automatically. * * Example: * dynamicConfigFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'SysNote.php', * * @return void * @throws \RuntimeException * @internal Internal use ONLY. It is called by cache files and can not be protected. Do not call yourself! * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Table definition should be moved to <your_extension>/Configuration/TCA/<table_name> */ public static function loadNewTcaColumnsConfigFiles() { global $TCA; foreach ($TCA as $tableName => $_) { if (!isset($TCA[$tableName]['columns'])) { $columnsConfigFile = $TCA[$tableName]['ctrl']['dynamicConfigFile']; if ($columnsConfigFile) { GeneralUtility::logDeprecatedFunction(); if (GeneralUtility::isAbsPath($columnsConfigFile)) { include $columnsConfigFile; } else { throw new \RuntimeException('Columns configuration file not found', 1341151261); } } } } }
/** * Display some warning messages if this installation is obviously insecure!! * These warnings are only displayed to admin users * * @return string Rendered messages as HTML * @deprecated since 6.2 and is removed two versions later. This was transferred to ext:aboutmodules, do not use any longer! * @see \TYPO3\CMS\Aboutmodules\Controller\ModulesController */ public static function displayWarningMessages() { GeneralUtility::logDeprecatedFunction(); return ''; }
/** * @return bool TRUE if the t3editor is enabled * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 */ public function isEnabled() { GeneralUtility::logDeprecatedFunction(); return true; }
/** * Translates a character position into an 'absolute' byte position. * * @param string $str EUC multibyte character string * @param int $pos Character position (negative values start from the end) * @param string $charset The charset * @return int Byte position * @deprecated since TYPO3 v8, will be removed with TYPO3 v9, former internal function only */ public function euc_char2byte_pos($str, $pos, $charset) { GeneralUtility::logDeprecatedFunction(); $sjis = $charset === 'shift_jis'; // Number of characters seen $n = 0; // Number of characters wanted $p = abs($pos); if ($pos >= 0) { $i = 0; $d = 1; } else { $i = strlen($str) - 1; $d = -1; } for (; isset($str[$i]) && $n < $p; $i += $d) { $c = ord($str[$i]); if ($sjis) { if ($c >= 128 && $c < 160 || $c >= 224) { $i += $d; } } else { if ($c >= 128) { $i += $d; } } $n++; } if (!isset($str[$i])) { return false; } // offset beyond string length if ($pos < 0) { $i++; } // correct offset return $i; }
/** * Returns the content of wizardArray() function... * * @return array Returns the content of wizardArray() function... * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use "wizardArray()" directly */ public function getWizardItems() { GeneralUtility::logDeprecatedFunction(); return $this->wizardArray(); }
/** * Substitute function for the PHP mail() function. * It will encode the email with the setting of TS 'config.notification_email_encoding' (base64 or none) * It will also find all links to http:// in the text and substitute with a shorter link using the redirect feature which stores the long link in the database. Depends on configuration in TS 'config.notification_email_urlmode' * * @param string $email recipient email address (or list of) * @param string $subject The subject * @param string $message The message * @param string $headers The headers (string with lines) * @return void * @see \TYPO3\CMS\Core\Utility\GeneralUtility::plainMailEncoded() * @todo Define visibility * @deprecated since 6.1, will be removed two versions later - Use \TYPO3\CMS\Core\Mail\Mailer instead */ public function plainMailEncoded($email, $subject, $message, $headers = '') { GeneralUtility::logDeprecatedFunction(); // '76', 'all', '' $urlmode = $this->config['config']['notification_email_urlmode']; if ($urlmode) { $message = GeneralUtility::substUrlsInPlainText($message, $urlmode); } $encoding = $this->config['config']['notification_email_encoding'] ?: ''; $charset = $this->renderCharset; $convCharset = FALSE; // do we need to convert mail data? // Respect config.notification_email_charset if it was set if ($this->config['config']['notification_email_charset']) { $charset = $this->csConvObj->parse_charset($this->config['config']['notification_email_charset']); if ($charset != $this->renderCharset) { $convCharset = TRUE; } } elseif ($this->metaCharset != $this->renderCharset) { // Use metaCharset for mail if different from renderCharset $charset = $this->metaCharset; $convCharset = TRUE; } if ($convCharset) { $email = $this->csConvObj->conv($email, $this->renderCharset, $charset); $subject = $this->csConvObj->conv($subject, $this->renderCharset, $charset); $message = $this->csConvObj->conv($message, $this->renderCharset, $charset); $headers = $this->csConvObj->conv($headers, $this->renderCharset, $charset); } GeneralUtility::plainMailEncoded($email, $subject, $message, $headers, $encoding, $charset); }
/** * Converts id numbers from negative to positive. * * @param array $valueArray Array of [table]_[id] pairs. * @param string $fTable Foreign table (the one used for positive numbers) * @param string $nfTable Negative foreign table * @return array The array with ID integer values, converted to positive for those where the table name was set but did NOT match the positive foreign table. * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 */ public function convertPosNeg($valueArray, $fTable, $nfTable) { GeneralUtility::logDeprecatedFunction(); if (is_array($valueArray) && $fTable) { foreach ($valueArray as $key => $val) { $val = strrev($val); $parts = explode('_', $val, 2); $theID = strrev($parts[0]); $theTable = strrev($parts[1]); if (MathUtility::canBeInterpretedAsInteger($theID) && (!$theTable || $theTable === (string) $fTable || $theTable === (string) $nfTable)) { $valueArray[$key] = $theTable && $theTable !== (string) $fTable ? $theID * -1 : $theID; } } } return $valueArray; }
/** * End page and print content * * @return void * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead */ public function printContent() { GeneralUtility::logDeprecatedFunction(); echo $this->doc->startPage($this->titleTag) . $this->doc->insertStylesAndJS($this->content) . $this->doc->endPage(); }
/** * Print out the accumulated content: * * @return void * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead */ public function printContent() { GeneralUtility::logDeprecatedFunction(); echo $this->content; }
/** * Get net sum * * @return int * @deprecated since commerce 1.0.0, this function will be removed in commerce 1.4.0, please use getSumNet instead */ public function get_net_sum() { \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(); return $this->getSumNet(); }
public function __construct() { \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction(); parent::__construct(); }
/** * low level function that generates the HTML tag for the sprite icon * is usually called by the three API classes (getSpriteIcon, getSpriteIconForFile, getSpriteIconForRecord) * it does not care about classes or anything else, but just plainly builds the HTML tag * * @param array $tagAttributes An associative array of additional tagAttributes for the HTML tag * @param string $innerHtml The content within the tag, a " " by default * @param string $tagName The name of the HTML element that should be used (span by default) * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8 * @return string The sprite html icon tag */ protected static function buildSpriteHtmlIconTag(array $tagAttributes, $innerHtml = null, $tagName = null) { GeneralUtility::logDeprecatedFunction(); $innerHtml = $innerHtml === null ? ' ' : $innerHtml; $tagName = $tagName === null ? 'span' : $tagName; $attributes = ''; foreach ($tagAttributes as $attribute => $value) { $attributes .= ' ' . htmlspecialchars($attribute) . '="' . htmlspecialchars($value) . '"'; } return '<' . $tagName . $attributes . '>' . $innerHtml . '</' . $tagName . '>'; }