本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer类的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer类的具体用法?PHP PageRenderer怎么用?PHP PageRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PageRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addJSCSS
/**
* wrapper function called by hook (\TYPO3\CMS\Core\Page\PageRenderer->render-preProcess)
*
* @param array $parameters : An array of available parameters
* @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer : The parent object that triggered this hook
*
* @return void
*/
public function addJSCSS($parameters, &$pageRenderer)
{
// Add javascript
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Themes/ThemesBackendTca');
// Add css
$filename = $pageRenderer->backPath . ExtensionManagementUtility::extRelPath('themes') . 'Resources/Public/Stylesheet/ThemesBackendTca.css';
$pageRenderer->addCssFile($filename, 'stylesheet', 'screen');
}
示例2: __construct
/**
* Construct
*/
public function __construct()
{
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$this->pageRenderer->loadJquery();
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/ElementBrowser');
$this->initialize();
}
示例3: render
/**
* @param StandaloneView $view
* @param PageRenderer $pageRenderer
* @param LoginController $loginController
* @throws \UnexpectedValueException
*/
public function render(StandaloneView $view, PageRenderer $pageRenderer, LoginController $loginController)
{
GeneralUtility::makeInstance(ObjectManager::class)->get(Dispatcher::class)->dispatch(__CLASS__, self::SIGNAL_getPageRenderer, array($pageRenderer));
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/UserPassLogin');
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/UserPassLoginForm.html'));
if (GeneralUtility::getIndpEnv('TYPO3_SSL')) {
$view->assign('presetUsername', GeneralUtility::_GP('u'));
$view->assign('presetPassword', GeneralUtility::_GP('p'));
}
}
示例4: getPageRenderer
/**
* @param PageRenderer $pageRenderer
*/
public function getPageRenderer(PageRenderer $pageRenderer)
{
$loginSecurityLevel = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']) ?: 'normal';
if ($loginSecurityLevel === 'rsa') {
$javascriptPath = '../' . ExtensionManagementUtility::siteRelPath('rsaauth') . 'Resources/Public/JavaScript/';
$files = array('jsbn/jsbn.js', 'jsbn/prng4.js', 'jsbn/rng.js', 'jsbn/rsa.js', 'jsbn/base64.js');
foreach ($files as $file) {
$pageRenderer->addJsFile($javascriptPath . $file);
}
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Rsaauth/BackendLoginFormRsaEncryption');
}
}
示例5: getPageRenderer
/**
* Gets instance of PageRenderer
*
* @return PageRenderer
*/
public function getPageRenderer()
{
if (!isset($this->pageRenderer)) {
$this->pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
$this->pageRenderer->setBackPath(TYPO3_mainDir);
}
return $this->pageRenderer;
}
示例6: addJsFileToPageRenderer
/**
* Wrapper for t3lib_PageRenderer->addJsFile. Excludes $jsFile from concatenation on TYPO3 4.6+.
*
* @param string $jsFile
* @return void
*/
protected function addJsFileToPageRenderer($jsFile)
{
if (version_compare(TYPO3_version, '4.6', '>=')) {
$this->pageRenderer->addJsFile($jsFile, 'text/javascript', true, false, '', true);
} else {
$this->pageRenderer->addJsFile($jsFile);
}
}
示例7: render
/**
* Render
*
* @param string $file
*/
public function render($file = NULL)
{
if ($this->isCached()) {
$this->pageRenderer->addCssFile($file, $this->arguments['rel'], $this->arguments['media'], $this->arguments['title'], $this->arguments['compress'], $this->arguments['forceOnTop'], $this->arguments['allWrap'], $this->arguments['excludeFromConcatenation']);
} else {
$GLOBALS['TSFE']->additionalHeaderData[md5($file)] = '<link rel="' . $this->arguments['rel'] . '" type="text/css" media="' . $this->arguments['media'] . '" href="' . $file . '" />';
}
}
示例8: render
/**
* Load RequireJS code.
*
* @return void
* @api
*/
public function render()
{
$content = $this->renderChildren();
$this->pageRenderer->addJsInlineCode('vidi-inline', $content);
$configuration['paths']['Fab/Vidi'] = '../typo3conf/ext/vidi/Resources/Public/JavaScript';
$this->pageRenderer->addRequireJsConfiguration($configuration);
$this->pageRenderer->loadRequireJsModule('Fab/Vidi/Vidi/Main');
}
示例9: initializeAction
/**
* Initialize every action.
*/
public function initializeAction()
{
$this->pageRenderer->addInlineLanguageLabelFile('EXT:vidi/Resources/Private/Language/locallang.xlf');
// Configure property mapping to retrieve the file object.
if ($this->arguments->hasArgument('columns')) {
/** @var \Fab\Vidi\TypeConverter\CsvToArrayConverter $typeConverter */
$typeConverter = $this->objectManager->get('Fab\\Vidi\\TypeConverter\\CsvToArrayConverter');
$propertyMappingConfiguration = $this->arguments->getArgument('columns')->getPropertyMappingConfiguration();
$propertyMappingConfiguration->setTypeConverter($typeConverter);
}
}
示例10: initializeAction
/**
* Initializes the rendering action.
*
* Use this method to add all static assets.
*/
public function initializeAction()
{
if (!$this->cache->has('brushes')) {
return;
}
$themeCss = $this->resolveFilePathReference(sprintf(self::CSS_PATH . '/shCore%s.css', $this->settings['code_snippet']['theme']));
$this->pageRenderer->addCssFile($themeCss);
$coreJs = $this->resolveFilePathReference(self::JS_PATH . '/shCore.min.js');
$this->pageRenderer->addJsFooterLibrary('codesnippet_core', $coreJs);
$autoloaderJs = $this->resolveFilePathReference(self::JS_PATH . '/shAutoloader.min.js');
$this->pageRenderer->addJsFooterLibrary('codesnippet_autoloader', $autoloaderJs);
}
示例11: render
/**
* Load the assets (JavaScript, CSS) for this Vidi module.
*
* @return void
* @api
*/
public function render()
{
/** @var \Fab\Vidi\Module\ModuleLoader $moduleLoader */
$moduleLoader = $this->objectManager->get('Fab\\Vidi\\Module\\ModuleLoader');
foreach ($moduleLoader->getAdditionalStyleSheetFiles() as $addCssFile) {
$fileNameAndPath = $this->resolvePath($addCssFile);
$this->pageRenderer->addCssFile($fileNameAndPath);
}
foreach ($moduleLoader->getAdditionalJavaScriptFiles() as $addJsFile) {
$fileNameAndPath = $this->resolvePath($addJsFile);
$this->pageRenderer->addJsFile($fileNameAndPath);
}
}
示例12: loadLocalization
/**
* Reads locallang file into array (for possible include in header)
*
* @return void
*/
protected function loadLocalization()
{
$wizardLabels = $GLOBALS['LANG']->includeLLFile('EXT:form/Resources/Private/Language/locallang_wizard.xlf', FALSE, TRUE);
$controllerLabels = $GLOBALS['LANG']->includeLLFile('EXT:form/Resources/Private/Language/locallang_controller.xlf', FALSE, TRUE);
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($controllerLabels, $wizardLabels);
$this->pageRenderer->addInlineLanguageLabelArray($controllerLabels['default']);
}
示例13: initializeAction
/**
* Add the needed JavaScript files for all actions
*/
public function initializeAction()
{
$this->pageRenderer->addInlineLanguageLabelFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf');
if ($this->configurationUtility->getCurrentConfiguration('extensionmanager')['offlineMode']['value']) {
$this->settings['offlineMode'] = true;
}
}
示例14: showAction
/**
* action show
*
* @param \Subugoe\Substaff\Domain\Model\Group $group
*/
public function showAction(\Subugoe\Substaff\Domain\Model\Group $group)
{
$this->pageRenderer->setTitle($group->getTitle());
// group's name should be shown as title
$GLOBALS['TSFE']->page['title'] = $group->getTitle();
$people = $this->personRepository->findGroupMembers($group);
$projects = $this->projectRepository->findProjectsByGroups($group->getUid());
if ($group->getParentGroup() === null) {
$subGroups = $this->groupRepository->findByParentGroup($group->getUid());
$this->view->assign('subGroups', $subGroups);
}
if ($this->settings['groupDetailTeaser']) {
$this->view->assign('showTeaser', $this->settings['groupDetailTeaser'])->assign('teaserLength', $this->settings['groupDetailTeaserLength']);
}
$this->view->assign('group', $group)->assign('people', $people)->assign('projects', $projects);
}
示例15: addJSInlineCode
/**
* Add JS inline code
*
* @param string $name
* @param string $block
* @param boolean $compress
* @param boolean $forceOnTop
* @param string $position
*/
public function addJSInlineCode($name, $block, $compress = true, $forceOnTop = false, $position = 'footer')
{
if ($position === 'header') {
$this->pageRenderer->addJsInlineCode($name, $block, $compress, $forceOnTop);
} else {
$this->pageRenderer->addJsFooterInlineCode($name, $block, $compress, $forceOnTop);
}
}