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


PHP BackendUtility::readPageAccess方法代码示例

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


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

示例1: renderStatic

 /**
  * @param array $arguments
  * @param callable $renderChildrenClosure
  * @param RenderingContextInterface $renderingContext
  *
  * @return string
  */
 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 {
     $id = GeneralUtility::_GP('id');
     $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
     // Add icon with clickmenu, etc:
     /** @var IconFactory $iconFactory */
     $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     if ($pageRecord['uid']) {
         // If there IS a real page
         $altText = BackendUtility::getRecordIconAltText($pageRecord, 'pages');
         $theIcon = '<span title="' . $altText . '">' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>';
         // Make Icon:
         $theIcon = BackendUtility::wrapClickMenuOnIcon($theIcon, 'pages', $pageRecord['uid']);
         // Setting icon with clickmenu + uid
         $theIcon .= ' <em>[PID: ' . $pageRecord['uid'] . ']</em>';
     } else {
         // On root-level of page tree
         // Make Icon
         $theIcon = '<span title="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '">' . $iconFactory->getIcon('apps-pagetree-page-domain', Icon::SIZE_SMALL)->render() . '</span>';
         if ($GLOBALS['BE_USER']->user['admin']) {
             $theIcon = BackendUtility::wrapClickMenuOnIcon($theIcon, 'pages', 0);
         }
     }
     return $theIcon;
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:32,代码来源:PageInfoViewHelper.php

示例2: 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

示例3: render

 /**
  * Renders a record list as known from the TYPO3 list module
  * Note: This feature is experimental!
  *
  * @param string $tableName name of the database table
  * @param array $fieldList list of fields to be displayed. If empty, only the title column (configured in $TCA[$tableName]['ctrl']['title']) is shown
  * @param int $storagePid by default, records are fetched from the storage PID configured in persistence.storagePid. With this argument, the storage PID can be overwritten
  * @param int $levels corresponds to the level selector of the TYPO3 list module. By default only records from the current storagePid are fetched
  * @param string $filter corresponds to the "Search String" textbox of the TYPO3 list module. If not empty, only records matching the string will be fetched
  * @param int $recordsPerPage amount of records to be displayed at once. Defaults to $TCA[$tableName]['interface']['maxSingleDBListItems'] or (if that's not set) to 100
  * @param string $sortField table field to sort the results by
  * @param bool $sortDescending if TRUE records will be sorted in descending order
  * @param bool $readOnly if TRUE, the edit icons won't be shown. Otherwise edit icons will be shown, if the current BE user has edit rights for the specified table!
  * @param bool $enableClickMenu enables context menu
  * @param string $clickTitleMode one of "edit", "show" (only pages, tt_content), "info
  * @param bool $alternateBackgroundColors Deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
  * @return string the rendered record list
  * @see \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
  */
 public function render($tableName, array $fieldList = array(), $storagePid = NULL, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = FALSE, $readOnly = FALSE, $enableClickMenu = TRUE, $clickTitleMode = NULL, $alternateBackgroundColors = FALSE)
 {
     if ($alternateBackgroundColors) {
         \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('The option alternateBackgroundColors has no effect anymore and can be removed without problems. The parameter will be removed in TYPO3 CMS 8.');
     }
     $pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
     /** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */
     $dblist = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
     $dblist->backPath = $GLOBALS['BACK_PATH'];
     $dblist->pageRow = $pageinfo;
     if ($readOnly === FALSE) {
         $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
     }
     $dblist->showClipboard = FALSE;
     $dblist->disableSingleTableView = TRUE;
     $dblist->clickTitleMode = $clickTitleMode;
     $dblist->clickMenuEnabled = $enableClickMenu;
     if ($storagePid === NULL) {
         $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
         $storagePid = $frameworkConfiguration['persistence']['storagePid'];
     }
     $dblist->start($storagePid, $tableName, (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pointer'), $filter, $levels, $recordsPerPage);
     $dblist->allFields = TRUE;
     $dblist->dontShowClipControlPanels = TRUE;
     $dblist->displayFields = FALSE;
     $dblist->setFields = array($tableName => $fieldList);
     $dblist->noControlPanels = TRUE;
     $dblist->sortField = $sortField;
     $dblist->sortRev = $sortDescending;
     $dblist->script = $_SERVER['REQUEST_URI'];
     $dblist->generateList();
     return $dblist->HTMLcode;
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:52,代码来源:TableListViewHelper.php

示例4: render

 /**
  * Renders a record list as known from the TYPO3 list module
  * Note: This feature is experimental!
  *
  * @param string $tableName name of the database table
  * @param array $fieldList list of fields to be displayed. If empty, only the title column (configured in $TCA[$tableName]['ctrl']['title']) is shown
  * @param int $storagePid by default, records are fetched from the storage PID configured in persistence.storagePid. With this argument, the storage PID can be overwritten
  * @param int $levels corresponds to the level selector of the TYPO3 list module. By default only records from the current storagePid are fetched
  * @param string $filter corresponds to the "Search String" textbox of the TYPO3 list module. If not empty, only records matching the string will be fetched
  * @param int $recordsPerPage amount of records to be displayed at once. Defaults to $TCA[$tableName]['interface']['maxSingleDBListItems'] or (if that's not set) to 100
  * @param string $sortField table field to sort the results by
  * @param bool $sortDescending if TRUE records will be sorted in descending order
  * @param bool $readOnly if TRUE, the edit icons won't be shown. Otherwise edit icons will be shown, if the current BE user has edit rights for the specified table!
  * @param bool $enableClickMenu enables context menu
  * @param string $clickTitleMode one of "edit", "show" (only pages, tt_content), "info
  * @return string the rendered record list
  * @see \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList
  */
 public function render($tableName, array $fieldList = array(), $storagePid = null, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = false, $readOnly = false, $enableClickMenu = true, $clickTitleMode = null)
 {
     $pageinfo = BackendUtility::readPageAccess(GeneralUtility::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
     /** @var $dblist \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList */
     $dblist = GeneralUtility::makeInstance(\TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList::class);
     $dblist->pageRow = $pageinfo;
     if ($readOnly === false) {
         $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
     }
     $dblist->showClipboard = false;
     $dblist->disableSingleTableView = true;
     $dblist->clickTitleMode = $clickTitleMode;
     $dblist->clickMenuEnabled = $enableClickMenu;
     if ($storagePid === null) {
         $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
         $storagePid = $frameworkConfiguration['persistence']['storagePid'];
     }
     $dblist->start($storagePid, $tableName, (int) GeneralUtility::_GP('pointer'), $filter, $levels, $recordsPerPage);
     $dblist->allFields = true;
     $dblist->dontShowClipControlPanels = true;
     $dblist->displayFields = false;
     $dblist->setFields = array($tableName => $fieldList);
     $dblist->noControlPanels = true;
     $dblist->sortField = $sortField;
     $dblist->sortRev = $sortDescending;
     $dblist->script = $_SERVER['REQUEST_URI'];
     $dblist->generateList();
     return $dblist->HTMLcode;
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:47,代码来源:TableListViewHelper.php

示例5: render

 /**
  * Render javascript in header
  *
  * @return string the rendered page info icon
  * @see template::getPageInfo() Note: can't call this method as it's protected!
  */
 public function render()
 {
     $doc = $this->getDocInstance();
     $id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
     $pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
     // Add icon with clickmenu, etc:
     if ($pageRecord['uid']) {
         // If there IS a real page
         $alttext = BackendUtility::getRecordIconAltText($pageRecord, 'pages');
         $iconImg = IconUtility::getSpriteIconForRecord('pages', $pageRecord, array('title' => htmlspecialchars($alttext)));
         // Make Icon:
         $theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', $pageRecord['uid']);
     } else {
         // On root-level of page tree
         // Make Icon
         $iconImg = '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/i/_icon_website.gif') . ' alt="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '" />';
         if ($GLOBALS['BE_USER']->user['admin']) {
             $theIcon = $doc->wrapClickMenuOnIcon($iconImg, 'pages', 0);
         } else {
             $theIcon = $iconImg;
         }
     }
     // Setting icon with clickmenu + uid
     $pageInfo = $theIcon . '<em>[pid: ' . $pageRecord['uid'] . ']</em>';
     return $pageInfo;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:32,代码来源:PageInfoViewHelper.php

示例6: callModule

 /**
  * This method forwards the call to Bootstrap's run() method. This method is invoked by the mod.php
  * function of TYPO3.
  *
  * @param string $moduleSignature
  * @throws \RuntimeException
  * @return boolean TRUE, if the request request could be dispatched
  * @see run()
  */
 public function callModule($moduleSignature)
 {
     if (!isset($GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature])) {
         return FALSE;
     }
     $moduleConfiguration = $GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature];
     // Check permissions and exit if the user has no permission for entry
     $GLOBALS['BE_USER']->modAccess($moduleConfiguration, TRUE);
     $id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
     if ($id && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($id)) {
         // Check page access
         $permClause = $GLOBALS['BE_USER']->getPagePermsClause(TRUE);
         $access = is_array(\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess((int) $id, $permClause));
         if (!$access) {
             throw new \RuntimeException('You don\'t have access to this page', 1289917924);
         }
     }
     // BACK_PATH is the path from the typo3/ directory from within the
     // directory containing the controller file. We are using mod.php dispatcher
     // and thus we are already within typo3/ because we call typo3/mod.php
     $GLOBALS['BACK_PATH'] = '';
     $configuration = array('extensionName' => $moduleConfiguration['extensionName'], 'pluginName' => $moduleSignature);
     if (isset($moduleConfiguration['vendorName'])) {
         $configuration['vendorName'] = $moduleConfiguration['vendorName'];
     }
     $bootstrap = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Core\\BootstrapInterface');
     $content = $bootstrap->run('', $configuration);
     print $content;
     return TRUE;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:39,代码来源:ModuleRunner.php

示例7: main

    /**
     * Main module function
     *
     * @return void
     * @todo Define visibility
     */
    public function main()
    {
        // Start document template object:
        $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->bodyTagId = 'imp-exp-mod';
        $this->doc->setModuleTemplate(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . '/app/template.html');
        $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
        // JavaScript
        $this->doc->JScode = $this->doc->wrapScriptTags('
			script_ended = 0;
			function jumpToUrl(URL) {	//
				window.location.href = URL;
			}
		');
        // Setting up the context sensitive menu:
        $this->doc->getContextMenuCode();
        $this->doc->postCode = $this->doc->wrapScriptTags('
			script_ended = 1;
			if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
		');
        $this->doc->form = '<form action="' . htmlspecialchars($GLOBALS['MCONF']['_']) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '"><input type="hidden" name="id" value="' . $this->id . '" />';
        $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
        $this->content .= $this->doc->spacer(5);
        // Input data grabbed:
        $inData = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tx_impexp');
        $this->checkUpload();
        switch ((string) $inData['action']) {
            case 'export':
                // Finally: If upload went well, set the new file as the thumbnail in the $inData array:
                if (is_object($this->fileProcessor) && $this->fileProcessor->internalUploadMap[1]) {
                    $inData['meta']['thumbnail'] = md5($this->fileProcessor->internalUploadMap[1]);
                }
                // Call export interface
                $this->exportData($inData);
                break;
            case 'import':
                // Finally: If upload went well, set the new file as the import file:
                if (is_object($this->fileProcessor) && $this->fileProcessor->internalUploadMap[1]) {
                    $fI = pathinfo($this->fileProcessor->internalUploadMap[1]);
                    // Only allowed extensions....
                    if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('t3d,xml', strtolower($fI['extension']))) {
                        $inData['file'] = $this->fileProcessor->internalUploadMap[1];
                    }
                }
                // Call import interface:
                $this->importData($inData);
                break;
        }
        // Setting up the buttons and markers for docheader
        $docHeaderButtons = $this->getButtons();
        $markers['CONTENT'] = $this->content;
        // Build the <body> for the module
        $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
        $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        $this->content .= $this->doc->endPage();
        $this->content = $this->doc->insertStylesAndJS($this->content);
    }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:64,代码来源:ImportExportController.php

示例8: initializeView

 /**
  * Set up the doc header properly here
  *
  * @param ViewInterface $view
  */
 protected function initializeView(ViewInterface $view)
 {
     /** @var BackendTemplateView $view */
     parent::initializeView($view);
     $permissionClause = $this->getBackendUserAuthentication()->getPagePermsClause(1);
     $pageRecord = BackendUtility::readPageAccess($this->pageUid, $permissionClause);
     $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($pageRecord);
     $this->generateMenu();
 }
开发者ID:Gregpl,项目名称:TYPO3.CMS,代码行数:14,代码来源:AdministrationController.php

示例9: main

    /**
     * Main function of the module. Write the content to $this->content
     * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
     */
    function main()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
        // Access check!
        // The page will show only if there is a valid page and if this page may be viewed by the user
        $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        if ($this->id && $access || $BE_USER->user['admin'] && !$this->id || $BE_USER->user['uid'] && !$this->id) {
            // Draw the header.
            $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
            $this->doc->docType = 'xhtml_trans';
            $this->doc->backPath = $BACK_PATH;
            $this->doc->form = '<form action="" method="post">';
            // JavaScript
            $this->doc->JScode = '
				<script language="javascript" type="text/javascript">
					script_ended = 0;
					function jumpToUrl(URL)	{
						document.location = URL;
					}
				</script>
			';
            $this->doc->postCode = '
				<script language="javascript" type="text/javascript">
					script_ended = 1;
					if (top.fsMod) top.fsMod.recentIds["web"] = 0;
				</script>';
            $this->doc->inDocStylesArray[] = '
					.dirmenu a:link, .dirmenu a:visited {
						text-decoration: underline;
					}
					.description {
						margin-top: 8px;
					}';
            $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], -50);
            $this->content .= $this->doc->startPage($LANG->getLL('title'));
            $this->content .= $this->doc->header($LANG->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
            $this->content .= $this->doc->divider(5);
            // Render content:
            $this->moduleContent();
            // ShortCut
            if ($BE_USER->mayMakeShortcut()) {
                $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
            }
            $this->content .= $this->doc->spacer(10);
        } else {
            // If no access or if ID == zero
            $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
            $this->doc->backPath = $BACK_PATH;
            $this->content .= $this->doc->startPage($LANG->getLL('title'));
            $this->content .= $this->doc->header($LANG->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->spacer(10);
        }
    }
开发者ID:subugoe,项目名称:typo3-wec_map,代码行数:61,代码来源:index.php

示例10: main

    /**
     * Initialize module header etc and call extObjContent function
     *
     * @return void
     * @todo Define visibility
     */
    public function main()
    {
        global $LANG, $BACK_PATH;
        // Access check...
        // The page will show only if there is a valid page and if this page may be viewed by the user
        $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        // Template markers
        $markers = array('CSH' => '', 'FUNC_MENU' => '', 'CONTENT' => '');
        $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $BACK_PATH;
        $this->doc->setModuleTemplate('templates/func.html');
        // Main
        if ($this->id && $access) {
            // JavaScript
            $this->doc->JScode = $this->doc->wrapScriptTags('
				script_ended = 0;
				function jumpToUrl(URL) {	//
					window.location.href = URL;
				}
			');
            $this->doc->postCode = $this->doc->wrapScriptTags('
				script_ended = 1;
				if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
			');
            // Setting up the context sensitive menu:
            $this->doc->getContextMenuCode();
            $this->doc->form = '<form action="index.php" method="post"><input type="hidden" name="id" value="' . $this->id . '" />';
            $vContent = $this->doc->getVersionSelector($this->id, 1);
            if ($vContent) {
                $this->content .= $this->doc->section('', $vContent);
            }
            $this->extObjContent();
            // Setting up the buttons and markers for docheader
            $docHeaderButtons = $this->getButtons();
            $markers['CSH'] = $docHeaderButtons['csh'];
            $markers['FUNC_MENU'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
            $markers['CONTENT'] = $this->content;
        } else {
            // If no access or if ID == zero
            $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $LANG->getLL('clickAPage_content'), $LANG->getLL('title'), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
            $this->content = $flashMessage->render();
            // Setting up the buttons and markers for docheader
            $docHeaderButtons = $this->getButtons();
            $markers['CSH'] = $docHeaderButtons['csh'];
            $markers['CONTENT'] = $this->content;
        }
        // Build the <body> for the module
        $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        // Renders the module page
        $this->content = $this->doc->render($LANG->getLL('title'), $this->content);
    }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:58,代码来源:PageFunctionsController.php

示例11: main

    public function main()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS, $TYPO3_DB;
        $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        $this->pageId = $this->pageinfo['uid'];
        if ($this->id && $access || $BE_USER->user['admin'] && !$this->id) {
            // Draw the header.
            $this->doc = GeneralUtility::makeInstance('template');
            $this->doc->backPath = $BACK_PATH;
            $this->doc->form = '<form action="mod.php?M=web_txvalidateurlsM1" method="POST">';
            // JavaScript
            $this->doc->JScode = '
				<script language="javascript" type="text/javascript">
					script_ended = 0;
					function jumpToUrl(URL)
					{
						document.location = URL;
					}
				</script>
			';
            $this->doc->postCode = '
				<script language="javascript" type="text/javascript">
					script_ended = 1;
					if (top.fsMod) top.fsMod.recentIds["web"] = 0;
				</script>
			';
            $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], 50);
            $this->content .= $this->doc->startPage($LANG->getLL('title'));
            $this->content .= $this->doc->header($LANG->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
            $this->content .= $this->doc->divider(5);
            // Render content:
            $this->moduleContent();
            // ShortCut
            if ($BE_USER->mayMakeShortcut()) {
                $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
            }
            $this->content .= $this->doc->spacer(10);
            $this->content .= '</div>';
        } else {
            // If no access or if ID == zero
            $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
            $this->doc->backPath = $BACK_PATH;
            $this->content .= $this->doc->startPage($LANG->getLL('title'));
            $this->content .= $this->doc->header($LANG->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->spacer(10);
        }
    }
开发者ID:dschledermann,项目名称:typo3-linkservice,代码行数:51,代码来源:Module.php

示例12: main

    /**
     * Initialize module header etc and call extObjContent function
     *
     * @return void
     * @todo Define visibility
     */
    public function main()
    {
        // Access check...
        // The page will show only if there is a valid page and if this page may be viewed by the user
        $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
            $this->CALC_PERMS = $GLOBALS['BE_USER']->calcPerms($this->pageinfo);
            if ($GLOBALS['BE_USER']->user['admin'] && !$this->id) {
                $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
            }
            $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
            $this->doc->backPath = $GLOBALS['BACK_PATH'];
            $this->doc->setModuleTemplate('templates/info.html');
            $this->doc->tableLayout = array('0' => array('0' => array('<td valign="top"><strong>', '</strong></td>'), 'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><strong>', '</strong></td>')), 'defRow' => array('0' => array('<td valign="top">', '</td>'), 'defCol' => array('<td><img src="' . $this->doc->backPath . 'clear.gif" width="10" height="1" alt="" /></td><td valign="top">', '</td>')));
            // JavaScript
            $this->doc->JScode = $this->doc->wrapScriptTags('
				script_ended = 0;
				function jumpToUrl(URL) {	//
					window.location.href = URL;
				}
			');
            $this->doc->postCode = $this->doc->wrapScriptTags('
				script_ended = 1;
				if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
			');
            // Setting up the context sensitive menu:
            $this->doc->getContextMenuCode();
            $this->doc->form = '<form action="index.php" method="post" name="webinfoForm">';
            $vContent = $this->doc->getVersionSelector($this->id, 1);
            if ($vContent) {
                $this->content .= $this->doc->section('', $vContent);
            }
            $this->extObjContent();
            // Setting up the buttons and markers for docheader
            $docHeaderButtons = $this->getButtons();
            $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $this->content);
            // Build the <body> for the module
            $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
        } else {
            // If no access or if ID == zero
            $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\MediumDocumentTemplate');
            $this->doc->backPath = $GLOBALS['BACK_PATH'];
            $this->content = $this->doc->header($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->spacer(10);
        }
        // Renders the module page
        $this->content = $this->doc->render($GLOBALS['LANG']->getLL('title'), $this->content);
    }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:56,代码来源:InfoModuleController.php

示例13: main

    /**
     * Main function of the module. Write the content to $this->content
     * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
     *
     * @return	[type]		...
     */
    function main()
    {
        global $BE_USER, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
        // Access check!
        // The page will show only if there is a valid page and if this page may be viewed by the user
        $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        // create document template
        $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
            $this->doc->backPath = $BACK_PATH;
            $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';
            // JavaScript
            $this->doc->JScode = '
				<script language="javascript" type="text/javascript">
					script_ended = 0;
					function jumpToUrl(URL)	{
						document.location = URL;
					}
				</script>
			';
            $this->doc->postCode = '
				<script language="javascript" type="text/javascript">
					script_ended = 1;
					if (top.fsMod) top.fsMod.recentIds["web"] = 0;
				</script>
			';
            // add some css
            $cssFile = 'res/backendModule.css';
            $this->doc->getPageRenderer()->addCssFile(TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ke_search') . $cssFile);
            $this->content .= '<div id="typo3-docheader"><div class="typo3-docheader-functions">';
            $this->content .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
            $this->content .= '</div></div>';
            $this->content .= '<div id="typo3-docbody"><div id="typo3-inner-docbody">';
            $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
            // Render content:
            $this->moduleContent();
            // ShortCut
            if ($BE_USER->mayMakeShortcut()) {
                $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
            }
            $this->content .= $this->doc->spacer(10);
        } else {
            $this->doc->backPath = $BACK_PATH;
            $this->content .= '<div class="alert alert-info">' . $GLOBALS['LANG']->getLL('select_a_page') . '</div>';
            $this->content .= $this->doc->spacer(10);
        }
        $this->content .= '</div></div>';
    }
开发者ID:mneuhaus,项目名称:ke_search,代码行数:56,代码来源:index.php

示例14: main

    /**
     * Main function of the module.
     * Write the content to $this->content
     */
    function main()
    {
        // Access check!
        // The page will show only if there is a valid page and if this page may be viewed by the user
        $this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
            // Draw the header.
            $this->doc->form = '<form action="" method="POST">';
            // JavaScript
            $this->doc->JScode = '
				<script language="javascript" type="text/javascript">
					script_ended = 0;
					function jumpToUrl(URL)	{
						document.location = URL;
					}
				</script>
			';
            $this->doc->postCode = '
				<script language="javascript" type="text/javascript">
					script_ended = 1;
					if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
				</script>
			';
            $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.path') . ': ' . GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], -50);
            $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
            $this->content .= $this->doc->divider(5);
            // Render content:
            $this->moduleContent();
            // ShortCut
            if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
                $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
            }
            $this->content .= $this->doc->spacer(10);
        } else {
            // If no access or if ID == zero
            $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->spacer(10);
        }
    }
开发者ID:ulrikkold,项目名称:cal,代码行数:51,代码来源:CalIndexer.php

示例15: initializeAction

 /**
  * Initialize action
  *
  * @return void
  */
 protected function initializeAction()
 {
     // determine id parameter
     $this->id = (int) GeneralUtility::_GP('id');
     if ($this->request->hasArgument('id')) {
         $this->id = (int) $this->request->getArgument('id');
     }
     // determine depth parameter
     $this->depth = (int) GeneralUtility::_GP('depth') > 0 ? (int) GeneralUtility::_GP('depth') : $this->getBackendUser()->getSessionData(self::SESSION_PREFIX . 'depth');
     if ($this->request->hasArgument('depth')) {
         $this->depth = (int) $this->request->getArgument('depth');
     }
     $this->getBackendUser()->setAndSaveSessionData(self::SESSION_PREFIX . 'depth', $this->depth);
     $this->lastEdited = GeneralUtility::_GP('lastEdited');
     $this->returnId = GeneralUtility::_GP('returnId');
     $this->pageInfo = BackendUtility::readPageAccess($this->id, ' 1=1');
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:22,代码来源:PermissionController.php


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