TYPO3 CMS  TYPO3_6-2
ExtensionRepository.php
Go to the documentation of this file.
1 <?php
25  protected $objectManager;
26 
30  protected $listUtility;
31 
35  protected $extensions = array();
36 
43  public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager) {
44  $this->objectManager = $objectManager;
45  }
46 
53  public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility) {
54  $this->listUtility = $listUtility;
55  }
56 
62  public function findAll() {
63  if (!count($this->extensions)) {
64  $availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensionsWithAdditionalInformation();
65 
66  foreach ($availableAndInstalledExtensions as $entry) {
68  $extension = $this->objectManager->get(
69  'TYPO3\CMS\Lang\Domain\Model\Extension',
70  $entry['key'],
71  $entry['title'],
72  $this->getExtensionIconWithPath($entry)
73  );
74  $extension->setVersionFromString($entry['version']);
75  $this->extensions[$entry['key']] = $extension;
76  }
77 
78  // Sort the list by extension key
79  ksort($this->extensions);
80  }
81 
82  return $this->extensions;
83  }
84 
89  protected function getExtensionIconWithPath($extensionEntry) {
90  $extensionIcon = $GLOBALS['TYPO3_LOADED_EXT'][$extensionEntry['key']]['ext_icon'];
91  if (empty($extensionIcon)) {
92  $extensionIcon = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionIcon(PATH_site . $extensionEntry['siteRelPath'] . '/');
93  }
94 
95  if (empty($extensionIcon)) {
96  $extensionIcon = '/typo3/clear.gif';
97  } else {
98  $extensionIcon = '../' . $extensionEntry['siteRelPath'] . '/' . $extensionIcon;
99  }
100 
101  return $extensionIcon;
102  }
103 }
injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility)
static getExtensionIcon($extensionPath, $returnFullPath=FALSE)
injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]