TYPO3 CMS  TYPO3_7-6
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 {
32  protected function initializeView(ViewInterface $view)
33  {
34  if ($view instanceof BackendTemplateView) {
36  parent::initializeView($view);
37  $this->generateMenu();
38  $this->registerDocheaderButtons();
39  }
40  }
41 
49  public function showAction($extensionKey)
50  {
51  \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Request for update script', 'extensionmanager', 0, $extensionKey);
52 
54  $updateScriptUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::class);
55  $updateScriptResult = $updateScriptUtility->executeUpdateIfNeeded($extensionKey);
56  $this->view
57  ->assign('updateScriptResult', $updateScriptResult)
58  ->assign('extensionKey', $extensionKey);
59  }
60 
67  protected function registerDocheaderButtons()
68  {
70  $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
71 
72  $uriBuilder = $this->controllerContext->getUriBuilder();
73 
74  $uri = $uriBuilder->reset()->uriFor('index', [], 'List');
75  $title = $this->translate('extConfTemplate.backToList');
76  $icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL);
77  $button = $buttonBar->makeLinkButton()
78  ->setHref($uri)
79  ->setTitle($title)
80  ->setIcon($icon);
81  $buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT);
82  }
83 }
static devLog($msg, $extKey, $severity=0, $dataVar=false)