当前位置: 首页>>代码示例>>PHP>>正文


PHP ContentObjectRenderer::stdWrapValue方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::stdWrapValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentObjectRenderer::stdWrapValue方法的具体用法?PHP ContentObjectRenderer::stdWrapValue怎么用?PHP ContentObjectRenderer::stdWrapValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer的用法示例。


在下文中一共展示了ContentObjectRenderer::stdWrapValue方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 /**
  * Fetches records from the database as 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;
     }
     // the table to query, if none given, exit
     $tableName = $cObj->stdWrapValue('table', $processorConfiguration);
     if (empty($tableName)) {
         return $processedData;
     }
     if (isset($processorConfiguration['table.'])) {
         unset($processorConfiguration['table.']);
     }
     if (isset($processorConfiguration['table'])) {
         unset($processorConfiguration['table']);
     }
     // The variable to be used within the result
     $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, 'records');
     // Execute a SQL statement to fetch the records
     $records = $cObj->getRecords($tableName, $processorConfiguration);
     $processedRecordVariables = array();
     foreach ($records as $key => $record) {
         /** @var ContentObjectRenderer $recordContentObjectRenderer */
         $recordContentObjectRenderer = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
         $recordContentObjectRenderer->start($record, $tableName);
         $processedRecordVariables[$key] = array('data' => $record);
         $processedRecordVariables[$key] = $this->contentDataProcessor->process($recordContentObjectRenderer, $processorConfiguration, $processedRecordVariables[$key]);
     }
     $processedData[$targetVariableName] = $processedRecordVariables;
     return $processedData;
 }
开发者ID:tantegerda1,项目名称:TYPO3.ContentRenderingCore,代码行数:41,代码来源:DatabaseQueryProcessor.php

示例2: 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;
 }
开发者ID:dkd,项目名称:t3kit_extension_tools,代码行数:36,代码来源:LayoutClassProcessor.php

示例3: 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;
 }
开发者ID:dkd,项目名称:t3kit_extension_tools,代码行数:34,代码来源:FlexFormProcessor.php

示例4: process

 /**
  * Process data of a record to resolve File objects to the view
  *
  * @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;
     }
     // gather data
     /** @var FileCollector $fileCollector */
     $fileCollector = GeneralUtility::makeInstance(FileCollector::class);
     $settings = $contentObjectConfiguration['settings.']['display_mode.'];
     // references / relations
     if (!empty($processorConfiguration['references.'])) {
         $referenceConfiguration = $processorConfiguration['references.'];
         $relationField = $cObj->stdWrapValue('fieldName', $referenceConfiguration);
         // If no reference fieldName is set, there's nothing to do
         if (!empty($relationField)) {
             // Fetch the references of the default element
             $relationTable = $cObj->stdWrapValue('table', $referenceConfiguration, $cObj->getCurrentTable());
             if (!empty($relationTable)) {
                 $fileCollector->addFilesFromRelation($relationTable, $relationField, $cObj->data);
             }
         }
     }
     // Get files from database-record
     $files = $fileCollector->getFiles();
     if (count($files) > 0) {
         // Use ImageService for further processing
         $imageService = self::getImageService();
         foreach ($files as $file) {
             $displayMode = $file->getReferenceProperty('display_mode');
             $image = $imageService->getImage(null, $file, true);
             $processingInstructions = ['crop' => $image->getProperty('crop')];
             $maxWidth = intval($contentObjectConfiguration['settings.']['display_mode_maxWidth.'][$displayMode]);
             if ($maxWidth > 0) {
                 $processingInstructions['maxWidth'] = $maxWidth;
             }
             $processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions);
             $styleAttribute = 'background-image:url(\'' . $imageService->getImageUri($processedImage) . '\');';
             switch ($displayMode) {
                 case '1':
                     $targetVariableName = 'layoutMedia';
                     break;
                 default:
                     $targetVariableName = 'backgroundMedia';
                     break;
             }
             $processedData[$targetVariableName]['fileReference'] = $file;
             $processedData[$targetVariableName]['class'] = $settings[$displayMode];
             $processedData[$targetVariableName]['style'] = $styleAttribute;
         }
     }
     //\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($files, '$files');
     return $processedData;
 }
开发者ID:sonority,项目名称:bootstrap_components,代码行数:62,代码来源:FilesProcessor.php

示例5: process

 /**
  * Process data of a record to resolve File objects to the view
  *
  * @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;
     }
     // gather data
     /** @var FileCollector $fileCollector */
     $fileCollector = GeneralUtility::makeInstance(FileCollector::class);
     // references / relations
     if (!empty($processorConfiguration['references.'])) {
         $referenceConfiguration = $processorConfiguration['references.'];
         $relationField = $cObj->stdWrapValue('fieldName', $referenceConfiguration);
         // If no reference fieldName is set, there's nothing to do
         if (!empty($relationField)) {
             // Fetch the references of the default element
             $relationTable = $cObj->stdWrapValue('table', $referenceConfiguration, $cObj->getCurrentTable());
             if (!empty($relationTable)) {
                 $fileCollector->addFilesFromRelation($relationTable, $relationField, $cObj->data);
             }
         }
     }
     // files
     $files = $cObj->stdWrapValue('files', $processorConfiguration);
     if ($files) {
         $files = GeneralUtility::intExplode(',', $files, TRUE);
         $fileCollector->addFiles($files);
     }
     // collections
     $collections = $cObj->stdWrapValue('collections', $processorConfiguration);
     if (!empty($collections)) {
         $collections = GeneralUtility::trimExplode(',', $collections, TRUE);
         $fileCollector->addFilesFromFileCollections($collections);
     }
     // folders
     $folders = $cObj->stdWrapValue('folders', $processorConfiguration);
     if (!empty($folders)) {
         $folders = GeneralUtility::trimExplode(',', $folders, TRUE);
         $fileCollector->addFilesFromFolders($folders);
     }
     // make sure to sort the files
     $sortingProperty = $cObj->stdWrapValue('sorting', $processorConfiguration);
     if ($sortingProperty) {
         $sortingDirection = $cObj->stdWrapValue('direction', isset($processorConfiguration['sorting.']) ? $processorConfiguration['sorting.'] : array(), 'ascending');
         $fileCollector->sort($sortingProperty, $sortingDirection);
     }
     // set the files into a variable, default "files"
     $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, 'files');
     $processedData[$targetVariableName] = $fileCollector->getFiles();
     return $processedData;
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:59,代码来源:FilesProcessor.php

示例6: process

 /**
  * Process field data to split in 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;
     }
     // The field name to process
     $fieldName = $cObj->stdWrapValue('fieldName', $processorConfiguration);
     if (empty($fieldName)) {
         return $processedData;
     }
     $originalValue = $cObj->data[$fieldName];
     // Set the target variable
     $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, $fieldName);
     // Set the delimiter which is "LF" by default
     $delimiter = $cObj->stdWrapValue('delimiter', $processorConfiguration, LF);
     // Filter integers
     $filterIntegers = (bool) $cObj->stdWrapValue('filterIntegers', $processorConfiguration, false);
     // Filter unique
     $filterUnique = (bool) $cObj->stdWrapValue('filterUnique', $processorConfiguration, false);
     // Remove empty entries
     $removeEmptyEntries = (bool) $cObj->stdWrapValue('removeEmptyEntries', $processorConfiguration, false);
     if ($filterIntegers === true) {
         $processedData[$targetVariableName] = GeneralUtility::intExplode($delimiter, $originalValue, $removeEmptyEntries);
     } else {
         $processedData[$targetVariableName] = GeneralUtility::trimExplode($delimiter, $originalValue, $removeEmptyEntries);
     }
     if ($filterUnique === true) {
         $processedData[$targetVariableName] = array_unique($processedData[$targetVariableName]);
     }
     return $processedData;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:40,代码来源:SplitProcessor.php

示例7: process

 /**
  * Process CSV field data to split into a multi dimensional 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;
     }
     // The field name to process
     $fieldName = $cObj->stdWrapValue('fieldName', $processorConfiguration);
     if (empty($fieldName)) {
         return $processedData;
     }
     $originalValue = $cObj->data[$fieldName];
     // Set the target variable
     $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, $fieldName);
     // Set the maximum amount of columns
     $maximumColumns = $cObj->stdWrapValue('maximumColumns', $processorConfiguration, 0);
     // Set the field delimiter which is "," by default
     $fieldDelimiter = $cObj->stdWrapValue('fieldDelimiter', $processorConfiguration, ',');
     // Set the field enclosure which is " by default
     $fieldEnclosure = $cObj->stdWrapValue('fieldEnclosure', $processorConfiguration, '"');
     $processedData[$targetVariableName] = CsvUtility::csvToArray($originalValue, $fieldDelimiter, $fieldEnclosure, (int) $maximumColumns);
     return $processedData;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:31,代码来源:CommaSeparatedValueProcessor.php

示例8: 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;
     }
     $this->cObj = $cObj;
     $languages = array();
     // set targetvariable, default "flexform"
     $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, 'languages');
     $availableLanguages = array_unique(GeneralUtility::trimExplode(',', '0,' . $processorConfiguration['availableLanguages'], TRUE));
     $currentLanguageUid = (int) $processorConfiguration['currentLanguageUid'];
     $defaultLanguageIsoCode = $processorConfiguration['defaultLanguageIsoCode'] ? $processorConfiguration['defaultLanguageIsoCode'] : 'en';
     $defaultLanguageLabel = $processorConfiguration['defaultLanguageLabel'] ? $processorConfiguration['defaultLanguageLabel'] : 'English';
     $defaultLanguageFlag = $processorConfiguration['defaultLanguageFlag'] ? $processorConfiguration['defaultLanguageFlag'] : 'gb';
     $flagIconPath = $processorConfiguration['flagIconPath'];
     $flagIconFileExtension = $processorConfiguration['flagIconFileExtension'];
     if (!empty($availableLanguages)) {
         foreach ($availableLanguages as $languageUid) {
             $languageIsocode = '';
             $class = '';
             $label = '';
             $flag = '';
             $hasTranslation = FALSE;
             if ((int) $languageUid === 0) {
                 $languageIsocode = $defaultLanguageIsoCode;
                 $flag = $defaultLanguageFlag;
                 $label = $defaultLanguageLabel;
                 $hasTranslation = TRUE;
             } elseif ($sysLanguage = $this->getSysLanguage($languageUid)) {
                 $languageIsocode = $sysLanguage['language_isocode'];
                 $flag = $sysLanguage['flag'];
                 $label = $sysLanguage['title'];
                 $hasTranslation = $this->hasTranslation($GLOBALS['TSFE']->id, $languageUid);
             }
             $languages[] = array('L' => $languageUid, 'languageIsocode' => $languageIsocode, 'label' => $label, 'flag' => $flag, 'hasTranslation' => $hasTranslation, 'active' => (int) $currentLanguageUid === (int) $languageUid);
         }
         $processedData[$targetVariableName] = $languages;
     }
     // 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;
 }
开发者ID:dkd,项目名称:t3kit_extension_tools,代码行数:60,代码来源:LanguagesProcessor.php

示例9: process

 /**
  * Preprocess fields from database-record for use in fluid-templates
  *
  * @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;
     }
     // The field name to process
     $fieldName = $cObj->stdWrapValue('fieldName', $processorConfiguration);
     if (empty($fieldName)) {
         return $processedData;
     }
     // Set the target variable
     $defaultTargetName = GeneralUtility::underscoredToLowerCamelCase($fieldName);
     $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration, $defaultTargetName);
     // Let's see if we got a parentField from which the values should be retrieved
     $parentField = $cObj->stdWrapValue('parentField', $processorConfiguration);
     // Get settings from TypoScript
     if (!empty($parentField)) {
         $settings = $contentObjectConfiguration['settings.'][$fieldName . '.'][$cObj->data[$parentField] . '.'];
     } else {
         $settings = $contentObjectConfiguration['settings.'][$fieldName . '.'];
     }
     // Get value database
     $fieldValue = $cObj->data[$fieldName];
     // Fill output with value from TypoScript
     if (!empty($fieldValue)) {
         // Use the value defined in database
         $output = $settings[$fieldValue];
     } else {
         if ($settings['default'] !== '' && $settings[$settings['default']] !== '') {
             // Use default value (if set)
             $output = $settings[$settings['default']];
         } else {
             $output = '';
         }
     }
     $processedData[$targetVariableName] = $output;
     return $processedData;
 }
开发者ID:sonority,项目名称:bootstrap_components,代码行数:47,代码来源:ValueMapProcessor.php

示例10: process

 /**
  * @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)
 {
     // The field name to process
     $fieldName = $cObj->stdWrapValue('fieldName', $processorConfiguration);
     if (empty($fieldName) && !$processedData['data']['pi_flexform']) {
         return $processedData;
     } else {
         $fieldName = 'pi_flexform';
     }
     // Process Flexform
     $originalValue = $processedData['data'][$fieldName];
     if (!is_string($originalValue)) {
         return $processedData;
     }
     $flexformData = $this->flexFormService->convertFlexFormContentToArray($originalValue);
     // Set the target variable
     $targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration);
     if (!empty($targetVariableName)) {
         $processedData[$targetVariableName] = $flexformData;
     } else {
         $processedData['data'][$fieldName] = $flexformData;
     }
     return $processedData;
 }
开发者ID:randomresult,项目名称:slickcarousel,代码行数:31,代码来源:FlexFormProcessor.php

示例11: stdWrap_stdWrapValue

 /**
  * @param string $key
  * @param array $configuration
  * @param string $defaultValue
  * @param string $expected
  * @dataProvider stdWrap_stdWrapValueDataProvider
  * @test
  */
 public function stdWrap_stdWrapValue($key, array $configuration, $defaultValue, $expected)
 {
     $result = $this->subject->stdWrapValue($key, $configuration, $defaultValue);
     $this->assertEquals($expected, $result);
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:13,代码来源:ContentObjectRendererTest.php

示例12: getConfigurationValue

 /**
  * Get configuration value from processorConfiguration
  * with when $dataArrayKey fallback to value from cObj->data array
  *
  * @param string $key
  * @param string|NULL $dataArrayKey
  * @return string
  */
 protected function getConfigurationValue($key, $dataArrayKey = null)
 {
     $defaultValue = '';
     if ($dataArrayKey && isset($this->contentObjectRenderer->data[$dataArrayKey])) {
         $defaultValue = $this->contentObjectRenderer->data[$dataArrayKey];
     }
     return $this->contentObjectRenderer->stdWrapValue($key, $this->processorConfiguration, $defaultValue);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:16,代码来源:GalleryProcessor.php

示例13: getConfigurationValue

 /**
  * Get configuration value from processorConfiguration
  *
  * @param string $key
  * @return string
  */
 protected function getConfigurationValue($key)
 {
     return $this->cObj->stdWrapValue($key, $this->processorConfiguration, $this->menuDefaults[$key]);
 }
开发者ID:pekue,项目名称:bootstrap_package,代码行数:10,代码来源:MenuProcessor.php

示例14: process

 /**
  * Process data for a gallery, for instance the CType "textmedia"
  *
  * @param ContentObjectRenderer $cObj The content object renderer, which contains data of the content element
  * @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
  * @throws ContentRenderingException
  */
 public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
 {
     if (isset($processorConfiguration['if.']) && !$cObj->checkIf($processorConfiguration['if.'])) {
         return $processedData;
     }
     $this->contentObjectRenderer = $cObj;
     $this->processorConfiguration = $processorConfiguration;
     $filesProcessedDataKey = (string) $cObj->stdWrapValue('filesProcessedDataKey', $processorConfiguration, 'files');
     if (isset($processedData[$filesProcessedDataKey]) && is_array($processedData[$filesProcessedDataKey])) {
         $this->fileObjects = $processedData[$filesProcessedDataKey];
         $this->galleryData['count']['files'] = count($this->fileObjects);
     } else {
         throw new ContentRenderingException('No files found for key ' . $filesProcessedDataKey . ' in $processedData.', 1436809789);
     }
     // If carousel is enabled, there is only one column in use
     $this->galleryCarousel = (int) $cObj->data['gallery_carousel'];
     $this->numberOfColumns = empty($this->galleryCarousel) ? (int) $this->getConfigurationValue('numberOfColumns', 'imagecols') : 1;
     $this->mediaOrientation = (int) $this->getConfigurationValue('mediaOrientation', 'imageorient');
     $this->maxGalleryWidth = (int) $this->getConfigurationValue('maxGalleryWidth') ?: 1140;
     $this->maxGalleryWidthInText = (int) $this->getConfigurationValue('maxGalleryWidthInText') ?: 737;
     $this->equalMediaHeight = (int) $this->getConfigurationValue('equalMediaHeight', 'imageheight');
     $this->equalMediaWidth = (int) $this->getConfigurationValue('equalMediaWidth', 'imagewidth');
     $this->columnSpacing = (int) $this->getConfigurationValue('columnSpacing');
     $this->borderEnabled = (bool) $this->getConfigurationValue('borderEnabled', 'imageborder');
     $this->borderWidth = (int) $this->getConfigurationValue('borderWidth');
     $this->borderPadding = (int) $this->getConfigurationValue('borderPadding');
     $this->gridColumns = (int) $this->getConfigurationValue('gridColumns') ?: 12;
     $this->galleryResponsiveMinWidth = (int) $this->getConfigurationValue('galleryResponsiveMinWidth') ?: 737;
     $this->galleryWidth = (int) $this->getConfigurationValue('galleryWidth', 'gallery_width');
     $this->columnClass = $this->getConfigurationValue('columnClass') ?: 'col-xs-(0)';
     $this->galleryGridClass = $this->getGalleryGridClass($cObj->data['gallery_break'], $contentObjectConfiguration['settings.']['gallery_break.']);
     $this->defaultGalleryWidth = (int) $this->getConfigurationValue('defaultGalleryWidth') ?: 4;
     $this->headerAboveContent = (int) $this->getConfigurationValue('headerAboveContent') ?: '0, 1, 2, 8, 9, 10, 17, 18';
     $this->galleryAboveContent = (int) $this->getConfigurationValue('galleryAboveContent') ?: '0, 1, 2, 17, 18, 26';
     $this->determineGalleryPosition();
     $this->determineMaximumGalleryWidth();
     $this->determineRelationsToContent();
     $this->calculateRowsAndColumns();
     $this->calculateMediaWidthsAndHeights();
     $this->prepareGalleryData();
     $this->extendGalleryData();
     $targetFieldName = (string) $cObj->stdWrapValue('as', $processorConfiguration, 'gallery');
     $processedData[$targetFieldName] = $this->galleryData;
     //\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($this->galleryData, '$this->galleryData');
     return $processedData;
 }
开发者ID:sonority,项目名称:bootstrap_components,代码行数:56,代码来源:GalleryProcessor.php


注:本文中的TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::stdWrapValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。