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


PHP ConfigurationManagerInterface::getContentObject方法代码示例

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


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

示例1: render

 /**
  * @return mixed
  * @throws \Exception
  */
 public function render()
 {
     $contentUid = intval($this->arguments['contentUid']);
     if (0 === $contentUid) {
         $cObj = $this->configurationManager->getContentObject();
         $record = $cObj->data;
     }
     $field = $this->arguments['field'];
     if (false === isset($record) && 0 !== $contentUid) {
         if (null !== $field && true === isset($GLOBALS['TCA']['tt_content']['columns'][$field])) {
             $selectFields = $field;
         } else {
             $selectFields = '*';
         }
         $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow($selectFields, 'tt_content', sprintf('uid=%d', $contentUid));
         // Add the page overlay
         $languageUid = intval($GLOBALS['TSFE']->sys_language_uid);
         if (0 !== $languageUid && $GLOBALS['TSFE']->sys_language_contentOL) {
             $record = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tt_content', $record, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL);
         }
     }
     if (false === $record && false === isset($record)) {
         throw new \Exception(sprintf('Either record with uid %d or field %s do not exist.', $contentUid, $selectFields), 1358679983);
     }
     // Check if single field or whole record should be returned
     $content = null;
     if (null === $field) {
         $content = $record;
     } elseif (true === isset($record[$field])) {
         $content = $record[$field];
     }
     return $this->renderChildrenWithVariableOrReturnInput($content);
 }
开发者ID:fluidtypo3,项目名称:vhs,代码行数:37,代码来源:InfoViewHelper.php

示例2: render

 /**
  * @return string
  */
 public function render()
 {
     $value = $this->configurationManager->getContentObject() ? $this->configurationManager->getContentObject()->data : array();
     if ($this->arguments['as']) {
         $variableNameArr = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('.', $this->arguments['as'], TRUE, 2);
         $variableName = $variableNameArr[0];
         $attributePath = $variableNameArr[1];
         if ($this->templateVariableContainer->exists($variableName)) {
             $oldValue = $this->templateVariableContainer->get($variableName);
             $this->templateVariableContainer->remove($variableName);
         }
         if ($attributePath) {
             if ($oldValue && is_array($oldValue)) {
                 $templateValue = $oldValue;
                 $templateValue[$attributePath] = $value;
             } else {
                 $templateValue = array($attributePath => $value);
             }
         } else {
             $templateValue = $value;
         }
         $this->templateVariableContainer->add($variableName, $templateValue);
         return '';
     } else {
         return $value;
     }
 }
开发者ID:seitenarchitekt,项目名称:extbase_hijax,代码行数:30,代码来源:ContentObjectDataViewHelper.php

示例3: injectConfigurationManager

 /**
  * Injects the Configuration Manager and is initializing the framework settings
  *
  * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager Instance of the Configuration Manager
  * @return void
  */
 public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
 {
     $this->configurationManager = $configurationManager;
     $tsSettings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'news', 'news_pi1');
     $originalSettings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
     $propertiesNotAllowedViaFlexForms = ['orderByAllowed'];
     foreach ($propertiesNotAllowedViaFlexForms as $property) {
         $originalSettings[$property] = $tsSettings['settings'][$property];
     }
     // Use stdWrap for given defined settings
     if (isset($originalSettings['useStdWrap']) && !empty($originalSettings['useStdWrap'])) {
         /** @var  \TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService */
         $typoScriptService = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Service\TypoScriptService::class);
         $typoScriptArray = $typoScriptService->convertPlainArrayToTypoScriptArray($originalSettings);
         $stdWrapProperties = GeneralUtility::trimExplode(',', $originalSettings['useStdWrap'], true);
         foreach ($stdWrapProperties as $key) {
             if (is_array($typoScriptArray[$key . '.'])) {
                 $originalSettings[$key] = $this->configurationManager->getContentObject()->stdWrap($originalSettings[$key], $typoScriptArray[$key . '.']);
             }
         }
     }
     // start override
     if (isset($tsSettings['settings']['overrideFlexformSettingsIfEmpty'])) {
         /** @var \GeorgRinger\News\Utility\TypoScript $typoScriptUtility */
         $typoScriptUtility = GeneralUtility::makeInstance(\GeorgRinger\News\Utility\TypoScript::class);
         $originalSettings = $typoScriptUtility->override($originalSettings, $tsSettings);
     }
     $this->settings = $originalSettings;
 }
开发者ID:plojewski,项目名称:news,代码行数:35,代码来源:NewsController.php

示例4: injectConfigurationManager

 /**
  * Inject Configuration Manager
  *
  * @param ConfigurationManagerInterface $configurationManager
  * @return void
  */
 public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
 {
     $this->configurationManager = $configurationManager;
     $this->cObj = $this->configurationManager->getContentObject();
     $typoScriptSetup = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
     $this->settings = $typoScriptSetup['plugin.']['tx_powermail.']['settings.']['setup.'];
 }
开发者ID:advOpk,项目名称:pwm,代码行数:13,代码来源:PrefillFieldViewHelper.php

示例5: initializeFinisher

 /**
  * Initialize
  *
  * @return void
  */
 public function initializeFinisher()
 {
     $this->contentObject = $this->configurationManager->getContentObject();
     $this->contentObject->start($this->mailRepository->getVariablesWithMarkersFromMail($this->mail));
     $typoScript = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
     $this->configuration = $typoScript['plugin.']['tx_powermail.']['settings.']['setup.']['marketing.']['sendPost.'];
 }
开发者ID:VladStawizki,项目名称:ipl-logistik.de,代码行数:12,代码来源:SendParametersFinisher.php

示例6: renderPreviewSection

 /**
  * @param ProviderInterface $provider
  * @param array $row
  * @param Form $form
  * @return string|NULL
  */
 protected function renderPreviewSection(ProviderInterface $provider, array $row, Form $form = NULL)
 {
     $templatePathAndFilename = $provider->getTemplatePathAndFilename($row);
     if (NULL === $templatePathAndFilename) {
         return NULL;
     }
     $extensionKey = $provider->getExtensionKey($row);
     $paths = $provider->getTemplatePaths($row);
     $flexformVariables = $provider->getFlexFormValues($row);
     $templateVariables = $provider->getTemplateVariables($row);
     $variables = RecursiveArrayUtility::merge($templateVariables, $flexformVariables);
     $variables['row'] = $row;
     $variables['record'] = $row;
     if (TRUE === is_object($form)) {
         $formLabel = $form->getLabel();
         $label = LocalizationUtility::translate($formLabel, $extensionKey);
         $variables['label'] = $label;
     }
     $templatePaths = new TemplatePaths($paths);
     $viewContext = new ViewContext($templatePathAndFilename, $extensionKey, self::CONTROLLER_NAME);
     $viewContext->setTemplatePaths($templatePaths);
     $viewContext->setVariables($variables);
     $view = $this->configurationService->getPreparedExposedTemplateView($viewContext);
     $existingContentObject = $this->configurationManager->getContentObject();
     $contentObject = new ContentObjectRenderer();
     $contentObject->start($row, $provider->getTableName($row));
     $this->configurationManager->setContentObject($contentObject);
     $previewContent = $view->renderStandaloneSection(self::PREVIEW_SECTION, $variables, TRUE);
     $this->configurationManager->setContentObject($existingContentObject);
     $previewContent = trim($previewContent);
     return $previewContent;
 }
开发者ID:busynoggin,项目名称:flux,代码行数:38,代码来源:PreviewView.php

示例7: injectConfigurationManager

 /**
  * Injects the Configuration Manager and is initializing the framework settings
  *
  * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager Instance of the Configuration Manager
  * @return void
  */
 public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
 {
     $this->configurationManager = $configurationManager;
     $tsSettings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'news', 'news_pi1');
     $originalSettings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
     // Use stdWrap for given defined settings
     if (isset($originalSettings['useStdWrap']) && !empty($originalSettings['useStdWrap'])) {
         /** @var  \TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService */
         $typoScriptService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
         $typoScriptArray = $typoScriptService->convertPlainArrayToTypoScriptArray($originalSettings);
         $stdWrapProperties = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $originalSettings['useStdWrap'], TRUE);
         foreach ($stdWrapProperties as $key) {
             if (is_array($typoScriptArray[$key . '.'])) {
                 $originalSettings[$key] = $this->configurationManager->getContentObject()->stdWrap($originalSettings[$key], $typoScriptArray[$key . '.']);
             }
         }
     }
     // start override
     if (isset($tsSettings['settings']['overrideFlexformSettingsIfEmpty'])) {
         /** @var Tx_MooxNews_Utility_TypoScript $typoScriptUtility */
         $typoScriptUtility = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_MooxNews_Utility_TypoScript');
         $originalSettings = $typoScriptUtility->override($originalSettings, $tsSettings);
     }
     $this->settings = $originalSettings;
 }
开发者ID:preinboth,项目名称:moox_news,代码行数:31,代码来源:NewsController.php

示例8: getRenderedRecords

 /**
  * This function renders an array of tt_content record into an array of rendered content
  * it returns a list of elements rendered by typoscript RECORDS function
  *
  * @param array $rows database rows of records (each item is a tt_content table record)
  * @return array
  */
 protected function getRenderedRecords($rows)
 {
     $elements = array();
     foreach ($rows as $row) {
         $conf = array('tables' => 'tt_content', 'source' => $row['uid'], 'dontCheckPid' => 1);
         array_push($elements, $this->configurationManager->getContentObject()->cObjGetSingle('RECORDS', $conf));
     }
     return $elements;
 }
开发者ID:JostBaron,项目名称:flux,代码行数:16,代码来源:GetViewHelper.php

示例9: showSelectedAction

 /**
  * Show selected person's entry for displaying it
  *
  */
 public function showSelectedAction()
 {
     /** @var int $position */
     $position = $this->configurationManager->getContentObject()->data['colPos'];
     $templateChosen = intval($this->settings['chooseTemplate']);
     $selectedPeople = GeneralUtility::intExplode(',', $this->settings['showPeople']);
     $persons = $this->personRepository->findPeopleInList($selectedPeople);
     $this->view->assign('persons', $persons)->assign('position', $position)->assign('showOrganizationalDetails', $this->settings['showOrganizationalDetails'])->assign('template', $templateChosen);
 }
开发者ID:subugoe,项目名称:substaff,代码行数:13,代码来源:PersonController.php

示例10: render

 /**
  * @param string $action
  * @param array $arguments
  * @param string $controller
  * @param string $extensionName
  * @param string $pluginName
  * @param string $format
  * @param int $pageUid
  * @param boolean $cachedAjaxIfPossible TRUE if the URI should be cached (with respect to non-cacheable actions)
  * @param boolean $forceContext TRUE if the controller/action/... should be passed
  * @param boolean $noAjax
  *
  * @return string
  */
 public function render($action = NULL, array $arguments = array(), $controller = NULL, $extensionName = NULL, $pluginName = NULL, $format = '', $pageUid = NULL, $cachedAjaxIfPossible = TRUE, $forceContext = TRUE, $noAjax = FALSE)
 {
     $request = $this->mvcDispatcher->getCurrentRequest();
     if ($forceContext) {
         $requestArguments = $this->controllerContext->getRequest()->getArguments();
         $requestArguments = array_merge($requestArguments, $this->hijaxEventDispatcher->getContextArguments());
         $requestArguments = array_merge($requestArguments, $arguments);
         $arguments = $requestArguments;
     }
     if ($noAjax) {
         return parent::render($action, $arguments, $controller, $extensionName, $pluginName, $pageUid);
     } else {
         /* @var $listener \EssentialDots\ExtbaseHijax\Event\Listener */
         $listener = $this->mvcDispatcher->getCurrentListener();
         if ($request) {
             if ($action === NULL) {
                 $action = $request->getControllerActionName();
             }
             if ($controller === NULL) {
                 $controller = $request->getControllerName();
             }
             if ($extensionName === NULL) {
                 $extensionName = $request->getControllerExtensionName();
             }
             if ($pluginName === NULL && TYPO3_MODE === 'FE') {
                 $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controller, $action);
             }
             if ($pluginName === NULL) {
                 $pluginName = $request->getPluginName();
             }
             $cachedAjaxIfPossible = $cachedAjaxIfPossible ? $this->configurationManager->getContentObject()->getUserObjectType() != ContentObjectRenderer::OBJECTTYPE_USER_INT : false;
             if ($cachedAjaxIfPossible) {
                 /* @var $cacheHash \TYPO3\CMS\Frontend\Page\CacheHashCalculator */
                 $cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator');
                 $chash = $cacheHash->calculateCacheHash(array('encryptionKey' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], 'action' => $action, 'controller' => $controller, 'extension' => $extensionName, 'plugin' => $pluginName, 'arguments' => $this->array_map_recursive('strval', $arguments), 'settingsHash' => $listener->getId()));
             }
         }
         $additionalArguments = array();
         $this->hA('r[0][arguments]', $arguments, $additionalArguments);
         $language = intval($GLOBALS['TSFE'] ? $GLOBALS['TSFE']->sys_language_content : 0);
         $additionalParams = "&r[0][extension]={$extensionName}&r[0][plugin]={$pluginName}&r[0][controller]={$controller}&r[0][action]={$action}&r[0][format]={$format}&r[0][settingsHash]={$listener->getId()}&eID=extbase_hijax_dispatcher&L={$language}";
         if ($additionalArguments) {
             $additionalParams .= '&' . implode('&', $additionalArguments);
         }
         if ($chash) {
             $additionalParams .= '&r[0][chash]=' . $chash;
         }
         /* @var $cObj \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer */
         $cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
         $uri = $cObj->typoLink('', array('returnLast' => 'url', 'additionalParams' => $additionalParams, 'parameter' => $pageUid ? $pageUid : ($GLOBALS['TSFE'] ? $GLOBALS['TSFE']->id : 0)));
         $this->tag->addAttribute('href', $uri);
         $this->tag->setContent($this->renderChildren());
         $this->tag->forceClosingTag(TRUE);
         return $this->tag->render();
     }
 }
开发者ID:seitenarchitekt,项目名称:extbase_hijax,代码行数:70,代码来源:ActionViewHelper.php

示例11: handleRequest

 /**
  * Handles the web request. The response will automatically be sent to the client.
  *
  * @return \TYPO3\CMS\Extbase\Mvc\ResponseInterface|NULL
  */
 public function handleRequest()
 {
     $request = $this->requestBuilder->build();
     if ($this->extensionService->isActionCacheable(NULL, NULL, $request->getControllerName(), $request->getControllerActionName())) {
         $request->setIsCached(TRUE);
     } else {
         $contentObject = $this->configurationManager->getContentObject();
         if ($contentObject->getUserObjectType() === \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::OBJECTTYPE_USER) {
             $contentObject->convertToUserIntObject();
             // \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::convertToUserIntObject() will recreate the object, so we have to stop the request here
             return NULL;
         }
         $request->setIsCached(FALSE);
     }
     /** @var $response \TYPO3\CMS\Extbase\Mvc\ResponseInterface */
     $response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
     $this->dispatcher->dispatch($request, $response);
     return $response;
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:24,代码来源:FrontendRequestHandler.php

示例12: render

 /**
  * Override the title tag
  *
  * @param boolean $concat
  * @return void
  */
 public function render($concat = false)
 {
     $content = $this->renderChildren();
     $contentObjectData = $this->configurationManager->getContentObject()->getUserObjectType();
     if (!empty($content) && $this->configurationManager->getContentObject()->getUserObjectType() == \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::OBJECTTYPE_USER) {
         if ($concat === true) {
             $GLOBALS['TSFE']->page['title'] .= $content;
             $GLOBALS['TSFE']->indexedDocTitle .= $content;
         } else {
             $GLOBALS['TSFE']->page['title'] = $content;
             $GLOBALS['TSFE']->indexedDocTitle = $content;
         }
     } else {
         if ($concat === true) {
             $GLOBALS['TSFE']->content = preg_replace('@<title>(.*?)</title>@i', '<title>' . $content . ' $1</title>', $GLOBALS['TSFE']->content);
         } else {
             $GLOBALS['TSFE']->content = preg_replace('@<title>(.*?)</title>@i', '<title>' . $content . '</title>', $GLOBALS['TSFE']->content);
         }
     }
 }
开发者ID:Apen,项目名称:t3devapi,代码行数:26,代码来源:TitleTagViewHelper.php

示例13: loadConfiguration

 private function loadConfiguration()
 {
     if (!array_key_exists($this->extKey, self::$settingsCache)) {
         $this->mergeSettings(unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]));
         $this->mergeSettings($this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK));
         $this->mergeSettings($this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS));
         $flexformSettings = $this->flexFormService->convertFlexFormContentToArray($this->configurationManager->getContentObject()->data['pi_flexform']);
         $this->mergeSettings($flexformSettings['settings']);
         self::$settingsCache[$this->extKey] = $this->settings;
     }
     $this->settings = self::$settingsCache[$this->extKey];
 }
开发者ID:BjoBre,项目名称:t3chimp,代码行数:12,代码来源:Settings.php

示例14: initialize

 /**
  * Init
  *
  * @return void
  */
 public function initialize()
 {
     $this->extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
     $this->contentObject = $this->configurationManager->getContentObject();
     if ($this->arguments['extensionName'] !== null) {
         $this->extensionName = $this->arguments['extensionName'];
     }
     $typoScriptSetup = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
     if (!empty($typoScriptSetup['setup'])) {
         $this->settings = $typoScriptSetup['setup'];
     }
 }
开发者ID:bernhardberger,项目名称:powermail,代码行数:17,代码来源:AbstractValidationViewHelper.php

示例15: render

 /**
  * @return mixed
  */
 public function render()
 {
     $contentUid = intval($this->arguments['contentUid']);
     if (0 === $contentUid) {
         $cObj = $this->configurationManager->getContentObject();
         $record = $cObj->data;
     }
     $field = $this->arguments['field'];
     if (FALSE === isset($record) && 0 !== $contentUid) {
         if (NULL !== $field && TRUE === isset($GLOBALS['TCA']['tt_content']['columns'][$field])) {
             $selectFields = $field;
         } else {
             $selectFields = '*';
         }
         $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow($selectFields, 'tt_content', sprintf('uid=%d', $contentUid));
         // Add the page overlay
         $languageUid = intval($GLOBALS['TSFE']->sys_language_uid);
         if (0 !== $languageUid && $GLOBALS['TSFE']->sys_language_contentOL) {
             $record = $GLOBALS['TSFE']->sys_page->getRecordOverlay('tt_content', $record, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL);
         }
     }
     if (FALSE === $record && FALSE === isset($record)) {
         throw new \Exception(sprintf('Either record with uid %d or field %s do not exist.', $contentUid, $selectFields), 1358679983);
     }
     // Check if single field or whole record should be returned
     $content = NULL;
     if (NULL === $field) {
         $content = $record;
     } elseif (TRUE === isset($record[$field])) {
         $content = $record[$field];
     }
     // Return if no assign
     $as = $this->arguments['as'];
     if (TRUE === empty($as)) {
         return $content;
     }
     $variables = array($as => $content);
     $output = ViewHelperUtility::renderChildrenWithVariables($this, $this->templateVariableContainer, $variables);
     return $output;
 }
开发者ID:chrmue01,项目名称:typo3-starter-kit,代码行数:43,代码来源:InfoViewHelper.php


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