コード例 #1
0
 /**
  * Injects the request object for the current request or subrequest
  * Simply calls main() and writes the content to the response
  *
  * @param ServerRequestInterface $request the current request
  * @param ResponseInterface $response
  * @return ResponseInterface the response with the content
  */
 public function mainAction(ServerRequestInterface $request, ResponseInterface $response)
 {
     $GLOBALS['SOBE'] = $this;
     $this->main();
     $this->moduleTemplate->setContent($this->content);
     $response->getBody()->write($this->moduleTemplate->renderContent());
     return $response;
 }
コード例 #2
0
 /**
  * Main function, rendering the folder tree
  *
  * @return void
  */
 public function main()
 {
     // Produce browse-tree:
     $tree = $this->foldertree->getBrowsableTree();
     // Outputting page tree:
     $this->moduleTemplate->setContent($tree);
     // Setting up the buttons
     $this->getButtons();
     // Build the <body> for the module
     $this->moduleTemplate->setTitle('TYPO3 Folder Tree');
     $this->content = $this->moduleTemplate->renderContent();
 }
コード例 #3
0
 /**
  * Injects the request object for the current request or subrequest
  * Then checks for module functions that have hooked in, and renders menu etc.
  *
  * @param ServerRequestInterface $request the current request
  * @param ResponseInterface $response
  * @return ResponseInterface the response with the content
  */
 public function mainAction(ServerRequestInterface $request, ResponseInterface $response)
 {
     $GLOBALS['SOBE'] = $this;
     $this->init();
     // Checking for first level external objects
     $this->checkExtObj();
     $this->clearCache();
     $this->main();
     $this->moduleTemplate->setContent($this->content);
     $response->getBody()->write($this->moduleTemplate->renderContent());
     return $response;
 }
コード例 #4
0
ファイル: index.php プロジェクト: girardiv/image_autoresize
 /**
  * Renders a FlexForm configuration form.
  *
  * @return void
  */
 public function main()
 {
     $this->languageService->includeLLFile('EXT:image_autoresize/mod1/locallang.xlf');
     $this->processData();
     $formTag = '<form action="" method="post" name="editform">';
     if (version_compare(TYPO3_version, '7.5.99', '>')) {
         $this->moduleTemplate->setForm($formTag);
         $this->content .= sprintf('<h3>%s</h3>', $this->languageService->getLL('title', true));
         $this->addStatisticsAndSocialLink();
     } else {
         if (version_compare(TYPO3_version, '7.4.99', '<=')) {
             $this->initTCEForms();
         }
         $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
         $this->doc->setModuleTemplate(ExtensionManagementUtility::extPath($this->extKey) . 'mod1/mod_template.html');
         $this->doc->backPath = $GLOBALS['BACK_PATH'];
         $this->doc->form = $formTag;
         $this->content .= $this->doc->header($this->languageService->getLL('title'));
         $this->addStatisticsAndSocialLink();
         $this->content .= $this->doc->spacer(5);
     }
     $row = $this->config;
     if (version_compare(TYPO3_version, '7.5.0', '>=')) {
         $this->fixRecordForFormEngine($row, array('file_types', 'usergroup'));
         $this->moduleContent($row);
     } else {
         if ($row['rulesets']) {
             /** @var $flexObj \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools */
             $flexObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\FlexForm\\FlexFormTools');
             $row['rulesets'] = $flexObj->flexArray2Xml($row['rulesets'], true);
         }
         $this->moduleContentLegacy($row);
     }
     // Compile document
     if (version_compare(TYPO3_version, '7.5.99', '>')) {
         $this->addToolbarButtons();
         $this->moduleTemplate->setContent($this->content);
         $content = $this->moduleTemplate->renderContent();
     } else {
         $markers = array('FUNC_MENU' => '', 'CONTENT' => $this->content);
         // Build the <body> for the module
         $docHeaderButtons = $this->getButtons();
         $content = $this->doc->startPage($this->languageService->getLL('title'));
         $content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markers);
         $content .= $this->doc->endPage();
         // Wrap result appropriately
         $content = $this->doc->insertStylesAndJS($content);
     }
     // Replace module content with everything needed
     $this->content = $content;
 }
コード例 #5
0
 /**
  * Print accumulated content of module
  *
  * @return void
  */
 public function printContent()
 {
     echo $this->moduleTemplate->renderContent();
 }
コード例 #6
0
 /**
  * Loads the template source and render the template.
  * If "layoutName" is set in a PostParseFacet callback, it will render the file with the given layout.
  *
  * Additionally amends the rendered template with a module template "frame"
  *
  * @param string $actionName If set, the view of the specified action will be rendered instead. Default is the action specified in the Request object
  * @return string Rendered Template
  * @api
  */
 public function render($actionName = null)
 {
     $actionViewContent = $this->templateView->render($actionName);
     $this->moduleTemplate->setContent($actionViewContent);
     return $this->moduleTemplate->renderContent();
 }