TYPO3 CMS  TYPO3_8-7
UpdateScriptController.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
20 
25 {
31  protected function initializeView(ViewInterface $view)
32  {
33  if ($view instanceof BackendTemplateView) {
35  parent::initializeView($view);
36  $this->generateMenu();
37  $this->registerDocheaderButtons();
38  }
39  }
40 
47  public function showAction($extensionKey)
48  {
49  \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Request for update script', 'extensionmanager', 0, $extensionKey);
50 
52  $updateScriptUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::class);
53  $updateScriptResult = $updateScriptUtility->executeUpdateIfNeeded($extensionKey);
54  $this->view
55  ->assign('updateScriptResult', $updateScriptResult)
56  ->assign('extensionKey', $extensionKey);
57  }
58 
64  protected function registerDocheaderButtons()
65  {
67  $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
68 
69  $uriBuilder = $this->controllerContext->getUriBuilder();
70 
71  $uri = $uriBuilder->reset()->uriFor('index', [], 'List');
72  $title = $this->translate('extConfTemplate.backToList');
73  $icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL);
74  $button = $buttonBar->makeLinkButton()
75  ->setHref($uri)
76  ->setTitle($title)
77  ->setIcon($icon);
78  $buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT);
79  }
80 }
static devLog($msg, $extKey, $severity=0, $dataVar=false)