本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::addInlineSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::addInlineSetting方法的具体用法?PHP PageRenderer::addInlineSetting怎么用?PHP PageRenderer::addInlineSetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Page\PageRenderer
的用法示例。
在下文中一共展示了PageRenderer::addInlineSetting方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddInlineSetting
/**
* test inline setting
*/
public function testAddInlineSetting()
{
$expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey":"myValue"}};';
$this->fixture->loadExtJS();
$this->fixture->addInlineSetting('myApp', 'myKey', 'myValue');
$this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_FOOTER);
$this->assertContains($expectedReturnValue, $out);
}
示例2: setLocallangSettings
/**
* This method loads the locallang.xml file (default language), and
* adds all keys found in it to the TYPO3.settings.extension_builder._LOCAL_LANG object
* translated into the current language
*
* Dots in a key are replaced by a _
*
* Example:
* error.name becomes TYPO3.settings.extension_builder._LOCAL_LANG.error_name
*
* @return void
*/
private function setLocallangSettings()
{
$LL = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLfile('EXT:extension_builder/Resources/Private/Language/locallang.xml', 'default');
if (!empty($LL['default']) && is_array($LL['default'])) {
foreach ($LL['default'] as $key => $value) {
$this->pageRenderer->addInlineSetting('extensionBuilder._LOCAL_LANG', str_replace('.', '_', $key), \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, 'extension_builder'));
}
}
}
示例3: loadResourcesForRegisteredNavigationComponents
/**
* Loads the css and javascript files of all registered navigation widgets
*
* @return void
*/
protected function loadResourcesForRegisteredNavigationComponents()
{
if (!is_array($GLOBALS['TBE_MODULES']['_navigationComponents'])) {
return;
}
$loadedComponents = array();
foreach ($GLOBALS['TBE_MODULES']['_navigationComponents'] as $module => $info) {
if (in_array($info['componentId'], $loadedComponents)) {
continue;
}
$loadedComponents[] = $info['componentId'];
$component = strtolower(substr($info['componentId'], strrpos($info['componentId'], '-') + 1));
$componentDirectory = 'components/' . $component . '/';
if ($info['isCoreComponent']) {
$absoluteComponentPath = PATH_site . 'typo3/js/extjs/' . $componentDirectory;
$relativeComponentPath = '../' . str_replace(PATH_site, '', $absoluteComponentPath);
} else {
$absoluteComponentPath = ExtensionManagementUtility::extPath($info['extKey']) . $componentDirectory;
$relativeComponentPath = ExtensionManagementUtility::extRelPath($info['extKey']) . $componentDirectory;
}
$cssFiles = GeneralUtility::getFilesInDir($absoluteComponentPath . 'css/', 'css');
if (file_exists($absoluteComponentPath . 'css/loadorder.txt')) {
// Don't allow inclusion outside directory
$loadOrder = str_replace('../', '', GeneralUtility::getUrl($absoluteComponentPath . 'css/loadorder.txt'));
$cssFilesOrdered = GeneralUtility::trimExplode(LF, $loadOrder, TRUE);
$cssFiles = array_merge($cssFilesOrdered, $cssFiles);
}
foreach ($cssFiles as $cssFile) {
$this->pageRenderer->addCssFile($relativeComponentPath . 'css/' . $cssFile);
}
$jsFiles = GeneralUtility::getFilesInDir($absoluteComponentPath . 'javascript/', 'js');
if (file_exists($absoluteComponentPath . 'javascript/loadorder.txt')) {
// Don't allow inclusion outside directory
$loadOrder = str_replace('../', '', GeneralUtility::getUrl($absoluteComponentPath . 'javascript/loadorder.txt'));
$jsFilesOrdered = GeneralUtility::trimExplode(LF, $loadOrder, TRUE);
$jsFiles = array_merge($jsFilesOrdered, $jsFiles);
}
foreach ($jsFiles as $jsFile) {
$this->pageRenderer->addJsFile($relativeComponentPath . 'javascript/' . $jsFile);
}
$this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', BackendUtility::getModuleUrl('record_history'));
}
}
示例4: main
/**
* Main function of the module. Write the content to $this->content
*
* @return void
*/
public function main()
{
// Access check!
// The page will show only if user has admin rights
if ($GLOBALS['BE_USER']->user['admin']) {
// Set the form
$this->doc->form = '<form name="tx_scheduler_form" id="tx_scheduler_form" method="post" action="">';
$this->pageRenderer->addInlineSetting('scheduler', 'runningIcon', ExtensionManagementUtility::extRelPath('scheduler') . 'res/gfx/status_running.png');
// Prepare main content
$this->content = $this->doc->header($GLOBALS['LANG']->getLL('function.' . $this->MOD_SETTINGS['function']));
$this->content .= $this->getModuleContent();
} else {
// If no access, only display the module's title
$this->content = $this->doc->header($GLOBALS['LANG']->getLL('title'));
$this->content .= $this->doc->spacer(5);
}
// Place content inside template
$content = $this->doc->moduleBody(array(), $this->getDocHeaderButtons(), $this->getTemplateMarkers());
// Renders the module page
$this->content = $this->doc->render($GLOBALS['LANG']->getLL('title'), $content);
}
示例5: generateJavascript
/**
* Generates the JavaScript code for the backend.
*
* @return void
*/
protected function generateJavascript()
{
$beUser = $this->getBackendUser();
// Needed for FormEngine manipulation (date picker)
$dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? array('MM-DD-YYYY', 'HH:mm MM-DD-YYYY') : array('DD-MM-YYYY', 'HH:mm DD-MM-YYYY');
$this->pageRenderer->addInlineSetting('DateTimePicker', 'DateFormat', $dateFormat);
// define the window size of the element browser etc.
$popupWindowWidth = 700;
$popupWindowHeight = 750;
$popupWindowSize = trim($beUser->getTSConfigVal('options.popupWindowSize'));
if (!empty($popupWindowSize)) {
list($popupWindowWidth, $popupWindowHeight) = GeneralUtility::intExplode('x', $popupWindowSize);
}
// define the window size of the popups within the RTE
$rtePopupWindowSize = trim($beUser->getTSConfigVal('options.rte.popupWindowSize'));
if (!empty($rtePopupWindowSize)) {
list($rtePopupWindowWidth, $rtePopupWindowHeight) = GeneralUtility::trimExplode('x', $rtePopupWindowSize);
}
$rtePopupWindowWidth = !empty($rtePopupWindowWidth) ? (int) $rtePopupWindowWidth : $popupWindowWidth - 200;
$rtePopupWindowHeight = !empty($rtePopupWindowHeight) ? (int) $rtePopupWindowHeight : $popupWindowHeight - 250;
$pathTYPO3 = GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/';
// If another page module was specified, replace the default Page module with the new one
$newPageModule = trim($beUser->getTSConfigVal('options.overridePageModule'));
$pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
if (!$beUser->check('modules', $pageModule)) {
$pageModule = '';
}
$t3Configuration = array('siteUrl' => GeneralUtility::getIndpEnv('TYPO3_SITE_URL'), 'PATH_typo3' => $pathTYPO3, 'PATH_typo3_enc' => rawurlencode($pathTYPO3), 'username' => htmlspecialchars($beUser->user['username']), 'userUid' => htmlspecialchars($beUser->user['uid']), 'uniqueID' => GeneralUtility::shortMD5(uniqid('', true)), 'securityLevel' => trim($GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']) ?: 'normal', 'TYPO3_mainDir' => TYPO3_mainDir, 'pageModule' => $pageModule, 'inWorkspace' => $beUser->workspace !== 0, 'workspaceFrontendPreviewEnabled' => $beUser->user['workspace_preview'] ? 1 : 0, 'veriCode' => $beUser->veriCode(), 'denyFileTypes' => PHP_EXTENSIONS_DEFAULT, 'moduleMenuWidth' => $this->menuWidth - 1, 'topBarHeight' => isset($GLOBALS['TBE_STYLES']['dims']['topFrameH']) ? (int) $GLOBALS['TBE_STYLES']['dims']['topFrameH'] : 30, 'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? (int) $GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup'] : false, 'listModulePath' => ExtensionManagementUtility::extRelPath('recordlist') . 'mod1/', 'debugInWindow' => $beUser->uc['debugInWindow'] ? 1 : 0, 'ContextHelpWindows' => array('width' => 600, 'height' => 400), 'PopupWindow' => array('width' => $popupWindowWidth, 'height' => $popupWindowHeight), 'RTEPopupWindow' => array('width' => $rtePopupWindowWidth, 'height' => $rtePopupWindowHeight));
$this->js .= '
TYPO3.configuration = ' . json_encode($t3Configuration) . ';
/**
* TypoSetup object.
*/
function typoSetup() { //
this.PATH_typo3 = TYPO3.configuration.PATH_typo3;
this.PATH_typo3_enc = TYPO3.configuration.PATH_typo3_enc;
this.username = TYPO3.configuration.username;
this.uniqueID = TYPO3.configuration.uniqueID;
this.securityLevel = TYPO3.configuration.securityLevel;
this.veriCode = TYPO3.configuration.veriCode;
this.denyFileTypes = TYPO3.configuration.denyFileTypes;
}
var TS = new typoSetup();
//backwards compatibility
/**
* Frameset Module object
*
* Used in main modules with a frameset for submodules to keep the ID between modules
* Typically that is set by something like this in a Web>* sub module:
* if (top.fsMod) top.fsMod.recentIds["web"] = "\'.(int)$this->id.\'";
* if (top.fsMod) top.fsMod.recentIds["file"] = "...(file reference/string)...";
*/
function fsModules() { //
this.recentIds=new Array(); // used by frameset modules to track the most recent used id for list frame.
this.navFrameHighlightedID=new Array(); // used by navigation frames to track which row id was highlighted last time
this.currentMainLoaded="";
this.currentBank="0";
}
var fsMod = new fsModules();
top.goToModule = function(modName, cMR_flag, addGetVars) {
TYPO3.ModuleMenu.App.showModule(modName, addGetVars);
}
' . $this->setStartupModule();
// Check editing of page:
$this->handlePageEditing();
}
示例6: loadCshJavascript
/**
* This loads everything needed for the Context Sensitive Help (CSH)
*
* @return void
*/
protected function loadCshJavascript()
{
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextHelp');
$this->pageRenderer->addInlineSetting('ContextHelp', 'moduleUrl', BackendUtility::getModuleUrl('help_cshmanual'));
}