本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::removeDotsFromTS方法的具体用法?PHP GeneralUtility::removeDotsFromTS怎么用?PHP GeneralUtility::removeDotsFromTS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::removeDotsFromTS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildCollectionsFromConfiguration
public function buildCollectionsFromConfiguration()
{
$responsiveImageConfiguration = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_customresponsiveimages.'];
$responsiveImageConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($responsiveImageConfiguration);
$this->galleryAspectRatio = $responsiveImageConfiguration['galleryAspectRatio'];
foreach ($responsiveImageConfiguration['colPosWidths'] as $collectionName => $colPosWidths) {
$this->collections[$collectionName]['colPosWidths'] = $colPosWidths;
foreach ($responsiveImageConfiguration['widthFactorByImageorient'] as $imageorient => $widthFactorByImageorient) {
if (is_array($widthFactorByImageorient)) {
// The factor changes from collection to collection, e.g. because a picture that is 1/16 size on desktop becomes 1/4 on mobile
if (array_key_exists($collectionName, $widthFactorByImageorient)) {
$this->collections[$collectionName]['widthFactorByImageorient'][$imageorient] = $widthFactorByImageorient[$collectionName];
} elseif (array_key_exists('default', $widthFactorByImageorient)) {
// If configuration for current collection is missing, switch to default if available
$this->collections[$collectionName]['widthFactorByImageorient'][$imageorient] = $widthFactorByImageorient['default'];
} else {
// fall back to fallbackWidth
$this->collections[$collectionName]['widthFactorByImageorient'][$imageorient] = $responsiveImageConfiguration['fallbackWidth'];
}
} else {
// The factor is identical for all collections
$this->collections[$collectionName]['widthFactorByImageorient'][$imageorient] = $widthFactorByImageorient;
}
}
foreach ($responsiveImageConfiguration['cropConfiguration'] as $imageorient => $cropConfiguration) {
$this->collections['cropConfiguration'][$imageorient] = $cropConfiguration;
}
}
}
示例2: process
/**
* Process flexform field data to an array
*
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
if (isset($processorConfiguration['if.']) && !$cObj->checkIf($processorConfiguration['if.'])) {
return $processedData;
}
// set targetvariable, default "flexform"
$targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, 'flexform');
// set fieldname, default "pi_flexform"
$fieldName = $cObj->stdWrapValue('fieldName', $processorConfiguration, 'pi_flexform');
// parse flexform
$flexformService = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\FlexFormService');
$processedData[$targetVariableName] = $flexformService->convertFlexFormContentToArray($cObj->data[$fieldName]);
// if targetvariable is settings, try to merge it with contentObjectConfiguration['settings.']
if ($targetVariableName == 'settings') {
if (is_array($contentObjectConfiguration['settings.'])) {
$convertedConf = GeneralUtility::removeDotsFromTS($contentObjectConfiguration['settings.']);
foreach ($convertedConf as $key => $value) {
if (!isset($processedData[$targetVariableName][$key]) || $processedData[$targetVariableName][$key] == false) {
$processedData[$targetVariableName][$key] = $value;
}
}
}
}
return $processedData;
}
示例3: setImageorientItems
/**
* @param $imageorientConfig
* @return array
*/
public function setImageorientItems(&$imageorientConfig)
{
$pageTsConfig = BackendUtility::getPagesTSconfig(GeneralUtility::_GET('id'));
$pageTsConfig = GeneralUtility::removeDotsFromTS($pageTsConfig);
if (array_key_exists('tx_customresponsiveimages', $pageTsConfig)) {
$responsiveImageConfiguration = $pageTsConfig['tx_customresponsiveimages'];
} else {
$responsiveImageConfiguration = array();
}
$groupedItems = array();
$i = 0;
foreach ($responsiveImageConfiguration['items'] as $imageorient => $item) {
$groupedItems[$item['group']][$i][] = $GLOBALS['LANG']->sL($item['label']);
$groupedItems[$item['group']][$i][] = $imageorient;
$groupedItems[$item['group']][$i][] = array_key_exists('icon', $item) && !empty($item['icon']) ? $responsiveImageConfiguration['seliconsPath'] . $item['icon'] : NULL;
$i++;
}
$imageOrientItems = array();
foreach ($responsiveImageConfiguration['groups'] as $groupName => $group) {
if (array_key_exists('label', $group) && !empty($group['label'])) {
$imageOrientItems[] = array($GLOBALS['LANG']->sL($group['label']), '--div--');
}
if (array_key_exists($groupName, $groupedItems)) {
foreach ($groupedItems[$groupName] as $item) {
array_push($imageOrientItems, $item);
}
}
}
$imageorientConfig['items'] = $imageOrientItems;
}
示例4: process
/**
* Generate variable Get string from classMappings array with the same key as the "layout" in the content
*
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
if (isset($processorConfiguration['if.']) && !$cObj->checkIf($processorConfiguration['if.'])) {
return $processedData;
}
// set targetvariable, default "layoutClass"
$targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, 'layoutClass');
$processedData[$targetVariableName] = '';
// set fieldname, default "layout"
$fieldName = $cObj->stdWrapValue('fieldName', $processorConfiguration, 'layout');
if (isset($cObj->data[$fieldName]) && is_array($processorConfiguration['classMappings.'])) {
$layoutClassMappings = GeneralUtility::removeDotsFromTS($processorConfiguration['classMappings.']);
$processedData[$targetVariableName] = $layoutClassMappings[$cObj->data[$fieldName]];
}
// if targetvariable is settings, try to merge it with contentObjectConfiguration['settings.']
if ($targetVariableName == 'settings') {
if (is_array($contentObjectConfiguration['settings.'])) {
$convertedConf = GeneralUtility::removeDotsFromTS($contentObjectConfiguration['settings.']);
foreach ($convertedConf as $key => $value) {
if (!isset($processedData[$targetVariableName][$key]) || $processedData[$targetVariableName][$key] == false) {
$processedData[$targetVariableName][$key] = $value;
}
}
}
}
return $processedData;
}
示例5: download
/**
* @param string $fileref
*/
public function download($fileref)
{
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sharepoint_connector']);
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($extensionConfiguration);
$filePath = explode(';#', $fileref);
$urlInfo = parse_url($extensionConfiguration['sharepointServer']['url']);
$downloadLink = $urlInfo['scheme'] . '://' . $urlInfo['host'] . '/' . $filePath[1];
$destinationFile = \TYPO3\CMS\Core\Utility\GeneralUtility::tempnam('spdownload_');
$fp = fopen($destinationFile, 'w+');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $downloadLink);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($ch, CURLOPT_USERPWD, $extensionConfiguration['sharepointServer']['username'] . ':' . $extensionConfiguration['sharepointServer']['password']);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
# increase timeout to download big file
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
fclose($fp);
if (file_exists($destinationFile)) {
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=" . basename($downloadLink));
header("Content-Transfer-Encoding: binary");
header('Content-Length: ' . filesize($destinationFile));
ob_clean();
flush();
readfile($destinationFile);
}
\TYPO3\CMS\Core\Utility\GeneralUtility::unlink_tempfile($destinationFile);
}
示例6: injectConfigurationManager
/**
* Injects the Configuration Manager
*
* @param ConfigurationManagerInterface $configurationManager
* @return void
*/
public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
{
$this->configurationManager = $configurationManager;
$typoScriptSetup = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
if (!empty($typoScriptSetup['plugin.']['tx_powermail.']['settings.']['setup.'])) {
$this->settings = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($typoScriptSetup['plugin.']['tx_powermail.']['settings.']['setup.']);
}
}
示例7: initializeConfiguration
/**
* Set Configuration
*
* @return void
* @static
*/
protected static function initializeConfiguration()
{
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sharepoint_connector']);
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($extensionConfiguration);
$logFilePath = $extensionConfiguration['path']['logs'];
if ('/' != substr($logFilePath, -1)) {
$logFilePath .= '/';
}
$GLOBALS['TYPO3_CONF_VARS']['LOG']['Aijko']['SharepointConnector']['Utility']['Logger'] = array('writerConfiguration' => array(\TYPO3\CMS\Core\Log\LogLevel::ERROR => array('\\TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => array('logFile' => $logFilePath . 'error.log')), \TYPO3\CMS\Core\Log\LogLevel::INFO => array('\\TYPO3\\CMS\\Core\\Log\\Writer\\FileWriter' => array('logFile' => $logFilePath . 'info.log'))));
}
示例8: __construct
/**
* Constructor
*/
public function __construct(array $configuration = array())
{
$this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
if (!count($configuration)) {
// Get configuration
$configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
$typoscriptConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$configuration = $typoscriptConfiguration['plugin.']['tx_aijkogeoip.']['settings.'];
$configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($configuration);
}
$this->configuration = $configuration;
}
示例9: __construct
/**
* Constructor
*/
public function __construct()
{
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
$typoscriptConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$configuration = $typoscriptConfiguration['module.']['tx_sharepointconnector.'];
$this->configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($configuration);
// get extension configuration
$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sharepoint_connector']);
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($extensionConfiguration);
// merge typoscript configuration and extension configuration
$this->configuration['settings']['sharepointServer'] = array_merge($this->configuration['settings']['sharepointServer'], $extensionConfiguration['sharepointServer']);
}
示例10: buildSmtpEncryptSelector
/**
* Render a selector element that allows to select the encryption method for SMTP
*
* @param array $params Field information to be rendered
*
* @return string The HTML selector
*/
public function buildSmtpEncryptSelector(array $params)
{
$extConf = GeneralUtility::removeDotsFromTS(unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mailcopy']));
$transports = stream_get_transports();
if (empty($transports)) {
return '';
}
$markup = '<select class="valid" name="' . $params['fieldName'] . '" id=em-' . $params['propertyName'] . '">';
$active = (string) self::extract($extConf, explode('.', $params['propertyName']));
foreach ($transports as $transport) {
$markup .= '<option value="' . $transport . '"' . ($transport === $active ? ' selected="selected"' : '') . '>' . $transport . '</option>';
}
$markup .= '</select>';
return $markup;
}
示例11: getSettings
/**
* Returns the TypoScript configuration for this extension.
*
* @return array
*/
public function getSettings()
{
// Use cache or initialize settings property.
if (empty($this->settings)) {
if ($this->isFrontendMode()) {
$this->settings = GeneralUtility::removeDotsFromTS($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_formule.']['settings.']);
} else {
$setup = $this->getConfigurationManager()->getTypoScriptSetup();
if (is_array($setup['plugin.']['tx_formule.'])) {
/** @var \TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService */
$typoScriptService = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Service\TypoScriptService::class);
$this->settings = $typoScriptService->convertTypoScriptArrayToPlainArray($setup['plugin.']['tx_formule.']['settings.']);
}
}
}
return $this->settings;
}
示例12: render
/**
* Render
*
* @param string $path
* @return mixed
*/
public function render($path = NULL)
{
if (NULL === $path) {
$path = $this->renderChildren();
}
if (TRUE === empty($path)) {
return NULL;
}
$all = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$segments = explode('.', $path);
$value = $all;
foreach ($segments as $path) {
$value = TRUE === isset($value[$path . '.']) ? $value[$path . '.'] : $value[$path];
}
if (TRUE === is_array($value)) {
$value = GeneralUtility::removeDotsFromTS($value);
}
return $value;
}
示例13: renderStatic
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$extensionKey = $arguments['extensionKey'];
$path = $arguments['path'];
if (null === $extensionKey) {
$extensionName = $renderingContext->getControllerContext()->getRequest()->getControllerExtensionName();
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($extensionName);
}
if (!array_key_exists($extensionKey, $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'])) {
return null;
} elseif (!array_key_exists($extensionKey, static::$configurations)) {
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extensionKey]);
static::$configurations[$extensionKey] = GeneralUtility::removeDotsFromTS($extConf);
}
if (!$path) {
return static::$configurations[$extensionKey];
}
return ObjectAccess::getPropertyPath(static::$configurations[$extensionKey], $path);
}
示例14: __construct
/**
* @throws \InvalidArgumentException|\UnexpectedValueException
*/
public function __construct()
{
$this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$extensionConfiguration = \Aijko\AijkoGeoip\Utility\EmConfiguration::getConfiguration('aijko_geoip', '\\Aijko\\AijkoGeoip\\Domain\\Model\\Dto\\EmConfiguration');
if (!$extensionConfiguration->getDatabaseFilePath()) {
throw new \UnexpectedValueException('You must set a path to the database file in the extension managaer', 1409315403);
}
try {
$this->reader = new Reader($extensionConfiguration->getDatabaseFilePath());
} catch (\InvalidArgumentException $exception) {
throw new \InvalidArgumentException($exception->getMessage(), 1409315902);
} catch (\UnexpectedValueException $exception) {
throw new \UnexpectedValueException($exception->getMessage(), 1409315903);
}
// Get configuration
$configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
$typoscriptConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$configuration = $typoscriptConfiguration['plugin.']['tx_aijkogeoip.']['settings.'];
$this->configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($configuration);
}
示例15: overrideFieldConf
/**
* Overrides the TCA field configuration by TSconfig settings.
*
* Example TSconfig: TCEform.<table>.<field>.config.appearance.useSortable = 1
* This overrides the setting in $GLOBALS['TCA'][<table>]['columns'][<field>]['config']['appearance']['useSortable'].
*
* @param array $fieldConfig $GLOBALS['TCA'] field configuration
* @param array $TSconfig TSconfig
* @return array Changed TCA field configuration
* @internal
*/
public static function overrideFieldConf($fieldConfig, $TSconfig)
{
if (is_array($TSconfig)) {
$TSconfig = GeneralUtility::removeDotsFromTS($TSconfig);
$type = $fieldConfig['type'];
if (is_array($TSconfig['config']) && is_array(static::$allowOverrideMatrix[$type])) {
// Check if the keys in TSconfig['config'] are allowed to override TCA field config:
foreach ($TSconfig['config'] as $key => $_) {
if (!in_array($key, static::$allowOverrideMatrix[$type], true)) {
unset($TSconfig['config'][$key]);
}
}
// Override $GLOBALS['TCA'] field config by remaining TSconfig['config']:
if (!empty($TSconfig['config'])) {
ArrayUtility::mergeRecursiveWithOverrule($fieldConfig, $TSconfig['config']);
}
}
}
return $fieldConfig;
}