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


PHP DocumentTemplate::getPageRenderer方法代码示例

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


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

示例1: initialize

 /**
  * Initializes the Module
  *
  * @return 	void
  */
 public function initialize()
 {
     parent::init();
     $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->doc->setModuleTemplate(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('recycler') . 'mod1/mod_template.html');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setExtDirectStateProvider();
     $this->pageRenderer = $this->doc->getPageRenderer();
     $this->relativePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('recycler');
     $this->pageRecord = BackendUtility::readPageAccess($this->id, $this->perms_clause);
     $this->isAccessibleForCurrentUser = $this->id && is_array($this->pageRecord) || !$this->id && $this->isCurrentUserAdmin();
     //don't access in workspace
     if ($GLOBALS['BE_USER']->workspace !== 0) {
         $this->isAccessibleForCurrentUser = FALSE;
     }
     //read configuration
     $modTS = $GLOBALS['BE_USER']->getTSConfig('mod.recycler');
     if ($this->isCurrentUserAdmin()) {
         $this->allowDelete = TRUE;
     } else {
         $this->allowDelete = $modTS['properties']['allowDelete'] == '1';
     }
     if (isset($modTS['properties']['recordsPageLimit']) && (int) $modTS['properties']['recordsPageLimit'] > 0) {
         $this->recordsPageLimit = (int) $modTS['properties']['recordsPageLimit'];
     }
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:31,代码来源:RecyclerModuleController.php

示例2: __construct

 /**
  * Constructs this view
  *
  * Defines the global variable SOBE. Normally this is used by the wizards
  * which are one file only. This view is now the class with the global
  * variable name SOBE.
  *
  * Defines the document template object.
  *
  * @param \TYPO3\CMS\Form\Domain\Repository\ContentRepository $repository
  * @see \TYPO3\CMS\Backend\Template\DocumentTemplate
  */
 public function __construct(\TYPO3\CMS\Form\Domain\Repository\ContentRepository $repository)
 {
     parent::__construct($repository);
     $GLOBALS['LANG']->includeLLFile('EXT:form/Resources/Private/Language/locallang_wizard.xlf');
     $GLOBALS['SOBE'] = $this;
     // Define the document template object
     $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate('EXT:form/Resources/Private/Templates/Wizard.html');
     $this->pageRenderer = $this->doc->getPageRenderer();
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:23,代码来源:WizardView.php

示例3: processRequest

 /**
  * Processes a general request. The result can be returned by altering the given response.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
  * @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException if the controller doesn't support the current request type
  * @return void
  */
 public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
 {
     $this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->pageRenderer = $this->template->getPageRenderer();
     $GLOBALS['SOBE'] = new \stdClass();
     $GLOBALS['SOBE']->doc = $this->template;
     parent::processRequest($request, $response);
     $pageHeader = $this->template->startpage($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:module.title'));
     $pageEnd = $this->template->endPage();
     $response->setContent($pageHeader . $response->getContent() . $pageEnd);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:19,代码来源:AbstractController.php

示例4: __construct

 /**
  * Constructs this view
  *
  * Defines the global variable SOBE. Normally this is used by the wizards
  * which are one file only. This view is now the class with the global
  * variable name SOBE.
  *
  * Defines the document template object.
  *
  * @param \TYPO3\CMS\Form\Domain\Repository\ContentRepository $repository
  * @see \TYPO3\CMS\Backend\Template\DocumentTemplate
  */
 public function __construct(\TYPO3\CMS\Form\Domain\Repository\ContentRepository $repository)
 {
     parent::__construct($repository);
     $GLOBALS['SOBE'] = $this;
     // Define the document template object
     $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate('EXT:form/Resources/Private/Templates/Wizard.html');
     $this->pageRenderer = $this->doc->getPageRenderer();
     $this->pageRenderer->enableConcatenateFiles();
     $this->pageRenderer->enableCompressCss();
     $this->pageRenderer->enableCompressJavascript();
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:25,代码来源:WizardView.php

示例5: initDocumentTemplate

 /**
  * Initialize document template object
  *
  *  @return void
  */
 protected function initDocumentTemplate()
 {
     // Creating backend template object:
     $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->doc->bodyTagId = 'typo3-browse-links-php';
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     // Load the Prototype library and browse_links.js
     $this->doc->getPageRenderer()->loadPrototype();
     $this->doc->loadJavascriptLib('js/browse_links.js');
     $this->doc->loadJavascriptLib('js/tree.js');
 }
开发者ID:allipierre,项目名称:Typo3,代码行数:16,代码来源:ElementBrowser.php

示例6: initPage

    /**
     * Initialization for the visual parts of the class
     * Use template rendering only if this is a non-AJAX call
     *
     * @return void
     */
    public function initPage()
    {
        // Setting highlight mode:
        $this->doHighlight = !$GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.disableTitleHighlight');
        // If highlighting is active, define the CSS class for the active item depending on the workspace
        if ($this->doHighlight) {
            $hlClass = $GLOBALS['BE_USER']->workspace === 0 ? 'active' : 'active active-ws wsver' . $GLOBALS['BE_USER']->workspace;
        }
        // Create template object:
        $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_db_navframe.html');
        $this->doc->showFlashMessages = FALSE;
        // Get HTML-Template
        // Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
        $this->doc->getDragDropCode('pages');
        $this->doc->getContextMenuCode();
        /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
        $pageRenderer = $this->doc->getPageRenderer();
        $pageRenderer->loadScriptaculous('effects');
        $pageRenderer->loadExtJS();
        if ($this->hasFilterBox) {
            $pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/pagetreefiltermenu.js');
        }
        $this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
		// setting prefs for pagetree and drag & drop
		' . ($this->doHighlight ? 'Tree.highlightClass = "' . $hlClass . '";' : '') . '

		// Function, loading the list frame from navigation tree:
		function jumpTo(id, linkObj, highlightID, bank) { //
			var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
			if (theUrl.indexOf("?") != -1) {
				theUrl += "&id=" + id
			} else {
				theUrl += "?id=" + id
			}
			top.fsMod.currentBank = bank;
			top.TYPO3.Backend.ContentContainer.setUrl(theUrl);

			' . ($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '') . '
			if (linkObj) { linkObj.blur(); }
			return false;
		}
		' . ($this->cMR ? 'jumpTo(top.fsMod.recentIds[\'web\'],\'\');' : '') . ($this->hasFilterBox ? 'var TYPO3PageTreeFilter = new PageTreeFilter();' : '') . '

		');
        $this->doc->bodyTagId = 'typo3-pagetree';
    }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:54,代码来源:PageTreeNavigationController.php

示例7: initializeExtJs

    protected function initializeExtJs()
    {
        $pageRenderer = $this->document->getPageRenderer();
        $pageRenderer->loadExtJS();
        $pageRenderer->addInlineSettingArray($this->extjsNamespace, array('pageId' => $this->pageId));
        $extJsExtensionCorePath = $this->document->backPath . '../t3lib/js/extjs/ux/';
        $pageRenderer->addJsFile($extJsExtensionCorePath . 'Ext.grid.RowExpander.js');
        $pageRenderer->addJsFile($this->document->backPath . $GLOBALS['PATHrel_solr'] . 'Resources/JavaScript/ExtJs/override/gridpanel.js');
        $pageRenderer->addJsFile($this->document->backPath . $GLOBALS['PATHrel_solr'] . 'Resources/JavaScript/ModIndex/index_inspector.js');
        $pageRenderer->addCssInlineBlock('grid-selection-enabler', '
			.x-selectable, .x-selectable * {
				-moz-user-select: text!important;
				-khtml-user-select: text!important;
			}
		');
    }
开发者ID:nxpthx,项目名称:ext-solr,代码行数:16,代码来源:IndexInspector.php

示例8: init

 /**
  * Initializes the backend module
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     // Initialize document
     $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->doc->setModuleTemplate(ExtensionManagementUtility::extPath('kickstarter') . 'modfunc1/modfunc1_template.html');
     $this->pageRenderer = $this->doc->getPageRenderer();
     $this->doc->backPath = $this->backPath;
     $this->doc->bodyTagId = 'typo3-mod-php';
     $this->doc->bodyTagAdditions = 'class="tx_kickstarter_modfunc1"';
     // Create kickstarter instance
     $this->kickstarter = GeneralUtility::makeInstance('tx_kickstarter_wizard');
     $this->kickstarter->color = array($this->doc->bgColor5, $this->doc->bgColor4, $this->doc->bgColor);
     $this->kickstarter->siteBackPath = $this->doc->backPath . '../';
     $this->kickstarter->pObj = $this;
     $this->kickstarter->EMmode = 1;
 }
开发者ID:jaguerra,项目名称:TYPO3-Kickstarter,代码行数:22,代码来源:KickstarterModuleController.php

示例9: initPage

    /**
     * Initialization for the visual parts of the class
     * Use template rendering only if this is a non-AJAX call
     *
     * @return void
     */
    public function initPage()
    {
        // Setting highlight mode:
        $doHighlight = !$this->getBackendUser()->getTSConfigVal('options.pageTree.disableTitleHighlight');
        // Create template object:
        $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_db_navframe.html');
        $this->doc->showFlashMessages = FALSE;
        // Get HTML-Template
        // Adding javascript for drag & drop activation and highlighting
        $dragDropCode = 'Tree.registerDragDropHandlers();';
        // If highlighting is active, define the CSS class for the active item depending on the workspace
        if ($doHighlight) {
            $hlClass = $this->getBackendUser()->workspace === 0 ? 'active' : 'active active-ws wsver' . $this->getBackendUser()->workspace;
            $dragDropCode .= '
				Tree.highlightClass = "' . $hlClass . '";
				Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);';
        }
        // Adding javascript code for drag&drop and the pagetree as well as the click menu code
        $this->doc->getDragDropCode('pages', $dragDropCode);
        $this->doc->getContextMenuCode();
        /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
        $pageRenderer = $this->doc->getPageRenderer();
        $pageRenderer->loadExtJS();
        $this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
		// Function, loading the list frame from navigation tree:
		function jumpTo(id, linkObj, highlightID, bank) { //
			var theUrl = top.currentSubScript ;
			if (theUrl.indexOf("?") != -1) {
				theUrl += "&id=" + id
			} else {
				theUrl += "?id=" + id
			}
			top.fsMod.currentBank = bank;
			top.TYPO3.Backend.ContentContainer.setUrl(theUrl);

			' . ($doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '') . '
			if (linkObj) { linkObj.blur(); }
			return false;
		}
		' . ($this->cMR ? 'jumpTo(top.fsMod.recentIds[\'web\'],\'\');' : '') . '

		');
        $this->doc->bodyTagId = 'typo3-pagetree';
    }
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:52,代码来源:PageTreeNavigationController.php

示例10: initialize

 /**
  * Initializes the Module
  *
  * @return void
  */
 protected function initialize()
 {
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
             $this->hookObjectsArr[$linkType] = GeneralUtility::getUserObj($classRef);
         }
     }
     $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate('EXT:linkvalidator/Resources/Private/Templates/mod_template.html');
     $this->pageRecord = BackendUtility::readPageAccess($this->pObj->id, $this->getBackendUser()->getPagePermsClause(1));
     if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
         $this->isAccessibleForCurrentUser = TRUE;
     }
     $this->doc->addStyleSheet('module', 'sysext/linkvalidator/Resources/Public/Styles/styles.css');
     $this->doc->getPageRenderer()->loadJquery();
     $this->doc->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Linkvalidator/Linkvalidator');
     // Don't access in workspace
     if ($this->getBackendUser()->workspace !== 0) {
         $this->isAccessibleForCurrentUser = FALSE;
     }
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:27,代码来源:LinkValidatorReport.php

示例11: initialize

 /**
  * Initializes the Module
  *
  * @return void
  */
 protected function initialize()
 {
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $classRef) {
             $this->hookObjectsArr[$linkType] = GeneralUtility::getUserObj($classRef);
         }
     }
     $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('linkvalidator') . 'Resources/Private/Templates/mod_template.html');
     $this->relativePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('linkvalidator');
     $this->pageRecord = BackendUtility::readPageAccess($this->pObj->id, $GLOBALS['BE_USER']->getPagePermsClause(1));
     $this->pageRenderer = $this->doc->getPageRenderer();
     $this->isAccessibleForCurrentUser = FALSE;
     if ($this->pObj->id && is_array($this->pageRecord) || !$this->pObj->id && $this->isCurrentUserAdmin()) {
         $this->isAccessibleForCurrentUser = TRUE;
     }
     $this->loadHeaderData();
     // Don't access in workspace
     if ($GLOBALS['BE_USER']->workspace !== 0) {
         $this->isAccessibleForCurrentUser = FALSE;
     }
 }
开发者ID:rob-ot-dot-be,项目名称:ggallkeysecurity,代码行数:28,代码来源:LinkValidatorReport.php

示例12: init

 /**
  * Initialization of the class
  *
  * @return void
  */
 public function init()
 {
     // Setting GPvars:
     $this->id = intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'));
     $this->edit = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('edit');
     $this->return_id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('return_id');
     $this->lastEdited = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('lastEdited');
     // Module name;
     $this->MCONF = $GLOBALS['MCONF'];
     // Page select clause:
     $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
     // Initializing document template object:
     $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate('templates/perm.html');
     $this->doc->form = '<form action="' . $GLOBALS['BACK_PATH'] . 'tce_db.php" method="post" name="editform">';
     $this->doc->loadJavascriptLib('../t3lib/jsfunc.updateform.js');
     $this->doc->getPageRenderer()->loadPrototype();
     $this->doc->loadJavascriptLib(\TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath('perm') . 'mod1/perm.js');
     // Setting up the context sensitive menu:
     $this->doc->getContextMenuCode();
     // Set up menus:
     $this->menuConfig();
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:29,代码来源:PermissionModuleController.php

示例13: init

    /**
     * Initialises the Class
     *
     * @return void
     * @throws \InvalidArgumentException
     */
    public function init()
    {
        $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_wizards.xlf');
        // Setting GET vars (used in frameset script):
        $this->P = GeneralUtility::_GP('P', 1);
        //data[layouts][2][config]
        $this->formName = $this->P['formName'];
        $this->fieldName = $this->P['itemName'];
        $hmac_validate = GeneralUtility::hmac($this->formName . $this->fieldName, 'wizard_js');
        if (!$this->P['hmac'] || $this->P['hmac'] !== $hmac_validate) {
            throw new \InvalidArgumentException('Hmac Validation failed for backend_layout wizard', 1385811397);
        }
        $this->md5ID = $this->P['md5ID'];
        $uid = (int) $this->P['uid'];
        // Initialize document object:
        $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        /** @var PageRenderer $pageRenderer */
        $pageRenderer = $this->doc->getPageRenderer();
        $pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('gridelements') . 'Resources/Public/Backend/JavaScript/grideditor.js');
        $pageRenderer->addJsInlineCode('storeData', '
			function storeData(data) {
				if (parent.opener && parent.opener.document && parent.opener.document.' . $this->formName . ' && parent.opener.document.' . $this->formName . '[' . GeneralUtility::quoteJSvalue($this->fieldName) . ']) {
					parent.opener.document.' . $this->formName . '[' . GeneralUtility::quoteJSvalue($this->fieldName) . '].value = data;
					parent.opener.TBE_EDITOR.fieldChanged("backend_layout","' . $uid . '","config","data[backend_layout][' . $uid . '][config]");
				}
			}
			', FALSE);
        $languageLabels = array('save' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_labelSave', TRUE), 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_windowTitle', TRUE), 'editCell' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_editCell', TRUE), 'mergeCell' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_mergeCell', TRUE), 'splitCell' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_splitCell', TRUE), 'name' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_name', TRUE), 'column' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_column', TRUE), 'notSet' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_notSet', TRUE), 'nameHelp' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xlf:grid_nameHelp', TRUE), 'columnHelp' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_wizards.xml:grid_columnHelp', 1), 'allowedElementTypes' => $GLOBALS['LANG']->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:allowedElementTypes', 1), 'allowedElementTypesHelp' => $GLOBALS['LANG']->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:allowedElementTypesHelp', 1), 'allowedGridElementTypes' => $GLOBALS['LANG']->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:allowedGridElementTypes', 1), 'allowedGridElementTypesHelp' => $GLOBALS['LANG']->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:allowedGridElementTypesHelp', 1));
        $pageRenderer->addInlineLanguageLabelArray($languageLabels);
        // add gridelement wizard options information
        $ctypeLabels = array();
        $ctypeIcons = array();
        foreach ($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'] as $item) {
            $itemKey = $item[1];
            if (substr($itemKey, 0, 2) !== '--') {
                $ctypeLabels[$itemKey] = $GLOBALS['LANG']->sL($item[0], 1);
                if (strstr($item[2], '/typo3')) {
                    $ctypeIcons[$itemKey] = '../../../' . $item[2];
                } else {
                    $ctypeIcons[$itemKey] = '../../../' . '../typo3/sysext/t3skin/icons/gfx/' . $item[2];
                }
            }
        }
        $pageRenderer->addInlineLanguageLabelArray($ctypeLabels);
        $pageRenderer->addJsInlineCode('availableCTypes', '
			TYPO3.Backend.availableCTypes = ["' . join('","', array_keys($ctypeLabels)) . '"];
			TYPO3.Backend.availableCTypeIcons = ["' . join('","', $ctypeIcons) . '"];
		');
        // select record
        $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($this->P['field'], $this->P['table'], 'uid=' . (int) $this->P['uid']);
        if (trim($record[0][$this->P['field']]) === '') {
            $rows = array(array(array('colspan' => 1, 'rowspan' => 1, 'spanned' => FALSE, 'name' => '', 'allowed' => '')));
            $colCount = 1;
            $rowCount = 1;
        } else {
            // load TS parser
            $parser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
            $parser->parse($record[0][$this->P['field']]);
            $data = $parser->setup['backend_layout.'];
            $rows = array();
            $colCount = $data['colCount'];
            $rowCount = $data['rowCount'];
            $dataRows = $data['rows.'];
            $spannedMatrix = array();
            for ($i = 1; $i <= $rowCount; $i++) {
                $cells = array();
                $row = array_shift($dataRows);
                $columns = $row['columns.'];
                for ($j = 1; $j <= $colCount; $j++) {
                    $cellData = array();
                    if (!$spannedMatrix[$i][$j]) {
                        if (is_array($columns) && count($columns)) {
                            $column = array_shift($columns);
                            if (isset($column['colspan'])) {
                                $cellData['colspan'] = (int) $column['colspan'];
                                $columnColSpan = (int) $column['colspan'];
                                if (isset($column['rowspan'])) {
                                    $columnRowSpan = (int) $column['rowspan'];
                                    for ($spanRow = 0; $spanRow < $columnRowSpan; $spanRow++) {
                                        for ($spanColumn = 0; $spanColumn < $columnColSpan; $spanColumn++) {
                                            $spannedMatrix[$i + $spanRow][$j + $spanColumn] = 1;
                                        }
                                    }
                                } else {
                                    for ($spanColumn = 0; $spanColumn < $columnColSpan; $spanColumn++) {
                                        $spannedMatrix[$i][$j + $spanColumn] = 1;
                                    }
                                }
                            } else {
                                $cellData['colspan'] = 1;
                                if (isset($column['rowspan'])) {
                                    $columnRowSpan = (int) $column['rowspan'];
                                    for ($spanRow = 0; $spanRow < $columnRowSpan; $spanRow++) {
//.........这里部分代码省略.........
开发者ID:blumenbach,项目名称:bb-online.neu,代码行数:101,代码来源:BackendLayout.php

示例14: main

    /**
     * Main function, creating the listing
     *
     * @return void
     */
    public function main()
    {
        // Initialize the template object
        $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->setModuleTemplate('EXT:filelist/Resources/Private/Templates/file_list.html');
        /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
        $pageRenderer = $this->doc->getPageRenderer();
        $pageRenderer->loadJQuery();
        $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileListLocalisation');
        // There there was access to this file path, continue, make the list
        if ($this->folderObject) {
            // Create filelisting object
            $this->filelist = GeneralUtility::makeInstance(FileList::class);
            $this->filelist->backPath = $GLOBALS['BACK_PATH'];
            // Apply predefined values for hidden checkboxes
            // Set predefined value for DisplayBigControlPanel:
            $backendUser = $this->getBackendUser();
            if ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'activated') {
                $this->MOD_SETTINGS['bigControlPanel'] = TRUE;
            } elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'deactivated') {
                $this->MOD_SETTINGS['bigControlPanel'] = FALSE;
            }
            // Set predefined value for DisplayThumbnails:
            if ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'activated') {
                $this->MOD_SETTINGS['displayThumbs'] = TRUE;
            } elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'deactivated') {
                $this->MOD_SETTINGS['displayThumbs'] = FALSE;
            }
            // Set predefined value for Clipboard:
            if ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'activated') {
                $this->MOD_SETTINGS['clipBoard'] = TRUE;
            } elseif ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'deactivated') {
                $this->MOD_SETTINGS['clipBoard'] = FALSE;
            }
            // If user never opened the list module, set the value for displayThumbs
            if (!isset($this->MOD_SETTINGS['displayThumbs'])) {
                $this->MOD_SETTINGS['displayThumbs'] = $backendUser->uc['thumbnailsByDefault'];
            }
            $this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs'];
            // Create clipboard object and initialize that
            $this->filelist->clipObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Clipboard\Clipboard::class);
            $this->filelist->clipObj->fileMode = 1;
            $this->filelist->clipObj->initializeClipboard();
            $CB = GeneralUtility::_GET('CB');
            if ($this->cmd == 'setCB') {
                $CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(GeneralUtility::_POST('CBH'), (array) GeneralUtility::_POST('CBC')), '_FILE');
            }
            if (!$this->MOD_SETTINGS['clipBoard']) {
                $CB['setP'] = 'normal';
            }
            $this->filelist->clipObj->setCmd($CB);
            $this->filelist->clipObj->cleanCurrent();
            // Saves
            $this->filelist->clipObj->endClipboard();
            // If the "cmd" was to delete files from the list (clipboard thing), do that:
            if ($this->cmd == 'delete') {
                $items = $this->filelist->clipObj->cleanUpCBC(GeneralUtility::_POST('CBC'), '_FILE', 1);
                if (!empty($items)) {
                    // Make command array:
                    $FILE = array();
                    foreach ($items as $v) {
                        $FILE['delete'][] = array('data' => $v);
                    }
                    // Init file processing object for deleting and pass the cmd array.
                    $fileProcessor = GeneralUtility::makeInstance(ExtendedFileUtility::class);
                    $fileProcessor->init(array(), $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
                    $fileProcessor->setActionPermissions();
                    $fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0;
                    $fileProcessor->start($FILE);
                    $fileProcessor->processData();
                    $fileProcessor->pushErrorMessagesToFlashMessageQueue();
                }
            }
            if (!isset($this->MOD_SETTINGS['sort'])) {
                // Set default sorting
                $this->MOD_SETTINGS['sort'] = 'file';
                $this->MOD_SETTINGS['reverse'] = 0;
            }
            // Start up filelisting object, include settings.
            $this->pointer = MathUtility::forceIntegerInRange($this->pointer, 0, 100000);
            $this->filelist->start($this->folderObject, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
            // Generate the list
            $this->filelist->generateList();
            // Set top JavaScript:
            $this->doc->JScode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["file"] = "' . rawurlencode($this->id) . '";' . $this->filelist->CBfunctions());
            // This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers.
            $this->doc->getContextMenuCode();
            // Setting up the buttons and markers for docheader
            list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->folderObject);
            // add the folder info to the marker array
            $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo();
            $docHeaderButtons = array_merge($this->getButtons(), $buttons);
            // Include DragUploader only if we have write access
            if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) {
//.........这里部分代码省略.........
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:101,代码来源:FileListController.php

示例15: getJavascriptCode

 /**
  * Retrieves JavaScript code (header part) for editor
  *
  * @param \TYPO3\CMS\Backend\Template\DocumentTemplate $doc
  * @return string JavaScript code
  */
 public function getJavascriptCode($doc)
 {
     $content = '';
     if ($this->isEnabled()) {
         $path_t3e = \t3lib_extmgm::extRelPath('t3editor');
         $path_codemirror = 'contrib/codemirror/js/';
         // Include needed javascript-frameworks
         $pageRenderer = $doc->getPageRenderer();
         /** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
         $pageRenderer->loadPrototype();
         $pageRenderer->loadScriptaculous();
         // Include editor-css
         $content .= '<link href="' . \TYPO3\CMS\Core\Utility\GeneralUtility::createVersionNumberedFilename($GLOBALS['BACK_PATH'] . \t3lib_extmgm::extRelPath('t3editor') . 'res/css/t3editor.css') . '" type="text/css" rel="stylesheet" />';
         // Include editor-js-lib
         $doc->loadJavascriptLib($path_codemirror . 'codemirror.js');
         $doc->loadJavascriptLib($path_t3e . 'res/jslib/t3editor.js');
         $content .= \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS('T3editor = T3editor || {};' . 'T3editor.lang = ' . json_encode($this->getJavaScriptLabels()) . ';' . LF . 'T3editor.PATH_t3e = "' . $GLOBALS['BACK_PATH'] . $path_t3e . '"; ' . LF . 'T3editor.PATH_codemirror = "' . $GLOBALS['BACK_PATH'] . $path_codemirror . '"; ' . LF . 'T3editor.URL_typo3 = "' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir) . '"; ' . LF . 'T3editor.template = ' . $this->getPreparedTemplate() . ';' . LF . 'T3editor.ajaxSavetype = "' . $this->ajaxSaveType . '";' . LF);
         $content .= $this->getModeSpecificJavascriptCode();
     }
     return $content;
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:27,代码来源:T3Editor.php


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