Пример #1
0
    /**
     * Display extensions details.
     *
     * @param	string		Extension key
     * @return	void		Writes content to $this->content
     */
    function showExtDetails($extKey)
    {
        global $TYPO3_LOADED_EXT;
        list($list, ) = $this->extensionList->getInstalledExtensions();
        $absPath = tx_em_Tools::getExtPath($extKey, $list[$extKey]['type']);
        // Check updateModule:
        if (isset($list[$extKey]) && @is_file($absPath . 'class.ext_update.php')) {
            require_once $absPath . 'class.ext_update.php';
            $updateObj = new ext_update();
            if (!$updateObj->access()) {
                unset($this->MOD_MENU['singleDetails']['updateModule']);
            }
        } else {
            unset($this->MOD_MENU['singleDetails']['updateModule']);
        }
        if ($this->CMD['doDelete']) {
            $this->MOD_MENU['singleDetails'] = array();
        }
        // Function menu here:
        if (!$this->CMD['standAlone'] && !t3lib_div::_GP('standAlone')) {
            $content = $GLOBALS['LANG']->getLL('ext_details_ext') . '&nbsp;<strong>' . $this->extensionTitleIconHeader($extKey, $list[$extKey]) . '</strong> (' . htmlspecialchars($extKey) . ')';
            $this->content .= $this->doc->section('', $content);
        }
        // Show extension details:
        if ($list[$extKey]) {
            // Checking if a command for install/uninstall is executed:
            if (($this->CMD['remove'] || $this->CMD['load']) && !in_array($extKey, $this->requiredExt)) {
                // Install / Uninstall extension here:
                if (t3lib_extMgm::isLocalconfWritable()) {
                    // Check dependencies:
                    $depStatus = $this->install->checkDependencies($extKey, $list[$extKey]['EM_CONF'], $list);
                    if (!$this->CMD['remove'] && !$depStatus['returnCode']) {
                        $this->content .= $depStatus['html'];
                        $newExtList = -1;
                    } elseif ($this->CMD['remove']) {
                        $newExtList = $this->extensionList->removeExtFromList($extKey, $list);
                    } else {
                        $newExtList = $this->extensionList->addExtToList($extKey, $list);
                    }
                    // Successful installation:
                    if ($newExtList != -1) {
                        $updates = '';
                        if ($this->CMD['load']) {
                            if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                                $script = t3lib_div::linkThisScript(array('CMD[showExt]' => $extKey, 'CMD[load]' => 1, 'CMD[clrCmd]' => $this->CMD['clrCmd'], 'SET[singleDetails]' => 'info'));
                            } else {
                                $script = '';
                            }
                            $standaloneUpdates = '';
                            if ($this->CMD['standAlone']) {
                                $standaloneUpdates .= '<input type="hidden" name="standAlone" value="1" />';
                            }
                            if ($this->CMD['silendMode']) {
                                $standaloneUpdates .= '<input type="hidden" name="silendMode" value="1" />';
                            }
                            $depsolver = t3lib_div::_POST('depsolver');
                            if (is_array($depsolver['ignore'])) {
                                foreach ($depsolver['ignore'] as $depK => $depV) {
                                    $dependencyUpdates .= '<input type="hidden" name="depsolver[ignore][' . $depK . ']" value="1" />';
                                }
                            }
                            $updatesForm = $this->install->updatesForm($extKey, $list[$extKey], 1, $script, $dependencyUpdates . $standaloneUpdates . '<input type="hidden" name="_do_install" value="1" /><input type="hidden" name="_clrCmd" value="' . $this->CMD['clrCmd'] . '" />', TRUE);
                            if ($updatesForm) {
                                $updates = $GLOBALS['LANG']->getLL('ext_details_new_tables_fields') . '<br />' . $GLOBALS['LANG']->getLL('ext_details_new_tables_fields_select') . $updatesForm;
                                $labelDBUpdate = $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('ext_details_db_needs_update'), 'toUpper');
                                $this->content .= $this->doc->section(sprintf($GLOBALS['LANG']->getLL('ext_details_installing') . ' ', $this->extensionTitleIconHeader($extKey, $list[$extKey])) . ' ' . $labelDBUpdate, $updates, 1, 1, 1, 1);
                            }
                        } elseif ($this->CMD['remove']) {
                            $updates .= $this->install->checkClearCache($list[$extKey]);
                            if ($updates) {
                                $updates = '
								<form action="' . $this->script . '" method="post">' . $updates . '
								<br /><input type="submit" name="write" value="' . $GLOBALS['LANG']->getLL('ext_details_remove_ext') . '" />
								<input type="hidden" name="_do_install" value="1" />
								<input type="hidden" name="_clrCmd" value="' . $this->CMD['clrCmd'] . '" />
								<input type="hidden" name="CMD[showExt]" value="' . $this->CMD['showExt'] . '" />
								<input type="hidden" name="CMD[remove]" value="' . $this->CMD['remove'] . '" />
								<input type="hidden" name="standAlone" value="' . $this->CMD['standAlone'] . '" />
								<input type="hidden" name="silentMode" value="' . $this->CMD['silentMode'] . '" />
								' . ($this->noDocHeader ? '<input type="hidden" name="nodoc" value="1" />' : '') . '
								</form>';
                                $labelDBUpdate = $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('ext_details_db_needs_update'), 'toUpper');
                                $this->content .= $this->doc->section(sprintf($GLOBALS['LANG']->getLL('ext_details_removing') . ' ', $this->extensionTitleIconHeader($extKey, $list[$extKey])) . ' ' . $labelDBUpdate, $updates, 1, 1, 1, 1);
                            }
                        }
                        if (!$updates || t3lib_div::_GP('_do_install') || $this->noDocHeader && $this->CMD['remove']) {
                            $this->install->writeNewExtensionList($newExtList);
                            $action = $this->CMD['load'] ? 'installed' : 'removed';
                            $GLOBALS['BE_USER']->writelog(5, 1, 0, 0, 'Extension list has been changed, extension %s has been %s', array($extKey, $action));
                            if (!t3lib_div::_GP('silentMode') && !$this->CMD['standAlone']) {
                                $messageLabel = 'ext_details_ext_' . $action . '_with_key';
                                $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', sprintf($GLOBALS['LANG']->getLL($messageLabel), $extKey), '', t3lib_FlashMessage::OK, TRUE);
                                t3lib_FlashMessageQueue::addMessage($flashMessage);
                            }
                            if ($this->CMD['clrCmd'] || t3lib_div::_GP('_clrCmd')) {
                                if ($this->CMD['load'] && @is_file($absPath . 'ext_conf_template.txt')) {
                                    $vA = array('CMD' => array('showExt' => $extKey));
                                } else {
                                    $vA = array('CMD' => '');
                                }
                            } else {
                                $vA = array('CMD' => array('showExt' => $extKey));
                            }
                            if ($this->CMD['standAlone'] || t3lib_div::_GP('standAlone')) {
                                $this->content .= sprintf($GLOBALS['LANG']->getLL('ext_details_ext_installed_removed'), $this->CMD['load'] ? $GLOBALS['LANG']->getLL('ext_details_installed') : $GLOBALS['LANG']->getLL('ext_details_removed')) . '<br /><br />' . $this->getSubmitAndOpenerCloseLink();
                            } else {
                                // Determine if new modules were installed:
                                $techInfo = $this->install->makeDetailedExtensionAnalysis($extKey, $list[$extKey]);
                                if (($this->CMD['load'] || $this->CMD['remove']) && is_array($techInfo['flags']) && in_array('Module', $techInfo['flags'], true)) {
                                    $vA['CMD']['refreshMenu'] = 1;
                                }
                                t3lib_utility_Http::redirect(t3lib_div::linkThisScript($vA));
                                exit;
                            }
                        }
                    }
                } else {
                    $writeAccessError = $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('ext_details_write_access_error'), 'toUpper');
                    $this->content .= $this->doc->section(sprintf($GLOBALS['LANG']->getLL('ext_details_installing') . ' ', $this->extensionTitleIconHeader($extKey, $list[$extKey])) . ' ' . $writeAccessError, $GLOBALS['LANG']->getLL('ext_details_write_error_localconf'), 1, 1, 2, 1);
                }
            } elseif ($this->CMD['downloadFile'] && !in_array($extKey, $this->requiredExt)) {
                // Link for downloading extension has been clicked - deliver content stream:
                $dlFile = $this->CMD['downloadFile'];
                if (t3lib_div::isAllowedAbsPath($dlFile) && t3lib_div::isFirstPartOfStr($dlFile, PATH_site) && t3lib_div::isFirstPartOfStr($dlFile, $absPath) && @is_file($dlFile)) {
                    $mimeType = 'application/octet-stream';
                    Header('Content-Type: ' . $mimeType);
                    Header('Content-Disposition: attachment; filename=' . basename($dlFile));
                    echo t3lib_div::getUrl($dlFile);
                    exit;
                } else {
                    throw new RuntimeException('TYPO3 Fatal Error: ' . $GLOBALS['LANG']->getLL('ext_details_error_downloading'), 1270853980);
                }
            } elseif ($this->CMD['editFile'] && !in_array($extKey, $this->requiredExt)) {
                // Editing extension file:
                $editFile = rawurldecode($this->CMD['editFile']);
                if (t3lib_div::isAllowedAbsPath($editFile) && t3lib_div::isFirstPartOfStr($editFile, $absPath)) {
                    $fI = t3lib_div::split_fileref($editFile);
                    if (@is_file($editFile) && t3lib_div::inList($this->editTextExtensions, $fI['fileext'] ? $fI['fileext'] : $fI['filebody'])) {
                        if (filesize($editFile) < $this->kbMax * 1024) {
                            $outCode = '<form action="' . $this->script . ' method="post" name="editfileform">';
                            $info = '';
                            $submittedContent = t3lib_div::_POST('edit');
                            $saveFlag = 0;
                            if (isset($submittedContent['file']) && !$GLOBALS['TYPO3_CONF_VARS']['EXT']['noEdit']) {
                                // Check referer here?
                                $oldFileContent = t3lib_div::getUrl($editFile);
                                if ($oldFileContent != $submittedContent['file']) {
                                    $oldMD5 = md5(str_replace(CR, '', $oldFileContent));
                                    $info .= sprintf($GLOBALS['LANG']->getLL('ext_details_md5_previous'), '<strong>' . $oldMD5 . '</strong>') . '<br />';
                                    t3lib_div::writeFile($editFile, $submittedContent['file']);
                                    $saveFlag = 1;
                                } else {
                                    $info .= $GLOBALS['LANG']->getLL('ext_details_no_changes') . '<br />';
                                }
                            }
                            $fileContent = t3lib_div::getUrl($editFile);
                            $outCode .= sprintf($GLOBALS['LANG']->getLL('ext_details_file'), '<strong>' . substr($editFile, strlen($absPath)) . '</strong> (' . t3lib_div::formatSize(filesize($editFile)) . ')<br />');
                            $fileMD5 = md5(str_replace(CR, '', $fileContent));
                            $info .= sprintf($GLOBALS['LANG']->getLL('ext_details_md5_current'), '<strong>' . $fileMD5 . '</strong>') . '<br />';
                            if ($saveFlag) {
                                $saveMD5 = md5(str_replace(CR, '', $submittedContent['file']));
                                $info .= sprintf($GLOBALS['LANG']->getLL('ext_details_md5_submitted'), '<strong>' . $saveMD5 . '</strong>') . '<br />';
                                if ($fileMD5 != $saveMD5) {
                                    $info .= tx_em_Tools::rfw('<br /><strong>' . $GLOBALS['LANG']->getLL('ext_details_saving_failed_changes_lost') . '</strong>') . '<br />';
                                } else {
                                    $info .= tx_em_Tools::rfw('<br /><strong>' . $GLOBALS['LANG']->getLL('ext_details_file_saved') . '</strong>') . '<br />';
                                }
                            }
                            $outCode .= '<textarea name="edit[file]" rows="35" wrap="off"' . $this->doc->formWidthText(48, 'width:98%;height:70%', 'off') . ' class="fixed-font enable-tab">' . t3lib_div::formatForTextarea($fileContent) . '</textarea>';
                            $outCode .= '<input type="hidden" name="edit[filename]" value="' . $editFile . '" />';
                            $outCode .= '<input type="hidden" name="CMD[editFile]" value="' . htmlspecialchars($editFile) . '" />';
                            $outCode .= '<input type="hidden" name="CMD[showExt]" value="' . $extKey . '" />';
                            $outCode .= $info;
                            if (!$GLOBALS['TYPO3_CONF_VARS']['EXT']['noEdit']) {
                                $outCode .= '<br /><input type="submit" name="save_file" value="' . $GLOBALS['LANG']->getLL('ext_details_file_save_button') . '" />';
                            } else {
                                $outCode .= tx_em_Tools::rfw('<br />' . $GLOBALS['LANG']->getLL('ext_details_saving_disabled') . ' ');
                            }
                            $onClick = 'window.location.href="' . t3lib_div::linkThisScript(array('CMD[showExt]' => $extKey)) . '";return false;';
                            $outCode .= '<input type="submit" name="cancel" value="' . $GLOBALS['LANG']->getLL('ext_details_cancel_button') . '" onclick="' . htmlspecialchars($onClick) . '" /></form>';
                            $theOutput .= $this->doc->spacer(15);
                            $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_edit_file'), '', 0, 1);
                            $theOutput .= $this->doc->sectionEnd() . $outCode;
                            $this->content .= $theOutput;
                        } else {
                            $theOutput .= $this->doc->spacer(15);
                            $theOutput .= $this->doc->section(sprintf($GLOBALS['LANG']->getLL('ext_details_filesize_exceeded_kb'), $this->kbMax), sprintf($GLOBALS['LANG']->getLL('ext_details_file_too_large'), $this->kbMax));
                        }
                    }
                } else {
                    die(sprintf($GLOBALS['LANG']->getLL('ext_details_fatal_edit_error'), htmlspecialchars($editFile)));
                }
            } else {
                // MAIN:
                switch ((string) $this->MOD_SETTINGS['singleDetails']) {
                    case 'info':
                        // Loaded / Not loaded:
                        if (!in_array($extKey, $this->requiredExt)) {
                            if ($TYPO3_LOADED_EXT[$extKey]) {
                                $content = '<strong>' . $GLOBALS['LANG']->getLL('ext_details_loaded_and_running') . '</strong><br />' . '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('CMD[showExt]' => $extKey, 'CMD[remove]' => 1))) . '">' . $GLOBALS['LANG']->getLL('ext_details_remove_button') . ' ' . tx_em_Tools::removeButton() . '</a>';
                            } else {
                                $content = $GLOBALS['LANG']->getLL('ext_details_not_loaded') . '<br />' . '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('CMD[showExt]' => $extKey, 'CMD[load]' => 1))) . '">' . $GLOBALS['LANG']->getLL('ext_details_install_button') . ' ' . tx_em_Tools::installButton() . '</a>';
                            }
                        } else {
                            $content = $GLOBALS['LANG']->getLL('ext_details_always_loaded');
                        }
                        $this->content .= $this->doc->spacer(10);
                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_current_status'), $content, 0, 1);
                        if (t3lib_extMgm::isLoaded($extKey)) {
                            $updates = $this->install->updatesForm($extKey, $list[$extKey]);
                            if ($updates) {
                                $this->content .= $this->doc->spacer(10);
                                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_update_needed'), $updates . '<br /><br />' . $GLOBALS['LANG']->getLL('ext_details_notice_static_data'), 0, 1);
                            }
                        }
                        // Config:
                        if (@is_file($absPath . 'ext_conf_template.txt')) {
                            $this->content .= $this->doc->spacer(10);
                            $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_configuration'), $GLOBALS['LANG']->getLL('ext_details_notice_clear_cache') . '<br /><br />', 0, 1);
                            $this->content .= $this->install->tsStyleConfigForm($extKey, $list[$extKey]);
                        }
                        // Show details:
                        $headline = $GLOBALS['LANG']->getLL('ext_details_details');
                        $headline = t3lib_BEfunc::wrapInHelp('_MOD_tools_em', 'info', $headline);
                        $content = $this->extensionDetails->extInformationarray($extKey, $list[$extKey]);
                        $this->content .= $this->doc->spacer(10);
                        $this->content .= $this->doc->section($headline, $content, FALSE, TRUE, FALSE, TRUE);
                        break;
                    case 'upload':
                        $em = t3lib_div::_POST('em');
                        if ($em['action'] == 'doUpload') {
                            $em['extKey'] = $extKey;
                            $em['extInfo'] = $list[$extKey];
                            $content = $this->extensionDetails->uploadExtensionToTER($em);
                            $content .= $this->doc->spacer(10);
                            // Must reload this, because EM_CONF information has been updated!
                            list($list, ) = $this->extensionList->getInstalledExtensions();
                        } else {
                            // headline and CSH
                            $headline = $GLOBALS['LANG']->getLL('ext_details_upload_to_ter');
                            $headline = t3lib_BEfunc::wrapInHelp('_MOD_tools_em', 'upload', $headline);
                            // Upload:
                            if (substr($extKey, 0, 5) != 'user_') {
                                $content = $this->getRepositoryUploadForm($extKey, $list[$extKey]);
                                $eC = 0;
                            } else {
                                $content = $GLOBALS['LANG']->getLL('ext_details_no_unique_ext');
                                $eC = 2;
                            }
                            if (!$this->fe_user['username']) {
                                $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', sprintf($GLOBALS['LANG']->getLL('ext_details_no_username'), '<a href="' . t3lib_div::linkThisScript(array('SET[function]' => 3)) . '">', '</a>'), '', t3lib_FlashMessage::INFO);
                                $content .= '<br />' . $flashMessage->render();
                            }
                        }
                        $this->content .= $this->doc->section($headline, $content, 0, 1, $eC, TRUE);
                        break;
                    case 'backup':
                        if ($this->CMD['doDelete']) {
                            $content = $this->install->extDelete($extKey, $list[$extKey], $this->CMD);
                            $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_delete'), $GLOBALS['LANG']->getLL('ext_details_delete'), $content, 0, 1);
                        } else {
                            // headline and CSH
                            $headline = $GLOBALS['LANG']->getLL('ext_details_backup');
                            $headline = t3lib_BEfunc::wrapInHelp('_MOD_tools_em', 'backup_delete', $headline);
                            $content = $this->extBackup($extKey, $list[$extKey]);
                            $this->content .= $this->doc->section($headline, $content, 0, 1, 0, 1);
                            $content = $this->install->extDelete($extKey, $list[$extKey], $this->CMD);
                            $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_delete'), $content, 0, 1);
                            $content = $this->extUpdateEMCONF($extKey, $list[$extKey]);
                            $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_update_em_conf'), $content, 0, 1);
                        }
                        break;
                    case 'dump':
                        $this->extDumpTables($extKey, $list[$extKey]);
                        break;
                    case 'edit':
                        // headline and CSH
                        $headline = $GLOBALS['LANG']->getLL('ext_details_ext_files');
                        $headline = t3lib_BEfunc::wrapInHelp('_MOD_tools_em', 'editfiles', $headline);
                        $content = $this->getFileListOfExtension($extKey, $list[$extKey]);
                        $this->content .= $this->doc->section($headline, $content, FALSE, TRUE, FALSE, TRUE);
                        break;
                    case 'updateModule':
                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('ext_details_update'), is_object($updateObj) ? $updateObj->main() : $GLOBALS['LANG']->getLL('ext_details_no_update_object'), 0, 1);
                        break;
                    default:
                        $this->extObjContent();
                        break;
                }
            }
        }
    }
    /**
     * Listing of available (installed) extensions
     *
     * @return	void
     */
    function extensionList_installed()
    {
        list($list, $cat) = $this->getInstalledExtensions();
        // Available extensions
        if (is_array($cat[$this->parentObject->MOD_SETTINGS['listOrder']])) {
            $content = '';
            $lines = array();
            $lines[] = $this->extensionListRowHeader(' class="t3-row-header"', array('<td><img src="clear.gif" width="18" height="1" alt="" /></td>'));
            $allKeys = array();
            foreach ($cat[$this->parentObject->MOD_SETTINGS['listOrder']] as $catName => $extEkeys) {
                if (!$this->parentObject->MOD_SETTINGS['display_obsolete'] && $catName == 'obsolete') {
                    continue;
                }
                $allKeys[] = '';
                $allKeys[] = 'TYPE: ' . $catName;
                natcasesort($extEkeys);
                $extensions = array();
                foreach ($extEkeys as $extKey => $value) {
                    $allKeys[] = $extKey;
                    if ((!$list[$extKey]['EM_CONF']['shy'] || $this->parentObject->MOD_SETTINGS['display_shy']) && ($list[$extKey]['EM_CONF']['state'] != 'obsolete' || $this->parentObject->MOD_SETTINGS['display_obsolete']) && $this->parentObject->searchExtension($extKey, $list[$extKey])) {
                        $loadUnloadLink = t3lib_extMgm::isLoaded($extKey) ? '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('CMD[showExt]' => $extKey, 'CMD[remove]' => 1, 'CMD[clrCmd]' => 1, 'SET[singleDetails]' => 'info'))) . '">' . tx_em_Tools::removeButton() . '</a>' : '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('CMD[showExt]' => $extKey, 'CMD[load]' => 1, 'CMD[clrCmd]' => 1, 'SET[singleDetails]' => 'info'))) . '">' . tx_em_Tools::installButton() . '</a>';
                        if (in_array($extKey, $this->parentObject->requiredExt)) {
                            $loadUnloadLink = '<strong>' . tx_em_Tools::rfw($GLOBALS['LANG']->getLL('extension_required_short')) . '</strong>';
                        }
                        $theRowClass = t3lib_extMgm::isLoaded($extKey) ? 'em-listbg1' : 'em-listbg2';
                        $extensions[] = $this->extensionListRow($extKey, $list[$extKey], array('<td class="bgColor">' . $loadUnloadLink . '</td>'), $theRowClass);
                    }
                }
                if (count($extensions)) {
                    $lines[] = '<tr><td colspan="' . (3 + $this->parentObject->detailCols[$this->parentObject->MOD_SETTINGS['display_details']]) . '"><br /></td></tr>';
                    $lines[] = '<tr><td colspan="' . (3 + $this->parentObject->detailCols[$this->parentObject->MOD_SETTINGS['display_details']]) . '">' . t3lib_iconWorks::getSpriteIcon('apps-filetree-folder-default') . '<strong>' . htmlspecialchars($this->parentObject->listOrderTitle($this->parentObject->MOD_SETTINGS['listOrder'], $catName)) . '</strong></td></tr>';
                    $lines[] = implode(LF, $extensions);
                }
            }
            $content .= '


<!--
EXTENSION KEYS:

' . trim(implode(LF, $allKeys)) . '

-->

';
            $content .= sprintf($GLOBALS['LANG']->getLL('how_to_install'), tx_em_Tools::installButton()) . ' <br />' . sprintf($GLOBALS['LANG']->getLL('how_to_uninstall'), tx_em_Tools::removeButton()) . ' <br /><br />';
            $content .= '<form action="' . $this->parentObject->script . '" method="post" name="lookupform">';
            $content .= '<label for="lookUp">' . $GLOBALS['LANG']->getLL('look_up') . '</label> <input type="text" id="lookUp" name="lookUp" value="' . htmlspecialchars($this->parentObject->lookUpStr) . '" /><input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:search') . '" /></form><br /><br />';
            $content .= $this->securityHint . '<br /><br />';
            $content .= '<table cellspacing="1" class="t3-em-extension-list t3-em-extension-list-installed">' . implode('', $lines) . '</table>';
            return $content;
        }
    }
    /**
     *Check extension dependencies
     *
     * @param	string		$extKey
     * @param	array		$conf
     * @param	array		$instExtInfo
     * @return	array
     */
    function checkDependencies($extKey, $conf, $instExtInfo)
    {
        $content = '';
        $depError = false;
        $depIgnore = false;
        $msg = array();
        $depsolver = t3lib_div::_POST('depsolver');
        if (isset($conf['constraints']['depends']) && is_array($conf['constraints']['depends'])) {
            foreach ($conf['constraints']['depends'] as $depK => $depV) {
                if ($depsolver['ignore'][$depK]) {
                    $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_ignored'), $depK) . '
						<input type="hidden" value="1" name="depsolver[ignore][' . $depK . ']" />';
                    $depIgnore = true;
                    continue;
                }
                if ($depK == 'php') {
                    if (!$depV) {
                        continue;
                    }
                    $versionRange = tx_em_Tools::splitVersionRange($depV);
                    $phpv = strstr(PHP_VERSION, '-') ? substr(PHP_VERSION, 0, strpos(PHP_VERSION, '-')) : PHP_VERSION;
                    // Linux distributors like to add suffixes, like in 5.1.2-1. Those must be ignored!
                    if ($versionRange[0] != '0.0.0' && version_compare($phpv, $versionRange[0], '<')) {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_php_too_low'), $phpv, $versionRange[0]);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_requirement') . '</label>';
                        $depError = true;
                        continue;
                    } elseif ($versionRange[1] != '0.0.0' && version_compare($phpv, $versionRange[1], '>')) {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_php_too_high'), $phpv, $versionRange[1]);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_requirement') . '</label>';
                        $depError = true;
                        continue;
                    }
                } elseif ($depK == 'typo3') {
                    if (!$depV) {
                        continue;
                    }
                    // if the current TYPO3 version is a development version (like TYPO3 4.4-dev),
                    // then it should behave like TYPO3 4.4.0
                    $t3version = TYPO3_version;
                    if (stripos($t3version, '-dev') || stripos($t3version, '-alpha') || stripos($t3version, '-beta') || stripos($t3version, '-RC')) {
                        // find the last occurence of "-" and replace that part with a ".0"
                        $t3version = substr($t3version, 0, strrpos($t3version, '-')) . '.0';
                    }
                    $versionRange = tx_em_Tools::splitVersionRange($depV);
                    if ($versionRange[0] != '0.0.0' && version_compare($t3version, $versionRange[0], '<')) {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_typo3_too_low'), $t3version, $versionRange[0]);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_requirement') . '</label>';
                        $depError = true;
                        continue;
                    } elseif ($versionRange[1] != '0.0.0' && version_compare($t3version, $versionRange[1], '>')) {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_typo3_too_high'), $t3version, $versionRange[1]);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_requirement') . '</label>';
                        $depError = true;
                        continue;
                    }
                } elseif (strlen($depK) && !t3lib_extMgm::isLoaded($depK)) {
                    // strlen check for braindead empty dependencies coming from extensions...
                    if (!isset($instExtInfo[$depK])) {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_ext_not_available'), $depK);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-import', array('title' => $GLOBALS['LANG']->getLL('checkDependencies_import_ext'))) . '&nbsp;
							<a href="' . t3lib_div::linkThisUrl($this->parentObject->script, array('CMD[importExt]' => $depK, 'CMD[loc]' => 'L', 'CMD[standAlone]' => 1)) . '" target="_blank">' . $GLOBALS['LANG']->getLL('checkDependencies_import_now') . '</a>';
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_ext_requirement') . '</label>';
                    } else {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_ext_not_installed'), $depK, $instExtInfo[$depK]['EM_CONF']['title']);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;' . tx_em_Tools::installButton() . '&nbsp;
							<a href="' . t3lib_div::linkThisUrl($this->parentObject->script, array('CMD[showExt]' => $depK, 'CMD[load]' => 1, 'CMD[clrCmd]' => 1, 'CMD[standAlone]' => 1, 'SET[singleDetails]' => 'info')) . '" target="_blank">' . $GLOBALS['LANG']->getLL('checkDependencies_install_now') . '</a>';
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_ext_requirement') . '</label>';
                    }
                    $depError = true;
                } else {
                    $versionRange = tx_em_Tools::splitVersionRange($depV);
                    if ($versionRange[0] != '0.0.0' && version_compare($instExtInfo[$depK]['EM_CONF']['version'], $versionRange[0], '<')) {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_ext_too_low'), $depK, $instExtInfo[$depK]['EM_CONF']['version'], $versionRange[0]);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_requirement') . '</label>';
                        $depError = true;
                        continue;
                    } elseif ($versionRange[1] != '0.0.0' && version_compare($instExtInfo[$depK]['EM_CONF']['version'], $versionRange[1], '>')) {
                        $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_ext_too_high'), $depK, $instExtInfo[$depK]['EM_CONF']['version'], $versionRange[1]);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $depK . ']" id="checkIgnore_' . $depK . '" />
							<label for="checkIgnore_' . $depK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_requirement') . '</label>';
                        $depError = true;
                        continue;
                    }
                }
            }
        }
        if (($depError || $depIgnore) && $this->parentObject instanceof SC_mod_tools_em_index) {
            $content .= $this->parentObject->doc->section($GLOBALS['LANG']->getLL('removeExtFromList_dependency_error'), implode('<br />', $msg), 0, 1, 2);
        }
        // Check conflicts with other extensions:
        $conflictError = false;
        $conflictIgnore = false;
        $msg = array();
        if (isset($conf['constraints']['conflicts']) && is_array($conf['constraints']['conflicts'])) {
            foreach ((array) $conf['constraints']['conflicts'] as $conflictK => $conflictV) {
                if ($depsolver['ignore'][$conflictK]) {
                    $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_conflict_ignored'), $conflictK) . '
						<input type="hidden" value="1" name="depsolver[ignore][' . $conflictK . ']" />';
                    $conflictIgnore = true;
                    continue;
                }
                if (t3lib_extMgm::isLoaded($conflictK)) {
                    $versionRange = tx_em_Tools::splitVersionRange($conflictV);
                    if ($versionRange[0] != '0.0.0' && version_compare($instExtInfo[$conflictK]['EM_CONF']['version'], $versionRange[0], '<')) {
                        continue;
                    } elseif ($versionRange[1] != '0.0.0' && version_compare($instExtInfo[$conflictK]['EM_CONF']['version'], $versionRange[1], '>')) {
                        continue;
                    }
                    $msg[] = sprintf($GLOBALS['LANG']->getLL('checkDependencies_conflict_remove'), $extKey, $conflictK, $instExtInfo[$conflictK]['EM_CONF']['title'], $conflictK, $extKey);
                    $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;' . tx_em_Tools::removeButton() . '&nbsp;
						<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('CMD[showExt]' => $conflictK, 'CMD[remove]' => 1, 'CMD[clrCmd]' => 1, 'CMD[standAlone]' => 1, 'SET[singleDetails]' => 'info'))) . '" target="_blank">' . $GLOBALS['LANG']->getLL('checkDependencies_remove_now') . '</a>';
                    $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $conflictK . ']" id="checkIgnore_' . $conflictK . '" />
						<label for="checkIgnore_' . $conflictK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_conflict') . '</label>';
                    $conflictError = true;
                }
            }
        }
        if ($conflictError || $conflictIgnore) {
            $content .= $this->parentObject->doc->section($GLOBALS['LANG']->getLL('checkDependencies_conflict_error'), implode('<br />', $msg), 0, 1, 2);
        }
        // Check suggests on other extensions:
        if (isset($conf['constraints']['suggests']) && is_array($conf['constraints']['suggests'])) {
            $suggestion = false;
            $suggestionIgnore = false;
            $msg = array();
            foreach ($conf['constraints']['suggests'] as $suggestK => $suggestV) {
                if ($depsolver['ignore'][$suggestK]) {
                    $msg[] = '<br />' . sprintf($GLOBALS['LANG']->getLL('checkDependencies_suggestion_ignored'), $suggestK) . '
				<input type="hidden" value="1" name="depsolver[ignore][' . $suggestK . ']" />';
                    $suggestionIgnore = true;
                    continue;
                }
                if (!t3lib_extMgm::isLoaded($suggestK)) {
                    if (!isset($instExtInfo[$suggestK])) {
                        $msg[] = sprintf($GLOBALS['LANG']->getLL('checkDependencies_suggest_import'), $suggestK);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;' . t3lib_iconWorks::getSpriteIcon('actions-system-extension-import', array('title' => $GLOBALS['LANG']->getLL('checkDependencies_import_ext'))) . '&nbsp;
							<a href="' . t3lib_div::linkThisScript(array('CMD[importExt]' => $suggestK, 'CMD[loc]' => 'L', 'CMD[standAlone]' => 1)) . '" target="_blank">' . $GLOBALS['LANG']->getLL('checkDependencies_import_now') . '</a>';
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $suggestK . ']" id="checkIgnore_' . $suggestK . '" />
							<label for="checkIgnore_' . $suggestK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_suggestion') . '</label>';
                    } else {
                        $msg[] = sprintf($GLOBALS['LANG']->getLL('checkDependencies_suggest_installation'), $suggestK, $instExtInfo[$suggestK]['EM_CONF']['title']);
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;' . tx_em_Tools::installButton() . '&nbsp;
							<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('CMD[showExt]' => $suggestK, 'CMD[load]' => 1, 'CMD[clrCmd]' => 1, 'CMD[standAlone]' => 1, 'SET[singleDetails]' => 'info'))) . '" target="_blank">' . $GLOBALS['LANG']->getLL('checkDependencies_install_now') . '</a>';
                        $msg[] = '&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="1" name="depsolver[ignore][' . $suggestK . ']" id="checkIgnore_' . $suggestK . '" />
							<label for="checkIgnore_' . $suggestK . '">' . $GLOBALS['LANG']->getLL('checkDependencies_ignore_suggestion') . '</label>';
                    }
                    $suggestion = true;
                }
            }
            if ($suggestion || $suggestionIgnore) {
                $content .= $this->parentObject->doc->section(sprintf($GLOBALS['LANG']->getLL('checkDependencies_exts_suggested_by_ext'), $extKey), implode('<br />', $msg), 0, 1, 1);
            }
        }
        if ($depError || $conflictError || $suggestion) {
            foreach ($this->parentObject->CMD as $k => $v) {
                $content .= '<input type="hidden" name="CMD[' . $k . ']" value="' . $v . '" />';
            }
            $content .= '<br /><br /><input type="submit" value="' . $GLOBALS['LANG']->getLL('checkDependencies_try_again') . '" />';
            if (t3lib_div::_GP('nodoc')) {
                $content .= '<input type="hidden" name="nodoc" value="1" />';
            }
            return array('returnCode' => FALSE, 'html' => '<form action="' . $this->parentObject->script . '" method="post" name="depform">' . $content . '</form>');
        }
        return array('returnCode' => TRUE);
    }