[TASK] Re-work/simplify copyright header in PHP files - Part 9
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Controller / DistributionController.php
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\Controller;
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 */
16 /**
17 * Controller for distribution related actions
18 *
19 * @author Susanne Moog <typo3@susannemoog.de>
20 */
21 class DistributionController extends AbstractController {
22
23 /**
24 * @var \TYPO3\CMS\Core\Package\PackageManager
25 * @inject
26 */
27 protected $packageManager;
28
29 /**
30 * Shows information about the distribution
31 *
32 * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
33 */
34 public function showAction(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
35 $extensionKey = $extension->getExtensionKey();
36 // Check if extension/package is installed
37 $active = $this->packageManager->isPackageActive($extensionKey);
38
39 // Create link for extension configuration
40 if ($active && file_exists(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extensionKey) . 'ext_conf_template.txt')) {
41 $uriBuilder = $this->controllerContext->getUriBuilder();
42 $action = 'showConfigurationForm';
43 $configurationLink = $uriBuilder->reset()->uriFor(
44 $action,
45 array('extension' => array('key' => $extensionKey)),
46 'Configuration'
47 );
48 } else {
49 $configurationLink = FALSE;
50 }
51 $this->view->assign('distributionActive', $active);
52 $this->view->assign('configurationLink', $configurationLink);
53 $this->view->assign('extension', $extension);
54 }
55 }