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


PHP ModuleTemplate::header方法代码示例

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


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

示例1: main

 /**
  * Main
  *
  * @return void
  */
 public function main()
 {
     // Template markers
     $markers = array('CSH' => '', 'FUNC_MENU' => '', 'CONTENT' => '');
     // 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 = BackendUtility::readPageAccess($this->id, $this->perms_clause);
     $this->access = is_array($this->pageinfo);
     $lang = $this->getLanguageService();
     if ($this->id && $this->access) {
         $urlParameters = array('id' => $this->id, 'template' => 'all');
         $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
         // JavaScript
         $this->moduleTemplate->addJavaScriptCode('TSTemplateInlineJS', '
             function uFormUrl(aname) {
                 document.forms[0].action = ' . GeneralUtility::quoteJSvalue($aHref . '#') . '+aname;
             }
             function brPoint(lnumber,t) {
                 window.location.href = ' . GeneralUtility::quoteJSvalue($aHref . '&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateObjectBrowserModuleFunctionController&SET[ts_browser_type]=') . '+(t?"setup":"const")+"&breakPointLN="+lnumber;
                 return false;
             }
             if (top.fsMod) top.fsMod.recentIds["web"] = ' . $this->id . ';
         ');
         $this->moduleTemplate->getPageRenderer()->addCssInlineBlock('TSTemplateInlineStyle', '
             TABLE#typo3-objectBrowser { width: 100%; margin-bottom: 24px; }
             TABLE#typo3-objectBrowser A { text-decoration: none; }
             TABLE#typo3-objectBrowser .comment { color: maroon; font-weight: bold; }
             .ts-typoscript { width: 100%; }
             .tsob-search-submit {margin-left: 3px; margin-right: 3px;}
             .tst-analyzer-options { margin:5px 0; }
         ');
         // Setting up the context sensitive menu:
         $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
         // Build the module content
         $this->content = '<form action="' . htmlspecialchars($aHref) . '" method="post" enctype="multipart/form-data" id="TypoScriptTemplateModuleController" name="editForm" class="form">';
         $this->content .= $this->moduleTemplate->header($lang->getLL('moduleTitle'));
         $this->extObjContent();
         // Setting up the buttons and markers for docheader
         $this->getButtons();
         $this->generateMenu();
         $this->content .= '</form>';
     } else {
         // Template pages:
         $records = $this->getDatabaseConnection()->exec_SELECTgetRows('pages.uid, count(*) AS count, max(sys_template.root) AS root_max_val, min(sys_template.root) AS root_min_val', 'pages,sys_template', 'pages.uid=sys_template.pid' . BackendUtility::deleteClause('pages') . BackendUtility::versioningPlaceholderClause('pages') . BackendUtility::deleteClause('sys_template') . BackendUtility::versioningPlaceholderClause('sys_template'), 'pages.uid', 'pages.pid, pages.sorting');
         $pArray = array();
         foreach ($records as $record) {
             $this->setInPageArray($pArray, BackendUtility::BEgetRootLine($record['uid'], 'AND 1=1'), $record);
         }
         $table = '<div class="table-fit"><table class="table table-striped table-hover" id="ts-overview">' . '<thead>' . '<tr>' . '<th>' . $lang->getLL('pageName') . '</th>' . '<th>' . $lang->getLL('templates') . '</th>' . '<th>' . $lang->getLL('isRoot') . '</th>' . '<th>' . $lang->getLL('isExt') . '</th>' . '</tr>' . '</thead>' . '<tbody>' . implode('', $this->renderList($pArray)) . '</tbody>' . '</table></div>';
         $this->content = $this->moduleTemplate->header($lang->getLL('moduleTitle'));
         $this->content .= '<p class="lead">' . $lang->getLL('overview') . '</p>' . $table;
         // RENDER LIST of pages with templates, END
         // Setting up the buttons and markers for docheader
         $this->getButtons();
     }
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:61,代码来源:TypoScriptTemplateModuleController.php

示例2: main

    /**
     * Initialize module header etc and call extObjContent function
     *
     * @return void
     */
    public function main()
    {
        // We leave this here because of dependencies to submodules
        $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
        // The page will show only if there is a valid page and if this page
        // may be viewed by the user
        $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
        if ($this->pageinfo) {
            $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
        }
        $access = is_array($this->pageinfo);
        if ($this->id && $access || $this->backendUser->user['admin'] && !$this->id) {
            if ($this->backendUser->user['admin'] && !$this->id) {
                $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
            }
            // JavaScript
            $this->moduleTemplate->addJavaScriptCode('WebFuncInLineJS', 'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';
				function jumpToUrl(URL) {
					window.location.href = URL;
					return false;
				}
				');
            // Setting up the context sensitive menu:
            $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
            $this->content .= '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName)) . '" method="post" id="InfoModuleController" name="webinfoForm" class="form-inline form-inline-spaced">';
            $vContent = $this->moduleTemplate->getVersionSelector($this->id, 1);
            if ($vContent) {
                $this->content .= '<div>' . $vContent . '</div>';
            }
            $this->extObjContent();
            // Setting up the buttons and markers for docheader
            $this->getButtons();
            $this->generateMenu();
            $this->content .= '</form>';
        } else {
            // If no access or if ID == zero
            $this->content = $this->moduleTemplate->header($this->languageService->getLL('title'));
        }
    }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:44,代码来源:InfoModuleController.php


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