/** * Gets a single extension info * * @param $extKey * @param $path * @param $list * @param string $type * @return void */ public function singleExtInfo($extKey, $path, &$list, $type = '') { if (@is_file($path . $extKey . '/ext_emconf.php')) { $relPath = '../' . substr($path, strlen(PATH_site)); $directLink = 'mod.php?M=tools_em'; $emConf = tx_em_Tools::includeEMCONF($path . $extKey . '/ext_emconf.php', $extKey); $manual = $path . $extKey . '/doc/manual.sxw'; $manualRelPath = $relPath . $extKey . '/doc/manual.sxw'; if ($type === '') { $type = tx_em_Tools::getExtTypeFromPath($path); } if (is_array($emConf)) { $key = count($list); $loaded = t3lib_extMgm::isLoaded($extKey); $exist = $this->findIndex($extKey, $list); if ($exist !== FALSE) { $key = $exist; $list[$key] = array('doubleInstall' => $list[$key]['doubleInstall'], 'doubleInstallShort' => $list[$key]['doubleInstallShort']); } $list[$key]['extkey'] = $extKey; $list[$key]['path'] = $path . $extKey; $list[$key]['nodePath'] = substr($path . $extKey, strlen(PATH_site)); $list[$key]['doubleInstall'] = $list[$key]['doubleInstall'] ? $list[$key]['doubleInstall'] . '/' . $this->types[$type] : $this->types[$type]; $list[$key]['doubleInstallShort'] .= $type; $list[$key] = t3lib_div::array_merge_recursive_overrule($list[$key], $emConf); if (@is_file($path . $extKey . '/class.ext_update.php')) { $list[$key]['updateModule'] = TRUE; } else { $list[$key]['updateModule'] = FALSE; } $list[$key]['type'] = $this->types[$type]; $list[$key]['typeShort'] = $type; $list[$key]['installed'] = $loaded ? 1 : 0; $state = htmlspecialchars($emConf['state']); $list[$key]['state'] = $this->states[$state]; $list[$key]['stateCls'] = 'state-' . $state; $list[$key]['title'] = htmlspecialchars($list[$key]['title']); $list[$key]['description'] = htmlspecialchars($list[$key]['description']); $list[$key]['author'] = htmlspecialchars($list[$key]['author']); $list[$key]['author_email'] = htmlspecialchars($list[$key]['author_email']); $list[$key]['files'] = t3lib_div::getFilesInDir($path . $extKey, '', 0, '', $this->excludeForPackaging); $list[$key]['reviewstate'] = $this->xmlHandler->getReviewState($extKey, $list[$key]['version']); $list[$key]['download'] = '<a href="' . htmlspecialchars($directLink . '&CMD[doBackup]=1&SET[singleDetails]=backup&CMD[showExt]=' . $extKey) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:download') . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-download') . '</a>'; $list[$key]['doc'] = ''; if ($list[$key]['docPath']) { $manual = $path . $extKey . '/' . $list[$key]['docPath'] . '/manual.sxw'; $manualRelPath = $relPath . $extKey . '/' . $list[$key]['docPath'] . '/manual.sxw'; } if (@is_file($manual)) { $list[$key]['doc'] = '<a href="' . htmlspecialchars($manualRelPath) . '" target="_blank">' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-documentation') . '</a>'; } $list[$key]['icon'] = @is_file($path . $extKey . '/ext_icon.gif') ? '<img src="' . $relPath . $extKey . '/ext_icon.gif" alt="" height="16" />' : '<img src="clear.gif" alt="" width="16" height="16" />'; $list[$key]['categoryShort'] = $list[$key]['category']; $list[$key]['category'] = isset($this->categories[$list[$key]['category']]) ? $this->categories[$list[$key]['category']] : $list[$key]['category']; $list[$key]['required'] = t3lib_div::inList(t3lib_extMgm::getRequiredExtensionList(), $extKey); $constraints = $this->humanizeConstraints($list[$key]['constraints']); $list[$key]['depends'] = $constraints['depends']; $list[$key]['conflicts'] = $constraints['conflicts']; $list[$key]['suggests'] = $constraints['suggests']; unset($list[$key]['_md5_values_when_last_written']); } } }
/** * Saves language selection * * @param array $parameter * @return string */ public function saveLanguageSelection($parameter) { $this->globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']); $selected = t3lib_div::trimExplode(',', $this->globalSettings['selectedLanguages'], TRUE); $dir = count($parameter) - count($selected); $diff = $dir < 0 ? array_diff($selected, $parameter) : array_diff($parameter, $selected); $type = tx_em_Tools::getExtTypeFromPath(t3lib_extMgm::extPath('em')); $params = array('extkey' => 'em', 'exttype' => $type, 'data' => array('selectedLanguages' => implode(',', $parameter))); $this->saveExtensionConfiguration($params); return array('success' => TRUE, 'dir' => $dir, 'diff' => implode('', $diff)); }