Merged Extension Manager (version for TYPO3 4.5 Beta 4)
authorSteffen Kamper <info@sk-typo3.de>
Wed, 12 Jan 2011 22:29:04 +0000 (22:29 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 12 Jan 2011 22:29:04 +0000 (22:29 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10053 709f56b5-9817-0410-a4d7-c38de5d9e867

39 files changed:
ChangeLog
typo3/sysext/em/classes/class.tx_em_develop.php
typo3/sysext/em/classes/class.tx_em_extensionmanager.php
typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php
typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectsoap.php
typo3/sysext/em/classes/connection/class.tx_em_connection_ter.php
typo3/sysext/em/classes/database/class.tx_em_database.php
typo3/sysext/em/classes/extensions/class.tx_em_extensions_details.php
typo3/sysext/em/classes/extensions/class.tx_em_extensions_list.php
typo3/sysext/em/classes/index.php
typo3/sysext/em/classes/install/class.tx_em_install.php
typo3/sysext/em/classes/parser/class.tx_em_parser_mirrorxmlabstractparser.php
typo3/sysext/em/classes/repository/class.tx_em_repository.php
typo3/sysext/em/classes/settings/class.tx_em_settings.php
typo3/sysext/em/classes/tools/class.tx_em_tools.php
typo3/sysext/em/classes/tools/class.tx_em_tools_unzip.php
typo3/sysext/em/classes/translations/class.tx_em_translations.php
typo3/sysext/em/ext_autoload.php
typo3/sysext/em/ext_conf_template.txt [new file with mode: 0644]
typo3/sysext/em/ext_emconf.php
typo3/sysext/em/language/locallang.xml
typo3/sysext/em/res/css/t3_em.css
typo3/sysext/em/res/icons/email.png [new file with mode: 0644]
typo3/sysext/em/res/icons/repupdate.png [new file with mode: 0644]
typo3/sysext/em/res/js/em_app.js
typo3/sysext/em/res/js/em_components.js
typo3/sysext/em/res/js/em_files.js
typo3/sysext/em/res/js/em_languages.js
typo3/sysext/em/res/js/em_layouts.js
typo3/sysext/em/res/js/em_locallist.js
typo3/sysext/em/res/js/em_repositorylist.js
typo3/sysext/em/res/js/em_settings.js
typo3/sysext/em/res/js/em_ter.js
typo3/sysext/em/res/js/em_tools.js
typo3/sysext/em/res/js/em_usertools.js
typo3/sysext/em/res/js/overrides/ext_overrides.js
typo3/sysext/em/res/js/ux/custom_plugins.js
typo3/sysext/em/res/js/ux/rowpanelexpander.js
typo3/sysext/em/res/js/ux/searchfield.js

index e901068..5cbeaa4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
 2011-01-12  Jigal van Hemert  <jigal@xs4all.nl>
 
-       * Fixed issue #16806: pages_language_overlay does not fit new page layout 
+       * Fixed issue #16806: pages_language_overlay does not fit new page layout
        * Follow-up to #16986: Grid wizard miss tooltips and localization
 
 2011-01-12  Steffen Kamper  <steffen@typo3.org>
 
+       * Merged Extension Manager (version for TYPO3 4.5 Beta 4)
        * Fixed issue #16986: Grid wizard miss tooltips and localization
 
 2011-01-12  Ingo Renner  <ingo@typo3.org>
index 21a9153..f0c2b2c 100644 (file)
@@ -95,6 +95,7 @@ class tx_em_Develop {
                $menu .= '&nbsp;<input type="button" value="Single Ext Update" onclick="document.location.href=\'' . htmlspecialchars(t3lib_div::linkThisScript(array('devCmd'=>'single','sub'=>'update'))) . '\';" />';
                $menu .= '&nbsp;<input type="button" value="Single Ext Config" onclick="document.location.href=\'' . htmlspecialchars(t3lib_div::linkThisScript(array('devCmd'=>'single','sub'=>'config'))) . '\';" />';
                $menu .= '&nbsp;<input type="button" value="Single Ext Files" onclick="document.location.href=\'' . htmlspecialchars(t3lib_div::linkThisScript(array('devCmd'=>'single','sub'=>'files'))) . '\';" />';
+               $menu .= '&nbsp;<input type="button" value="Single Ext DevInfo" onclick="document.location.href=\'' . htmlspecialchars(t3lib_div::linkThisScript(array('devCmd'=>'single','sub'=>'devinfo'))) . '\';" />';
                $menu .= '&nbsp;<input type="button" value="get Settings" onclick="document.location.href=\'' . htmlspecialchars(t3lib_div::linkThisScript(array('devCmd'=>'settings'))) . '\';" />';
                $menu .= '&nbsp;<input type="button" value="get Labels" onclick="document.location.href=\'' . htmlspecialchars(t3lib_div::linkThisScript(array('devCmd'=>'labels'))) . '\';" />';
                $menu .= '<hr />';
@@ -331,6 +332,10 @@ class tx_em_Develop {
                                        $path = $path . $this->extKey . '/';
                                        $files = t3lib_div::getAllFilesAndFoldersInPath(array(), $path, '', 1, 20, '.svn');
                                        $content = '<h2>Files from ' . $this->extKey . ' (' . $path . ')</h2>' . t3lib_utility_Debug::viewArray($files);
+                                       break;
+                               case 'devinfo':
+                                       $extensionDetails = t3lib_div::makeInstance('tx_em_Extensions_Details');
+                                       $content = '<h2>DevInfo from ' . $this->extKey . ' (' . $path . ')</h2>' . $extensionDetails->extInformationarray($this->extKey, $info);
                        }
                }
 
index 6ae0c47..de0ac8f 100644 (file)
@@ -149,10 +149,9 @@ class tx_em_ExtensionManager {
                $labels = tx_em_Tools::getArrayFromLocallang(t3lib_extMgm::extPath('em', 'language/locallang.xml'));
                $this->pageRenderer->addInlineLanguageLabelArray($labels);
 
-               /* TODO: new users have no settings */
+               $globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']);
+
                $settings = $this->parentObject->MOD_SETTINGS;
-               // TODO add mirrors to sys_ter record and delete from settings
-               // restructure mirror data
                $mirrors = unserialize($settings['extMirrors']);
                $settings['extMirrors'] = array(array('Random (recommended)', '', '', '', '', '', ''));
                if (is_array($mirrors)) {
@@ -164,6 +163,9 @@ class tx_em_ExtensionManager {
                        }
                }
 
+               $allowRepositoryUpdate = !intval($GLOBALS['BE_USER']->getTSConfigVal('mod.tools_em.hideRepositoryUpdate'));
+
+                       // add the settings
                $additionalSettings = array(
                        'siteUrl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL'),
                        'backPath' => $this->parentObject->doc->backPath,
@@ -172,9 +174,10 @@ class tx_em_ExtensionManager {
                        'editorCss' => $this->resPath . 'css/editor.css',
                        'codemirrorCssPath' => $this->parentObject->doc->backPath . 'contrib/codemirror/css/',
                        'codemirrorJsPath' => $this->parentObject->doc->backPath . 'contrib/codemirror/js/',
-                       'selectedLanguages' => unserialize($settings['selectedLanguages']),
-                       'selectedLanguagesList' => implode(',', (array) $settings['selectedLanguages']),
+                       'selectedLanguages' => t3lib_div::trimExplode(',', $globalSettings['selectedLanguages'], TRUE),
                        'state' => $GLOBALS['BE_USER']->uc['moduleData']['tools_em']['States'],
+                       'inlineToWindow' => $globalSettings['inlineToWindow'],
+                       'allowRepositoryUpdate' => $allowRepositoryUpdate
                );
                $settings = array_merge($settings, $additionalSettings);
 
@@ -190,7 +193,7 @@ class tx_em_ExtensionManager {
                $this->pageRenderer->addJsFile($this->resPath . 'js/overrides/ext_overrides.js');
                $this->pageRenderer->addJsFile($this->resPath . 'js/ux/custom_plugins.js');
                $this->pageRenderer->addJsFile($this->parentObject->doc->backPath . '../t3lib/js/extjs/ux/Ext.ux.FitToParent.js');
-               $this->pageRenderer->addJsFile($this->resPath . 'js/ux/rowpanelexpander.js');
+               $this->pageRenderer->addJsFile($this->resPath . 'js/ux/RowPanelExpander.js');
                $this->pageRenderer->addJsFile($this->resPath . 'js/ux/searchfield.js');
                $this->pageRenderer->addJsFile($this->resPath . 'js/ux/fileuploadfield.js');
                $this->pageRenderer->addJsFile($this->resPath . 'js/ux/menu/RangeMenu.js');
@@ -227,7 +230,12 @@ class tx_em_ExtensionManager {
                //Update from repository - box
                //$content = $this->parentObject->showRepositoryUpdateForm(0);
 
-               $content .= '<div id="em-message-area"></div><div id="em-app"></div>';
+               $content .= '
+
+                       <div id="em-message-area"></div><div id="em-app"></div>
+                       <!-- dummy form to make configuration js happy -->
+                       <form name="tsStyleConfigForm" action="" method="post"></form>
+               ';
                return $content;
        }
 
index e5e0977..33baba3 100644 (file)
@@ -39,7 +39,7 @@ class tx_em_Connection_ExtDirectServer {
        /**
         * @var tx_em_Tools_XmlHandler
         */
-       var $xmlhandler;
+       var $xmlHandler;
 
        /**
         * Class for printing extension lists
@@ -62,6 +62,7 @@ class tx_em_Connection_ExtDirectServer {
         */
        static protected $objSettings;
 
+       protected $globalSettings;
 
        /*********************************************************************/
        /* General                                                           */
@@ -74,6 +75,7 @@ class tx_em_Connection_ExtDirectServer {
         */
        public function __construct() {
                $this->template = t3lib_div::makeInstance('template');
+               $this->globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']);
        }
 
 
@@ -114,15 +116,31 @@ class tx_em_Connection_ExtDirectServer {
 
        }
 
+       public function getFlatExtensionList() {
+               $list = $this->getExtensionList();
+               $flatList = array();
+               foreach ($list['data'] as $entry) {
+                       $flatList[$entry['extkey']] = array(
+                               'version' => $entry['version'],
+                               'intversion' => t3lib_div::int_from_ver($entry['version']),
+                               'installed' => $entry['installed'],
+                               'typeShort' => $entry['typeShort'],
+                       );
+               }
+               return array(
+                       'length' => count($flatList),
+                       'data' => $flatList
+               );
+       }
+
        /**
-        * Enter description here...
+        * Render extensionlist for languages
         *
         * @return unknown
         */
        public function getInstalledExtkeys() {
-               $list = t3lib_div::makeInstance('tx_em_Extensions_List');
-               $extList = $list->getInstalledExtensions(TRUE);
-
+               $list = $this->getExtensionList();
+               $extList = $list['data'];
 
                $temp = $this->getSettings();
                $selectedLanguage = unserialize($temp['selectedLanguages']);
@@ -186,9 +204,9 @@ class tx_em_Connection_ExtDirectServer {
                        $extension->singleExtInfo($extKey, $path, $ext);
                        $ext = $ext[0];
                        $update = $install->checkDBupdates($extKey, $ext);
-                       return $update ? $update : 'Extension is up to date.';
+                       return $update ? $update : $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extUpToDate');
                } else {
-                       return 'Extension "' . htmlspecialchars($extKey) . '" is not installed.';
+                       return sprintf($GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extNotInstalled') ,htmlspecialchars($extKey));
                }
        }
 
@@ -205,7 +223,7 @@ class tx_em_Connection_ExtDirectServer {
                $install = t3lib_div::makeInstance('tx_em_Install');
                $form = $install->updatesForm($extKey, $list[$extKey], 1);
                if (!$form) {
-                       return '<p>' . 'This extension has no configuration.' . '</p>';
+                       return '<p>' . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extNoConfiguration') . '</p>';
                } else {
                        return $form;
                }
@@ -219,9 +237,44 @@ class tx_em_Connection_ExtDirectServer {
         * @return array
         */
        public function saveExtensionConfiguration($parameter) {
+
+               $extKey = $parameter['extkey'];
+               $extType = $parameter['exttype'];
+               $absPath = tx_em_Tools::getExtPath($extKey, $extType);
+               $relPath = tx_em_Tools::typeRelPath($extType) . $extKey . '/';
+
+               /** @var $extensionList tx_em_Extensions_List */
+               $extensionList = t3lib_div::makeInstance('tx_em_Extensions_List', $this);
+               list($list,) = $extensionList->getInstalledExtensions();
+
+
+               $arr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extKey]);
+               $arr = is_array($arr) ? $arr : array();
+
+               /** @var $tsStyleConfig t3lib_tsStyleConfig */
+               $tsStyleConfig = t3lib_div::makeInstance('t3lib_tsStyleConfig');
+               $tsStyleConfig->doNotSortCategoriesBeforeMakingForm = TRUE;
+               $theConstants = $tsStyleConfig->ext_initTSstyleConfig(
+                       t3lib_div::getUrl($absPath . 'ext_conf_template.txt'),
+                       $relPath,
+                       $absPath,
+                       $GLOBALS['BACK_PATH']
+               );
+
+               $tsStyleConfig->ext_procesInput($parameter, array(), $theConstants, array());
+               $arr = $tsStyleConfig->ext_mergeIncomingWithExisting($arr);
+
+
+               /** @var $install tx_em_Install */
+               $install = t3lib_div::makeInstance('tx_em_Install');
+               $install->INSTALL = $parameter['TYPO3_INSTALL'];
+               $install->checkDBupdates($extKey, $list[$extKey]);
+               $install->writeTsStyleConfig($extKey, $arr);
+
+
                return array(
                        'success' => true,
-                       'data' => $parameter
+                       'data' => $parameter['data']
                );
        }
 
@@ -246,7 +299,7 @@ class tx_em_Connection_ExtDirectServer {
                $editTypes = explode(',', $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext']);
                $imageTypes = array('gif', 'jpg', 'png');
 
-               if (!is_array($files) || !count($files)) {
+               if (!is_array($dirs) && !is_array($files)) {
                        return array();
                }
 
@@ -354,12 +407,46 @@ class tx_em_Connection_ExtDirectServer {
         * @return array
         */
        public function uploadExtToTer($parameter) {
+               $temp = $this->getRepositories(TRUE);
+               $wsdlURL = $temp['data'][0]['wsdl_url'];
+
+               $parameter['user']['fe_u'] = $parameter['fe_u'];
+               $parameter['user']['fe_p'] = $parameter['fe_p'];
+               $parameter['upload']['mode'] = $parameter['newversion'];
+
+               /** @var $extensionList tx_em_Extensions_List */
+               $extensionList = t3lib_div::makeInstance('tx_em_Extensions_List', $this);
+               list($list,) = $extensionList->getInstalledExtensions();
+               /** @var $extensionDetails tx_em_Extensions_Details */
+               $this->extensionDetails = t3lib_div::makeInstance('tx_em_Extensions_Details', $this);
+
+               /** @var $terConnection  tx_em_Connection_Ter*/
+               $terConnection = t3lib_div::makeInstance('tx_em_Connection_Ter', $this);
+               $terConnection->wsdlURL = $wsdlURL;
+
+               $parameter['extInfo'] = $list[$parameter['extKey']];
+               $response = $terConnection->uploadToTER($parameter);
+
+               if (!is_array($response)) {
+                       return array(
+                               'success' => FALSE,
+                               'error' => $response,
+                               'params' => $parameter,
+                       );
+               }
+               if ($response['resultCode'] == 10504) { //success
+                       $parameter['extInfo']['EM_CONF']['version'] = $response['version'];
+                       $response['resultMessages'][] = sprintf(
+                               $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:terCommunication_ext_version'),
+                               $response['version']
+                       );
+                       $response['resultMessages'][] = $this->extensionDetails->updateLocalEM_CONF($parameter['extKey'], $parameter['extInfo']);
+               }
+
                return array(
                        'success' => TRUE,
-                       'fe_p' => $parameter['fe_p'],
-                       'fe_u' => $parameter['fe_u'],
-                       'newversion' => $parameter['newversion'],
-                       'uploadcomment' => $parameter['uploadcomment']
+                       'params' => $parameter,
+                       'response' => $response
                );
        }
 
@@ -367,15 +454,120 @@ class tx_em_Connection_ExtDirectServer {
         * Prints developer information
         *
         * @param string $parameter
-        * @return array
+        * @return string
         */
        public function getExtensionDevelopInfo($extKey) {
+               /** @var $extensionList  tx_em_Extensions_List*/
                $extensionList = t3lib_div::makeInstance('tx_em_Extensions_List', $this);
                list($list,) = $extensionList->getInstalledExtensions();
+               /** @var $extensionDetails tx_em_Extensions_Details */
                $extensionDetails = t3lib_div::makeInstance('tx_em_Extensions_Details', $this);
+
                return $extensionDetails->extInformationarray($extKey, $list[$extKey]);
        }
 
+
+/**
+        * Prints backupdelete
+        *
+        * @param string $parameter
+        * @return string
+        */
+       public function getExtensionBackupDelete($extKey) {
+               $content='';
+          /** @var $extensionList  tx_em_Extensions_List*/
+               $extensionList = t3lib_div::makeInstance('tx_em_Extensions_List', $this);
+               /** @var $extensionDetails tx_em_Extensions_Details */
+               $extensionDetails = t3lib_div::makeInstance('tx_em_Extensions_Details');
+               /** @var $extensionDetails tx_em_Connection_Ter */
+               $terConnection = t3lib_div::makeInstance('tx_em_Connection_Ter');
+               /** @var $extensionDetails tx_em_Install */
+               $install = t3lib_div::makeInstance('tx_em_Install');
+               /** @var $api tx_em_API */
+               $api = t3lib_div::makeInstance('tx_em_API');
+
+               list($list,) = $extensionList->getInstalledExtensions();
+               $uploadArray = $extensionDetails->makeUploadarray($extKey, $list[$extKey]);
+
+               if (is_array($uploadArray)) {
+                       $backUpData = $terConnection->makeUploadDataFromarray($uploadArray);
+                       $filename = 'T3X_' . $extKey . '-' . str_replace('.', '_', $list[$extKey]['EM_CONF']['version']) . '-z-' . date('YmdHi') . '.t3x';
+
+                       $techInfo = $install->makeDetailedExtensionAnalysis($extKey, $list[$extKey]);
+                       $lines = array();
+
+                       // Backup
+                       $lines[] = '<tr class="t3-row-header"><td colspan="2">' .
+                                       $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:ext_details_backup') . '</td></tr>';
+                       $lines[] = '<tr class="bgColor4"><td><strong>' .
+                                       $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_files') . '</strong></td><td>' .
+                                       '<a class="t3-link" href="' . htmlspecialchars(t3lib_div::linkThisScript(array(
+                               'CMD[doBackup]' => 1,
+                               'CMD[showExt]' => $extKey,
+                               'SET[singleDetails]' => 'backup'
+                       ))) .
+                                       '">' . sprintf($GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_download'),
+                               $extKey
+                       ) . '</a><br />
+                               (' . $filename . ', <br />' .
+                                       t3lib_div::formatSize(strlen($backUpData)) . ', <br />' .
+                                       $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_md5') . ' ' . md5($backUpData) . ')
+                               <br /></td></tr>';
+
+
+                       if (is_array($techInfo['tables'])) {
+                               $lines[] = '<tr class="bgColor4"><td><strong>' . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_data_tables') .
+                                               '</strong></td><td>' .
+                                                       tx_em_Database::dumpDataTablesLine($techInfo['tables'], $extKey, array('SET[singleDetails]' => 'backup')) .
+                                               '</td></tr>';
+                       }
+                       if (is_array($techInfo['static'])) {
+                               $lines[] = '<tr class="bgColor4"><td><strong>' . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_static_tables') .
+                                               '</strong></td><td>' .
+                                                       tx_em_Database::dumpDataTablesLine($techInfo['static'], $extKey, array('SET[singleDetails]' => 'backup')) .
+                                               '</td></tr>';
+                       }
+
+                       // Delete
+                       $lines[] = '<tr class="t3-row-header"><td colspan="2">' .
+                                       $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:ext_details_delete') . '</td></tr>';
+                       $lines[] = '<tr class="bgColor4"><td colspan="2">' . $install->extDelete($extKey, $list[$extKey], '') . '</td></tr>';
+
+                       // EM_CONF
+                       $lines[] = '<tr class="t3-row-header"><td colspan="2">' .
+                                       $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:ext_details_update_em_conf') . '</td></tr>';
+
+
+                       $lines[] = '<tr class="bgColor4"><td colspan="2">' .
+                       $sure = $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extUpdateEMCONF_sure');
+                       $updateEMConf = $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extUpdateEMCONF_file');
+
+                       $onClick = "if (confirm('$sure')) {window.location.href='" . t3lib_div::linkThisScript(array(
+                               'CMD[showExt]' => $extKey,
+                               'CMD[doUpdateEMCONF]' => 1
+                       )) . "';}";
+
+                       $lines[] = '<tr class="bgColor4"><td colspan="2">' .
+                                       '<a class="t3-link emconfLink" href="#" onclick="' . htmlspecialchars($onClick) .
+                                       ' return false;"><strong>' . $updateEMConf . '</strong> ' .
+                                       sprintf($GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extDelete_from_location'),
+                                               $api->typeLabels[$list[$extKey]['type']],
+                                               substr(tx_em_Tools::getExtPath($extKey, $list[$extKey]['type']['type']), strlen(PATH_site))
+                                       ) . '</a>'
+                                       .  '<br /><br />' . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extUpdateEMCONF_info_changes') . '<br />
+                                               ' . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extUpdateEMCONF_info_reset')
+                                       . '</td></tr>';
+
+
+
+                       $content = '<table border="0" cellpadding="2" cellspacing="2">' . implode('', $lines) . '</table>';
+
+
+
+                       return $this->replaceLinks($content);
+               }
+       }
+
        /*********************************************************************/
        /* Remote Extension List                                             */
        /*********************************************************************/
@@ -391,10 +583,17 @@ class tx_em_Connection_ExtDirectServer {
                $repositoryId = $parameters->repository;
                $mirrorUrl = $this->getMirrorUrl($repositoryId);
 
+               $list = $this->getFlatExtensionList();
+               $localList = $list['data'];
+
                $search = $parameters->query;
                $limit = $parameters->start . ', ' . $parameters->limit;
                $orderBy = $parameters->sort;
                $orderDir = $parameters->dir;
+               if ($orderBy === 'statevalue') {
+                       $orderBy = 'state';
+               }
+               $installedOnly = $parameters->installedOnly;
 
                $where = '';
                if ($search == '*') {
@@ -409,13 +608,18 @@ class tx_em_Connection_ExtDirectServer {
                // check for filter
                $where .= $this->makeFilterQuery(get_object_vars($parameters));
 
-               if (is_array($parameters->filter)) {
-
-                       foreach ($parameters->filter as $filter) {
-
+               if ($installedOnly) {
+                       $temp = array();
+                       foreach ($localList as $key => $value) {
+                               if ($value['installed']) {
+                                       $temp[] = '"' . $key . '"';
+                               }
                        }
+                       $where .= ' AND extkey IN(' . implode(',', $temp) . ')';
+                       $limit = '';
                }
 
+
                $list = tx_em_Database::getExtensionListFromRepository(
                        $repositoryId,
                        $where,
@@ -424,16 +628,40 @@ class tx_em_Connection_ExtDirectServer {
                        $limit
                );
 
-                       //TODO: compare with local extensions to decide for import/upload/no action
+               $updateKeys = array();
 
                        // transform array
                foreach ($list['results'] as $key => $value) {
                        $list['results'][$key]['dependencies'] = unserialize($value['dependencies']);
                        $extPath = t3lib_div::strtolower($value['extkey']);
-                       $list['results'][$key]['icon'] = '<img alt="" src="' . $mirrorUrl . $extPath{0} . '/' . $extPath{1} . '/' . $extPath . '_' . $value['version'] . '.gif" />';
                        $list['results'][$key]['statevalue'] = $value['state'];
                        $list['results'][$key]['state'] = tx_em_Tools::getDefaultState(intval($value['state']));
-                       $list['results'][$key]['categoryvalue'] = $value['category'];
+                       $list['results'][$key]['version'] = tx_em_Tools::versionFromInt($value['maxintversion']);
+                       $list['results'][$key]['icon'] = '<img alt="" src="' . $mirrorUrl . $extPath{0} . '/' . $extPath{1} . '/' . $extPath . '_' . $list['results'][$key]['version'] . '.gif" />';
+
+                       $list['results'][$key]['exists'] = 0;
+                       $list['results'][$key]['installed'] = 0;
+                       $list['results'][$key]['versionislower'] = 0;
+                       if (isset($localList[$value['extkey']])) {
+                               $isUpdatable = ($localList[$value['extkey']]['intversion'] < $value['maxintversion']);
+                               $list['results'][$key]['exists'] = 1;
+                               $list['results'][$key]['installed'] = $localList[$value['extkey']]['installed'];
+                               $list['results'][$key]['versionislower'] = $isUpdatable;
+                               if ($isUpdatable) {
+                                       $updateKeys[] = $key;
+                               }
+                       } else {
+                               $updateKeys[] = $key;
+                       }
+               }
+
+               if ($installedOnly == 2 && count($updateKeys)) {
+                       $temp = array();
+                       foreach ($updateKeys as $key) {
+                               $temp[]= $list['results'][$key];
+                       }
+                       $list['results'] = $temp;
+                       $list['count'] -= count($updateKeys);
                }
 
                return array(
@@ -448,22 +676,27 @@ class tx_em_Connection_ExtDirectServer {
        /**
         * Loads repositories
         *
+        * @param  boolean $selectedOnly
         * @return array
         */
-       public function getRepositories() {
+       public function getRepositories($selectedOnly = FALSE) {
                $settings = $this->getSettings();
                $repositories = tx_em_Database::getRepositories();
+               $data = array();
+
                foreach ($repositories as $uid => $repository) {
-                       $data[] = array(
-                               'title' => $repository['title'],
-                               'uid' => $repository['uid'],
-                               'description' => $repository['description'],
-                               'wsdl_url' => $repository['wsdl_url'],
-                               'mirror_url' => $repository['mirror_url'],
-                               'count' => $repository['extCount'],
-                               'updated' => $repository['lastUpdated'] ? date('d/m/Y H:i', $repository['lastUpdated']) : 'never',
-                               'selected' => $repository['uid'] === $settings['selectedRepository'],
-                       );
+                       if (!$selectedOnly || ($selectedOnly && $repository['uid'] == $settings['selectedRepository'])) {
+                               $data[] = array(
+                                       'title' => $repository['title'],
+                                       'uid' => $repository['uid'],
+                                       'description' => $repository['description'],
+                                       'wsdl_url' => $repository['wsdl_url'],
+                                       'mirror_url' => $repository['mirror_url'],
+                                       'count' => $repository['extCount'],
+                                       'updated' => $repository['lastUpdated'] ? date('d/m/Y H:i', $repository['lastUpdated']) : 'never',
+                                       'selected' => $repository['uid'] === $settings['selectedRepository'],
+                               );
+                       }
                }
 
                return array(
@@ -472,6 +705,7 @@ class tx_em_Connection_ExtDirectServer {
                );
        }
 
+
        /**
         * Get Mirrors for selected repository
         *
@@ -482,7 +716,7 @@ class tx_em_Connection_ExtDirectServer {
                $data = array();
                /** @var $objRepository tx_em_Repository */
                $objRepository = t3lib_div::makeInstance('tx_em_Repository', $parameter->repository);
-               //debug(array($objRepository->getMirrorListUrl(),$objRepository->getId(), $settings['selectedRepository']));
+
                if ($objRepository->getMirrorListUrl()) {
                        $objRepositoryUtility = t3lib_div::makeInstance('tx_em_Repository_Utility', $objRepository);
                        $mirrors = $objRepositoryUtility->getMirrors(TRUE)->getMirrors();
@@ -491,7 +725,7 @@ class tx_em_Connection_ExtDirectServer {
                        if (count($mirrors)) {
                                $data = array(
                                        array(
-                                               'title' => 'Random (recommended)',
+                                               'title' => $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:mirror_use_random'),
                                                'country' => '',
                                                'host' => '',
                                                'path' => '',
@@ -529,10 +763,10 @@ class tx_em_Connection_ExtDirectServer {
         * @return array
         */
        public function repositoryEditFormSubmit($parameter) {
-               //debug($parameter);
-               $error = FALSE;
+               $repId = intval($parameter['rep']);
+
                /** @var $repository tx_em_Repository */
-               $repository = t3lib_div::makeInstance('tx_em_Repository', $parameter['rep']);
+               $repository = t3lib_div::makeInstance('tx_em_Repository', $repId);
                $repository->setTitle($parameter['title']);
                $repository->setDescription($parameter['description']);
                $repository->setWsdlUrl($parameter['wsdl_url']);
@@ -546,8 +780,8 @@ class tx_em_Connection_ExtDirectServer {
                        'extCount' => $repository->getExtensionCount(),
                );
 
-               if ($parameter['rep'] == 0) {
-                       // create a new repository
+               if ($repId === 0) {
+                               // create a new repository
                        $id = tx_em_Database::insertRepository($repository);
                        return array(
                                'success' => TRUE,
@@ -575,7 +809,7 @@ class tx_em_Connection_ExtDirectServer {
                if (intval($uid) < 2) {
                        return array(
                                'success' => FALSE,
-                               'error' => 'Main repository can not be deleted!'
+                               'error' => $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:repository_main_nodelete')
                        );
                }
                $repository = t3lib_div::makeInstance('tx_em_Repository', intval($uid));
@@ -601,7 +835,9 @@ class tx_em_Connection_ExtDirectServer {
                        );
                }
 
+               /** @var $objRepository tx_em_Repository */
                $objRepository = t3lib_div::makeInstance('tx_em_Repository', intval($repositoryId));
+               /** @var $objRepositoryUtility tx_em_Repository_Utility */
                $objRepositoryUtility = t3lib_div::makeInstance('tx_em_Repository_Utility', $objRepository);
                $count = $objRepositoryUtility->updateExtList();
 
@@ -620,7 +856,7 @@ class tx_em_Connection_ExtDirectServer {
                } else {
                        return array(
                                'success' => FALSE,
-                               'errormsg' => 'Your repository is up to date.',
+                               'errormsg' => $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:repository_upToDate'),
                                'rep' =>  intval($repositoryId)
                        );
                }
@@ -638,13 +874,13 @@ class tx_em_Connection_ExtDirectServer {
         * @return unknown
         */
        public function getLanguages() {
+               $this->globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']);
+               $selected = t3lib_div::trimExplode(',', $this->globalSettings['selectedLanguages'], TRUE);
 
-               $temp = $this->getSettings();
-               $selected = unserialize($temp['selectedLanguages']);
                $theLanguages = t3lib_div::trimExplode('|', TYPO3_languages);
                //drop default
                array_shift($theLanguages);
-               $lang = array();
+               $lang = $meta = array();
                foreach ($theLanguages as $language) {
                        $label = htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xml:lang_' . $language));
                        $cls =  t3lib_iconWorks::getSpriteIconClasses('flags-' . $language);
@@ -654,10 +890,21 @@ class tx_em_Connection_ExtDirectServer {
                                'cls' => $cls,
                                'selected' => is_array($selected) && in_array($language, $selected) ? 1 : 0
                        );
+                       $meta[] = array(
+                               'hidden' => is_array($selected) && in_array($language, $selected) ? 'false' : 'true',
+                               'header' => $language,
+                               'dataIndex' =>  $language,
+                               'width' => '100',
+                               'fixed' => TRUE,
+                               'sortable' => FALSE,
+                               'hidable' => FALSE,
+                               'menuDisabled' => TRUE,
+                       );
                }
                return array(
                        'length' => count($lang),
                        'data' => $lang,
+                       'meta' => $meta,
                );
 
        }
@@ -669,9 +916,27 @@ class tx_em_Connection_ExtDirectServer {
         * @return string
         */
        public function saveLanguageSelection($parameter) {
-               $this->saveSetting('selectedLanguages', serialize($parameter));
-                       //TODO: use language label
-               return 'Saved languages: ' . implode(', ', $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)
+               );
        }
 
 
@@ -687,33 +952,45 @@ class tx_em_Connection_ExtDirectServer {
                $result = array();
                if (is_array($selection) && count($selection)) {
                        $terConnection = t3lib_div::makeInstance('tx_em_Connection_Ter', $this);
-                       $this->xmlhandler = t3lib_div::makeInstance('tx_em_Tools_XmlHandler');
-                       $this->xmlhandler->emObj = $this;
+                       $this->xmlHandler = t3lib_div::makeInstance('tx_em_Tools_XmlHandler');
+                       $this->xmlHandler->emObj = $this;
                        $mirrorURL = $this->getSettingsObject()->getMirrorURL();
 
+                       $missingIcon = '<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-icon-missing">&nbsp;</span>';
+                       $updateIcon = '<span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-update">&nbsp;</span>';
+                       $newIcon = '<span class="t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-import">&nbsp;</span>';
+                       $okIcon = '<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-checked">&nbsp;</span>';
+                       $errorIcon = '<span class="t3-icon t3-icon-status t3-icon-status-status t3-icon-status-permission-denied">&nbsp;</span>';
+
                        foreach ($selection as $lang) {
                                $fetch = $terConnection->fetchTranslationStatus($extkey, $mirrorURL);
+
                                $localmd5 = '';
                                if (!isset($fetch[$lang])) {
-                                       //no translation available
-                                       $result[0][$lang] = 'N/A';
+                                               //no translation available
+                                       $result[$lang] = $missingIcon . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:translation_n_a');
                                } else {
-                                       $localmd5 = '';
-                                       if (is_file(PATH_site . 'typo3temp/' . $extkey . '-l10n-' . $lang . '.zip')) {
-                                               $localmd5 = md5_file(PATH_site . 'typo3temp/' . $extkey . '-l10n-' . $lang . '.zip');
+                                       $zip = PATH_site . 'typo3temp/' . $extkey . '-l10n-' . $lang . '.zip';
+                                       if (is_file($zip)) {
+                                               $localmd5 = md5_file($zip);
                                        }
                                        if ($localmd5 !== $fetch[$lang]['md5']) {
                                                if ($type) {
-                                                       //fetch translation
+                                                               //fetch translation
                                                        $ret = $terConnection->updateTranslation($extkey, $lang, $mirrorURL);
-                                                       $result[0][$lang] = $ret ? 'updated' : 'failed';
+
+                                                       $result[$lang] = $ret
+                                                                       ? $okIcon . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_updated')
+                                                                       : $errorIcon . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_failed');
                                                } else {
-                                                       //translation status
-                                                       $result[0][$lang] = $localmd5 !== '' ? 'update' : 'new';
+                                                               //translation status
+                                                       $result[$lang] = $localmd5 !== ''
+                                                                       ? $updateIcon . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:translation_status_update')
+                                                                       : $newIcon . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:translation_status_new');
                                                }
                                        } else {
-                                               //translation is up to date
-                                               $result[0][$lang] = 'ok';
+                                                       //translation is up to date
+                                               $result[$lang] = $okIcon . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:translation_status_uptodate');;
                                        }
                                }
 
@@ -935,7 +1212,19 @@ class tx_em_Connection_ExtDirectServer {
                return $where;
        }
 
-
+       /**
+        * Replace links that are created with t3lib_div::linkThisScript to point to module
+        *
+        * @param  string  $string
+        * @return string
+        */
+       protected function replaceLinks($string) {
+                return str_replace(
+                       'ajax.php?ajaxID=ExtDirect%3A%3Aroute&amp;namespace=TYPO3.EM',
+                       'mod.php?M=tools_em',
+                       $string
+                );
+       }
 
 }
 
index 23b5d5f..96b4126 100644 (file)
@@ -78,7 +78,7 @@ class tx_em_Connection_ExtDirectSoap {
         */
        public function testUserLogin() {
                if (is_array($this->accountData)) {
-                       $login = false; #$this->soap->login($this->accountData['accountData']['username'], $this->accountData['accountData']['password']);
+                       $login = false;
                        if ($login) {
                                $data = array(
                                        'success' => TRUE,
@@ -87,13 +87,13 @@ class tx_em_Connection_ExtDirectSoap {
                        } else {
                                $data = array(
                                        'success' => FALSE,
-                                       'error' => 'login failed'
+                                       'error' => $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_loginFailed')
                                );
                        }
                } else {
                        $data = array(
                                'success' => FALSE,
-                               'error' => 'No user login data'
+                               'error' => $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_noUserLoginData')
                        );
                }
 
@@ -159,7 +159,7 @@ class tx_em_Connection_ExtDirectSoap {
                );
                $result = $this->soapCall('registerExtensionKey', $params);
                $message = $this->getSoapResultMessageFromCode($result['resultCode']);
-               //debug(array($result,$parameter), $message);
+
                if ($result['resultCode'] == 10503) {
                        $return =  array(
                                'success' => TRUE,
@@ -390,31 +390,31 @@ class tx_em_Connection_ExtDirectSoap {
        protected function getSoapResultMessageFromCode($code) {
                switch ($code) {
                        case 10000:
-                               return 'OK';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_ok');
                        break;
                        case 102:
-                               return 'User does not exists.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_userNotExists');
                        break;
                        case 10500:
-                               return 'Extensionkey already exists.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extkexExists');
                        break;
                        case 10501:
-                               return 'Extensionkey does not exists.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extkexNotExists');
                        break;
                        case 10502:
-                               return 'Extensionkey is not valid.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extkexNotValid');
                        break;
                        case 10503:
-                               return 'Extensionkey was successful registered.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extkexRegistered');
                        break;
                        case 10504:
-                               return 'Extension was successful upladed.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extkexUploadedSuccess');
                        break;
                        case 10505:
-                               return 'Extension was successful deleted.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_extkexDeletedSuccess');
                        break;
                        default:
-                               return 'Unknow error occured.';
+                               return $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:msg_unknownError');
 
                }
        }
index 434f5e9..c39ee0f 100644 (file)
@@ -135,7 +135,7 @@ class tx_em_Connection_Ter {
                $remote = t3lib_div::getURL($mirrorURL, 0, array(TYPO3_user_agent));
 
                if ($remote !== false) {
-                       $parsed = $this->emObj->xmlhandler->parseL10nXML($remote);
+                       $parsed = $this->emObj->xmlHandler->parseL10nXML($remote);
                        return $parsed['languagePackIndex'];
                }
 
index aee97e2..ec0d095 100644 (file)
@@ -387,6 +387,61 @@ final class tx_em_Database {
        }
 
        /**
+        * Link to dump of database tables
+        *
+        * @param       array  $tablesArray
+        * @param       string $extKey
+        * @param       array  $additionalLinkParameter
+        * @return      string          HTML
+        */
+       function dumpDataTablesLine($tablesArray, $extKey, $additionalLinkParameter = array()) {
+               $tables = array();
+               $tablesNA = array();
+               $allTables = array_keys($GLOBALS['TYPO3_DB']->admin_get_tables());
+
+               foreach ($tablesArray as $tableName) {
+                       if (in_array($tableName, $allTables)) {
+                               $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $tableName);
+                               $tables[$tableName] = '<tr><td>&nbsp;</td><td>
+                                       <a class="t3-link dumpLink" href="' .
+                                               htmlspecialchars(t3lib_div::linkThisScript(
+                                                       array_merge(array(
+                                                               'CMD[dumpTables]' => $tableName,
+                                                               'CMD[showExt]' => $extKey,
+                                                       ), $additionalLinkParameter)
+                                               )) .
+                                               '" title="' .
+                                               sprintf($GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_dump_table'),
+                                                       $tableName) .
+                                               '">' . $tableName . '</a></td><td>&nbsp;&nbsp;&nbsp;</td><td>' .
+                                               sprintf($GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_number_of_records'),
+                                                       $count) . '</td></tr>';
+                       } else {
+                               $tablesNA[$tableName] = '<tr><td>&nbsp;</td><td>' . $tableName . '</td><td>&nbsp;</td><td>' .
+                                               $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_table_not_there') . '</td></tr>';
+                       }
+               }
+               $label = '<table border="0" cellpadding="0" cellspacing="0">' .
+                               implode('', array_merge($tables, $tablesNA)) .
+                               '</table>';
+               if (count($tables)) {
+                       $label = '<a class="t3-link dumpLink" href="' .
+                                       htmlspecialchars(t3lib_div::linkThisScript(
+                                               array_merge(array(
+                                                       'CMD[dumpTables]' => implode(',', array_keys($tables)),
+                                                       'CMD[showExt]' => $extKey
+                                               ), $additionalLinkParameter)
+                                       )) .
+                                       '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_dump_all_tables') . '">' .
+                                       $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_download_all_data') . '</a><br /><br />' . $label;
+               }
+               else {
+                       $label = $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:extBackup_nothing_to_dump') . '<br /><br />' . $label;
+               }
+               return $label;
+       }
+
+       /**
         * Dump content for static tables
         *
         * @param       string          Comma list of tables from which to dump content
index f66b9e3..7127b32 100644 (file)
@@ -39,6 +39,9 @@ class tx_em_Extensions_Details {
        protected $descrTable = '_MOD_tools_em';
        protected $parentObject;
 
+       protected $categories;
+       protected $states;
+
        /**
         * Instance of EM API
         *
@@ -63,6 +66,18 @@ class tx_em_Extensions_Details {
                $this->api = t3lib_div::makeInstance('tx_em_API');
                $this->install = t3lib_div::makeInstance('tx_em_Install', $this);
                $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('em') . 'language/locallang.xml');
+               $this->categories = array(
+                       'be' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_BE'),
+                       'module' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_BE_modules'),
+                       'fe' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_FE'),
+                       'plugin' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_FE_plugins'),
+                       'misc' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_miscellanous'),
+                       'services' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_services'),
+                       'templates' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_templates'),
+                       'example' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_examples'),
+                       'doc' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_documentation')
+               );
+               $this->states = tx_em_Tools::getStates();
        }
 
 
@@ -441,7 +456,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                // row for the category
                $key = 'category';
-               $dataCol = $this->parentObject->categories[$emConf[$key]];
+               $dataCol = $this->categories[$emConf[$key]];
                $lines[] = array(
                        $this->headerCol($key),
                        $dataCol
@@ -449,7 +464,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                // row for the state
                $key = 'state';
-               $dataCol = $this->parentObject->states[$emConf[$key]];
+               $dataCol = $this->states[$emConf[$key]];
                $lines[] = array(
                        $this->headerCol($key),
                        $dataCol
@@ -481,7 +496,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                // row for the dependencies
                $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_depends_on');
-               $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_dependencies', $headerCol);
+               $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_dependencies', $headerCol);
                $dataCol = tx_em_Tools::depToString($emConf['constraints']);
                $lines[] = array(
                        $headerCol,
@@ -490,7 +505,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                // row for the conflicts
                $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_conflicts_with');
-               $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_conflicts', $headerCol);
+               $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_conflicts', $headerCol);
                $dataCol = tx_em_Tools::depToString($emConf['constraints'], 'conflicts');
                $lines[] = array(
                        $headerCol,
@@ -499,7 +514,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                // row for the suggestions
                $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_suggests');
-               $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_conflicts', $headerCol);
+               $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_conflicts', $headerCol);
                $dataCol = tx_em_Tools::depToString($emConf['constraints'], 'suggests');
                $lines[] = array(
                        $this->headerCol('suggests'),
@@ -516,7 +531,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_clear_cache');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_clearCacheOnLoad', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_clearCacheOnLoad', $headerCol);
                        if ($emConf['clearCacheOnLoad']) {
                                $dataCol = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes');
                        } else {
@@ -529,7 +544,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                        $key = 'module';
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_incl_modules');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_module', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_module', $headerCol);
                        $lines[] = array(
                                $headerCol,
                                $emConf[$key]
@@ -537,7 +552,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                        $key = 'lockType';
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_lock_type');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_lockType', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_lockType', $headerCol);
                        $lines[] = array(
                                $headerCol,
                                ($emConf[$key] ? $emConf[$key] : '')
@@ -545,7 +560,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                        $key = 'doNotLoadInFE';
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_load_in_frontend');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_doNotLoadInFE', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_doNotLoadInFE', $headerCol);
                        if (!$emConf['doNotLoadInFE']) {
                                $dataCol = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes');
                        } else {
@@ -558,7 +573,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
                        $key = 'modify_tables';
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_modifies_tables');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_modify_tables', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_modify_tables', $headerCol);
                        $lines[] = array(
                                $headerCol,
                                $emConf[$key]
@@ -572,13 +587,13 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
 
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_inst_type');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_type', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_type', $headerCol);
                        $dataCol = $this->api->typeLabels[$extInfo['type']] . ' - <em>' . $this->api->typeDescr[$extInfo['type']] . '</em>';
                        $lines[] = array($headerCol, $dataCol);
 
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_inst_twice');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_doubleInstall', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_doubleInstall', $headerCol);
                        $dataCol = $this->extInformationArray_dbInst($extInfo['doubleInstall'], $extInfo['type']);
                        $lines[] = array($headerCol, $dataCol);
 
@@ -586,7 +601,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
                        if (is_array($extInfo['files'])) {
                                sort($extInfo['files']);
                                $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_root_files');
-                               $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_rootfiles', $headerCol);
+                               $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_rootfiles', $headerCol);
                                $dataCol = implode('<br />', $extInfo['files']);
                                $lines[] = array($headerCol, $dataCol);
                        }
@@ -606,73 +621,55 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
                        }
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_db_requirements');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_dbReq', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_dbReq', $headerCol);
                        $dataCol = $this->extInformationArray_dbReq($techInfo, 1);
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_db_status');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_dbStatus', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_dbStatus', $headerCol);
                        $lines[] = array($headerCol, $tableStatus);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_flags');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_flags', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_flags', $headerCol);
                        $dataCol = (is_array($techInfo['flags']) ? implode('<br />', $techInfo['flags']) : '');
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_config_template');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_conf', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_conf', $headerCol);
                        $dataCol = ($techInfo['conf'] ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : '');
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_typoscript_files');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_TSfiles', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_TSfiles', $headerCol);
                        $dataCol = (is_array($techInfo['TSfiles']) ? implode('<br />', $techInfo['TSfiles']) : '');
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_language_files');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_locallang', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_locallang', $headerCol);
                        $dataCol = (is_array($techInfo['locallang']) ? implode('<br />', $techInfo['locallang']) : '');
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_upload_folder');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_uploadfolder', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_uploadfolder', $headerCol);
                        $dataCol = ($techInfo['uploadfolder'] ? $techInfo['uploadfolder'] : '');
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_create_directories');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_createDirs', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_createDirs', $headerCol);
                        $dataCol = (is_array($techInfo['createDirs']) ? implode('<br />', $techInfo['createDirs']) : '');
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_module_names');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_moduleNames', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_moduleNames', $headerCol);
                        $dataCol = (is_array($techInfo['moduleNames']) ? implode('<br />', $techInfo['moduleNames']) : '');
                        $lines[] = array($headerCol, $dataCol);
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_class_names');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_classNames', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_classNames', $headerCol);
                        $dataCol = (is_array($techInfo['classes']) ? implode('<br />', $techInfo['classes']) : '');
                        $lines[] = array($headerCol, $dataCol);
 
-                       $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_code_warnings') . '<br />' . $GLOBALS['LANG']->getLL('extInfoArray_dev_relevant');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_errors', $headerCol);
-                       $dataCol = (is_array($techInfo['errors']) ? tx_em_Tools::rfw(implode('<br />', $techInfo['errors'])) : '');
-                       $lines[] = array($headerCol, $dataCol);
-
-                       $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_annoyances') . '<br />' . $GLOBALS['LANG']->getLL('extInfoArray_dev_relevant');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_NSerrors', $headerCol);
-                       if (is_array($techInfo['NSerrors'])) {
-                               if (!t3lib_div::inList($this->parentObject->nameSpaceExceptions, $extKey)) {
-                                       $dataCol = t3lib_utility_Debug::viewarray($techInfo['NSerrors']);
-                               } else {
-                                       $dataCol = tx_em_Tools::dfw($GLOBALS['LANG']->getLL('extInfoArray_exception'));
-                               }
-
-                       }
-                       $lines[] = array($headerCol, $dataCol);
-
                        $currentMd5Array = $this->serverExtensionMD5array($extKey, $extInfo);
-                       $affectedFiles = '';
 
                        $msgLines = array();
                        if (strcmp($extInfo['EM_CONF']['_md5_values_when_last_written'], serialize($currentMd5Array))) {
@@ -685,7 +682,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
                        }
 
                        $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_files_changed');
-                       $headerCol = t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_filesChanged', $headerCol);
+                       $headerCol = t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_filesChanged', $headerCol);
                        $dataCol = implode('<br />', $msgLines);
                        $lines[] = array($headerCol, $dataCol);
                }
@@ -772,7 +769,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
                                return '<td>&nbsp;</td>';
                        }
                        else {
-                               return t3lib_BEfunc::cshItem($this->parentObject->descrTable, 'emconf_' . $key, $GLOBALS['BACK_PATH'], '<td>|</td>');
+                               return t3lib_BEfunc::cshItem($this->descrTable, 'emconf_' . $key, $GLOBALS['BACK_PATH'], '<td>|</td>');
                        }
                }
                else {
@@ -788,7 +785,7 @@ $EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($EM_CONF, 0) . ';
         */
        function headerCol($key) {
                $headerCol = $GLOBALS['LANG']->getLL('extInfoArray_' . $key);
-               return t3lib_BEfunc::wrapInHelp($this->parentObject->descrTable, 'emconf_' . $key, $headerCol);
+               return t3lib_BEfunc::wrapInHelp($this->descrTable, 'emconf_' . $key, $headerCol);
        }
 }
 
index 725a3ee..57f61f7 100644 (file)
@@ -36,6 +36,9 @@ class tx_em_Extensions_List {
 
        protected $parentObject;
 
+       /** @var tx_em_Tools_XmlHandler */
+       protected $xmlHandler;
+
        protected $categories;
        protected $types;
        protected $states;
@@ -49,6 +52,7 @@ class tx_em_Extensions_List {
        public function __construct($parentObject = NULL) {
                $this->parentObject = $parentObject;
                $this->install = t3lib_div::makeInstance('tx_em_Install', $this);
+               $this->xmlHandler = t3lib_div::makeInstance('tx_em_Tools_XmlHandler');
 
                $this->categories = array(
                        'be' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:category_BE'),
@@ -73,36 +77,37 @@ class tx_em_Extensions_List {
        /**
         * Returns the list of available (installed) extensions
         *
+        * @param       boolean         if set, function will return a flat list only
         * @return      array           Array with two arrays, list array (all extensions with info) and category index
         * @see getInstExtList()
         */
-       function getInstalledExtensions($new = FALSE) {
+       function getInstalledExtensions($flatList = FALSE) {
                $list = array();
 
-               if (!$new) {
-                       $cat = tx_em_Tools::getDefaultCategory();
-
+               if ($flatList) {
                        $path = PATH_typo3 . 'sysext/';
-                       $this->getInstExtList($path, $list, $cat, 'S');
+                       $this->getFlatInstExtList($path, $list, 'S');
 
                        $path = PATH_typo3 . 'ext/';
-                       $this->getInstExtList($path, $list, $cat, 'G');
+                       $this->getFlatInstExtList($path, $list, 'G');
 
                        $path = PATH_typo3conf . 'ext/';
-                       $this->getInstExtList($path, $list, $cat, 'L');
+                       $this->getFlatInstExtList($path, $list, 'L');
 
-                       return array($list, $cat);
+                       return $list;
                } else {
+                       $cat = tx_em_Tools::getDefaultCategory();
+
                        $path = PATH_typo3 . 'sysext/';
-                       $this->getFlatInstExtList($path, $list, 'S');
+                       $this->getInstExtList($path, $list, $cat, 'S');
 
                        $path = PATH_typo3 . 'ext/';
-                       $this->getFlatInstExtList($path, $list, 'G');
+                       $this->getInstExtList($path, $list, $cat, 'G');
 
                        $path = PATH_typo3conf . 'ext/';
-                       $this->getFlatInstExtList($path, $list, 'L');
+                       $this->getInstExtList($path, $list, $cat, 'L');
 
-                       return $list;
+                       return array($list, $cat);
                }
        }
 
@@ -189,14 +194,20 @@ class tx_em_Extensions_List {
                                $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'],
+                                       );
 
-                               if (is_array($list[$key])) {
-                                       $list[$key] = array('doubleInstall' => $list[$key]['doubleInstall']);
                                }
                                $list[$key]['extkey'] = $extKey;
                                $list[$key]['path'] = $path . $extKey;
                                $list[$key]['nodePath'] = substr($path . $extKey, strlen(PATH_site));
-                               $list[$key]['doubleInstall'] .= $this->types[$type];
+                               $list[$key]['doubleInstall'] = $list[$key]['doubleInstall'] ? $list[$key]['doubleInstall'] . '/' . $this->types[$type] : $this->types[$type];
+                               $list[$key]['doubleInstallShort'] .= $type;
 
                                $list[$key]['type'] = $this->types[$type];
                                $list[$key]['typeShort'] = $type;
@@ -207,7 +218,7 @@ class tx_em_Extensions_List {
                                $list[$key]['title'] = htmlspecialchars($list[$key]['title']);
                                $list[$key]['description'] = htmlspecialchars($list[$key]['description']);
                                $list[$key]['files'] = t3lib_div::getFilesInDir($path . $extKey, '', 0, '', $this->excludeForPackaging);
-                               //$list[$key]['install'] = $loaded ? tx_em_Tools::removeButton() : tx_em_Tools::installButton();
+                               $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
@@ -219,11 +230,11 @@ class tx_em_Extensions_List {
                                        $list[$key]['doc'] = '<a href="' . htmlspecialchars($relPath . $extKey . '/doc/manual.sxw') . '" 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="" width="16" height="16" />' : '<img src="clear.gif" alt="" width="16" height="16" />';
+                               $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($GLOBALS['EXT']['requiredExt'], $extKey);
                                unset($list[$key]['_md5_values_when_last_written']);
                        }
                }
@@ -283,7 +294,7 @@ class tx_em_Extensions_List {
                $content .= '</form>
 
                        <!-- Loaded Extensions List -->
-                       <table border="0" cellpadding="2" cellspacing="1">' . implode('', $lines) . '</table>';
+                       <table cellspacing="1" class="t3-em-extension-list t3-em-extension-list-loaded">' . implode('', $lines) . '</table>';
 
                return $content;
        }
@@ -364,7 +375,7 @@ EXTENSION KEYS:
                        $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 border="0" cellpadding="2" cellspacing="1">' . implode('', $lines) . '</table>';
+                       $content .= '<table cellspacing="1" class="t3-em-extension-list t3-em-extension-list-installed">' . implode('', $lines) . '</table>';
 
                        return $content;
                }
@@ -592,7 +603,7 @@ EXTENSION KEYS:
 
                // show a different background through a different class for insecure (-1) extensions,
                // for unreviewed (0) and reviewed extensions (1), just use the regular class
-               if ($this->parentObject->xmlhandler->getReviewState($extKey, $extInfo['EM_CONF']['version']) < 0) {
+               if ($this->xmlHandler->getReviewState($extKey, $extInfo['EM_CONF']['version']) < 0) {
                        $bgclass = ' class="unsupported-ext"';
                } else {
                        $bgclass = ' class="' . ($bgColorClass ? $bgColorClass : 'em-listbg1') . '"';
@@ -617,7 +628,7 @@ EXTENSION KEYS:
                global $LANG;
                $extList = $this->getInstalledExtensions();
 
-               $content = '<table border="0" cellpadding="2" cellspacing="1">' .
+               $content = '<table cellspacing="1" class="t3-em-extension-list t3-em-extension-list-to-update">>' .
                                '<tr class="t3-row-header">' .
                                '<td></td>' .
                                '<td>' . $LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:tab_mod_name') . '</td>' .
@@ -629,12 +640,12 @@ EXTENSION KEYS:
                                '</tr>';
 
                foreach ($extList[0] as $name => $data) {
-                       $this->parentObject->xmlhandler->searchExtensionsXMLExact($name, '', '', TRUE, TRUE);
-                       if (!is_array($this->parentObject->xmlhandler->extensionsXML[$name])) {
+                       $this->xmlHandler->searchExtensionsXMLExact($name, '', '', TRUE, TRUE);
+                       if (!is_array($this->xmlHandler->extensionsXML[$name])) {
                                continue;
                        }
 
-                       $v = $this->parentObject->xmlhandler->extensionsXML[$name]['versions'];
+                       $v = $this->xmlHandler->extensionsXML[$name]['versions'];
                        $versions = array_keys($v);
                        natsort($versions);
                        $lastversion = end($versions);
@@ -710,7 +721,7 @@ EXTENSION KEYS:
                $cat = tx_em_Tools::getDefaultCategory();
                $filepath = $this->parentObject->getMirrorURL();
 
-               foreach ($this->parentObject->xmlhandler->extensionsXML as $extKey => $data) {
+               foreach ($this->parentObject->xmlHandler->extensionsXML as $extKey => $data) {
                        $GLOBALS['LANG']->csConvObj->convarray($data, 'utf-8', $GLOBALS['LANG']->charSet); // is there a better place for conversion?
                        $list[$extKey]['type'] = '_';
                        $version = array_keys($data['versions']);
@@ -737,7 +748,7 @@ EXTENSION KEYS:
                        }
                        tx_em_Tools::setCat($cat, $list[$extKey]['versions'][$version], $extKey);
                        if ($unsetProc) {
-                               unset($this->parentObject->xmlhandler->extensionsXML[$extKey]);
+                               unset($this->parentObject->xmlHandler->extensionsXML[$extKey]);
                        }
                }
 
@@ -838,7 +849,21 @@ EXTENSION KEYS:
                return $listArr;
        }
 
-
+       /**
+        * Returns array index of extKey entry
+        *
+        * @param  string  $extKey
+        * @param  array  $list
+        * @return intval|bool index of array or FALSE if not found
+        */
+       protected function findIndex($extKey, $list) {
+               foreach ($list as $key => $value) {
+                       if ($value['extkey'] === $extKey) {
+                               return $key;
+                       }
+               }
+               return FALSE;
+       }
 }
 
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/sysext/em/classes/extensions/class.tx_em_extensions_list.php'])) {
index d17f60a..f82d1ab 100644 (file)
@@ -138,7 +138,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
         *
         * @var tx_em_Tools_XmlHandler
         */
-       public $xmlhandler;
+       public $xmlHandler;
 
 
        /**
@@ -257,6 +257,11 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                $this->settings = t3lib_div::makeInstance('tx_em_Settings');
                $this->install = t3lib_div::makeInstance('tx_em_Install', $this);
 
+               if (t3lib_div::_GP('silentMode')) {
+                       $this->CMD['silentMode'] = 1;
+                       $this->install->setSilentMode(TRUE);
+               }
+
                // Configure menu
                $this->menuConfig();
 
@@ -275,9 +280,9 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                $this->terConnection->wsdlURL = $TYPO3_CONF_VARS['EXT']['em_wsdlURL'];
 
 
-               $this->xmlhandler = t3lib_div::makeInstance('tx_em_Tools_XmlHandler');
-               $this->xmlhandler->emObj = $this;
-               $this->xmlhandler->useObsolete = $this->MOD_SETTINGS['display_obsolete'];
+               $this->xmlHandler = t3lib_div::makeInstance('tx_em_Tools_XmlHandler');
+               $this->xmlHandler->emObj = $this;
+               $this->xmlHandler->useObsolete = $this->MOD_SETTINGS['display_obsolete'];
 
 
                // Initialize newListing
@@ -368,11 +373,22 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
        function menuConfig() {
                        // MENU-ITEMS:
                $this->MOD_MENU = $this->settings->MOD_MENU;
+               $globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']);
 
                if (!intval($GLOBALS['TYPO3_CONF_VARS']['BE']['debug'])) {
                        unset ($this->MOD_MENU['function']['develop']);
                }
 
+               if ($globalSettings['showOldModules'] == 0) {
+                       unset(
+                               $this->MOD_MENU['function']['loaded_list'],
+                               $this->MOD_MENU['function']['installed_list'],
+                               $this->MOD_MENU['function']['import'],
+                               $this->MOD_MENU['function']['translations'],
+                               $this->MOD_MENU['function']['settings'],
+                               $this->MOD_MENU['function']['updates']
+                       );
+               }
                $this->MOD_MENU['singleDetails'] = $this->mergeExternalItems($this->MCONF['name'], 'singleDetails', $this->MOD_MENU['singleDetails']);
 
 
@@ -612,7 +628,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                        $this->detailCols[1] += 6;
 
                        // see if we have an extensionlist at all
-                       $this->extensionCount = $this->xmlhandler->countExtensions();
+                       $this->extensionCount = $this->xmlHandler->countExtensions();
                        if (!$this->extensionCount) {
                                $content .= $this->fetchMetaData('extensions');
                        }
@@ -625,11 +641,11 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                        $offset = $this->listingLimit * $this->pointer;
 
                        if ($this->MOD_SETTINGS['display_own'] && strlen($this->fe_user['username'])) {
-                               $this->xmlhandler->searchExtensionsXML($this->listRemote_search, $this->fe_user['username'], $this->MOD_SETTINGS['listOrder'], TRUE);
+                               $this->xmlHandler->searchExtensionsXML($this->listRemote_search, $this->fe_user['username'], $this->MOD_SETTINGS['listOrder'], TRUE);
                        } else {
-                               $this->xmlhandler->searchExtensionsXML($this->listRemote_search, '', $this->MOD_SETTINGS['listOrder'], TRUE, FALSE, $offset, $this->listingLimit);
+                               $this->xmlHandler->searchExtensionsXML($this->listRemote_search, '', $this->MOD_SETTINGS['listOrder'], TRUE, FALSE, $offset, $this->listingLimit);
                        }
-                       if (count($this->xmlhandler->extensionsXML)) {
+                       if (count($this->xmlHandler->extensionsXML)) {
                                list($list, $cat) = $this->extensionList->prepareImportExtList(TRUE);
 
                                // Available extensions
@@ -726,8 +742,8 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                        $lines = array();
                                        if (count($this->inst_keys)) {
                                                foreach ($this->inst_keys as $extKey => $value) {
-                                                       $this->xmlhandler->searchExtensionsXMLExact($extKey, '', '', TRUE, TRUE);
-                                                       if ((strlen($this->listRemote_search) && !stristr($extKey, $this->listRemote_search)) || isset($this->xmlhandler->extensionsXML[$extKey])) {
+                                                       $this->xmlHandler->searchExtensionsXMLExact($extKey, '', '', TRUE, TRUE);
+                                                       if ((strlen($this->listRemote_search) && !stristr($extKey, $this->listRemote_search)) || isset($this->xmlHandler->extensionsXML[$extKey])) {
                                                                continue;
                                                        }
 
@@ -865,7 +881,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                if ($content) {
                        $content .= '&nbsp;&nbsp;&nbsp;';
                }
-               if (intval($this->xmlhandler->matchingCount / $this->listingLimit) > $this->pointer) {
+               if (intval($this->xmlHandler->matchingCount / $this->listingLimit) > $this->pointer) {
                        $content .= '<a href="' . t3lib_div::linkThisScript(array('pointer' => $this->pointer + 1)) .
                                        '" class="typo3-nextPage"><img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],
                                'gfx/pilright_n.gif', 'width="14" height="14"') .
@@ -873,8 +889,8 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                        $GLOBALS['LANG']->getLL('next_page') . '</a>';
                }
                $upper = (($this->pointer + 1) * $this->listingLimit);
-               if ($upper > $this->xmlhandler->matchingCount) {
-                       $upper = $this->xmlhandler->matchingCount;
+               if ($upper > $this->xmlHandler->matchingCount) {
+                       $upper = $this->xmlHandler->matchingCount;
                }
                if ($content) {
                        $content .= '<br /><br />' .
@@ -1007,9 +1023,13 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
        function importExtInfo($extKey, $version = '') {
 
                $content = '<form action="' . $this->script . '" method="post" name="pageform">';
-
+               $addUrl = '';
+               if ($this->noDocHeader) {
+                  $content .= '<input type="hidden" name="nodoc" value="1" />';
+                  $addUrl = '&nodoc=1';
+          }
                // Fetch remote data:
-               $this->xmlhandler->searchExtensionsXMLExact($extKey, '', '', true, true);
+               $this->xmlHandler->searchExtensionsXMLExact($extKey, '', '', true, true);
                list($fetchData,) = $this->extensionList->prepareImportExtList(true);
 
                $versions = array_keys($fetchData[$extKey]['versions']);
@@ -1022,7 +1042,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                }
 
                // "Select version" box:
-               $onClick = 'window.location.href="' . $this->script . '&CMD[importExtInfo]=' . $extKey . '&CMD[extVersion]="+document.pageform.extVersion.options[document.pageform.extVersion.selectedIndex].value; return false;';
+               $onClick = 'window.location.href="' . $this->script . $addUrl . '&CMD[importExtInfo]=' . $extKey . '&CMD[extVersion]="+document.pageform.extVersion.options[document.pageform.extVersion.selectedIndex].value; return false;';
                $select = '<select name="extVersion">' . implode('', $opt) .
                                '</select> <input type="submit" value="' . $GLOBALS['LANG']->getLL('ext_load_details_button') .
                                '" onclick="' . htmlspecialchars($onClick) . '" />';
@@ -1032,7 +1052,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                        list($inst_list,) = $this->extensionList->getInstalledExtensions();
                        if ($inst_list[$extKey]['EM_CONF']['state'] != 'excludeFromUpdates') {
                                $onClick = '
-                                               window.location.href="' . $this->script . '&CMD[importExt]=' . $extKey . '"
+                                               window.location.href="' . $this->script . $addUrl . '&CMD[importExt]=' . $extKey . '"
                                                        +"&CMD[extVersion]="+document.pageform.extVersion.options[document.pageform.extVersion.selectedIndex].value
                                                        +"&CMD[loc]="+document.pageform.loc.options[document.pageform.loc.selectedIndex].value;
                                                        return false;';
@@ -1107,7 +1127,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                        $mirrors = implode('', gzfile($mfile));
                                        t3lib_div::unlink_tempfile($mfile);
 
-                                       $mirrors = $this->xmlhandler->parseMirrorsXML($mirrors);
+                                       $mirrors = $this->xmlHandler->parseMirrorsXML($mirrors);
                                        if (is_array($mirrors) && count($mirrors)) {
                                                t3lib_BEfunc::getModuleData($this->MOD_MENU, array('extMirrors' => serialize($mirrors)), $this->MCONF['name'], '', 'extMirrors');
                                                $this->MOD_SETTINGS['extMirrors'] = serialize($mirrors);
@@ -1158,7 +1178,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                                                $GLOBALS['LANG']->getLL('translation_problems') . '</p>';
                                        } else {
                                                t3lib_div::writeFile(PATH_site . 'typo3temp/extensions.xml.gz', $extXML);
-                                               $content .= $this->xmlhandler->parseExtensionsXML(PATH_site . 'typo3temp/extensions.xml.gz');
+                                               $content .= $this->xmlHandler->parseExtensionsXML(PATH_site . 'typo3temp/extensions.xml.gz');
                                        }
                                }
                                break;
@@ -1275,18 +1295,18 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                // at this point we know we need to import (a matching version of) the extension from TER2
 
                // see if we have an extension list at all
-               if (!$this->xmlhandler->countExtensions()) {
+               if (!$this->xmlHandler->countExtensions()) {
                        $this->fetchMetaData('extensions');
                }
-               $this->xmlhandler->searchExtensionsXMLExact($extKey, '', '', true);
+               $this->xmlHandler->searchExtensionsXMLExact($extKey, '', '', true);
 
                // check if extension can be fetched
-               if (isset($this->xmlhandler->extensionsXML[$extKey])) {
-                       $versions = array_keys($this->xmlhandler->extensionsXML[$extKey]['versions']);
+               if (isset($this->xmlHandler->extensionsXML[$extKey])) {
+                       $versions = array_keys($this->xmlHandler->extensionsXML[$extKey]['versions']);
                        $latestVersion = end($versions);
                        switch ($mode) {
                                case EM_INSTALL_VERSION_STRICT:
-                                       if (!isset($this->xmlhandler->extensionsXML[$extKey]['versions'][$version])) {
+                                       if (!isset($this->xmlHandler->extensionsXML[$extKey]['versions'][$version])) {
                                                return array(false, $GLOBALS['LANG']->getLL('ext_import_ext_n_a'));
                                        }
                                        break;
@@ -1394,14 +1414,14 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                return $GLOBALS['LANG']->getLL('ext_import_no_file');
                        }
                } else {
-                       $this->xmlhandler->searchExtensionsXMLExact($extKey, '', '', true, true);
+                       $this->xmlHandler->searchExtensionsXMLExact($extKey, '', '', true, true);
 
                        // Fetch extension from TER:
                        if (!strlen($version)) {
-                               $versions = array_keys($this->xmlhandler->extensionsXML[$extKey]['versions']);
+                               $versions = array_keys($this->xmlHandler->extensionsXML[$extKey]['versions']);
                                $version = end($versions);
                        }
-                       $fetchData = $this->terConnection->fetchExtension($extKey, $version, $this->xmlhandler->extensionsXML[$extKey]['versions'][$version]['t3xfilemd5'], $this->getMirrorURL());
+                       $fetchData = $this->terConnection->fetchExtension($extKey, $version, $this->xmlHandler->extensionsXML[$extKey]['versions'][$version]['t3xfilemd5'], $this->getMirrorURL());
                }
 
                // At this point the extension data should be present; so we want to write it to disc:
@@ -1483,8 +1503,12 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                                        } else {
                                                                $script = '';
                                                        }
+                                                       $standaloneUpdates = '';
                                                        if ($this->CMD['standAlone']) {
-                                                               $standaloneUpdates = '<input type="hidden" name="standAlone" value="1" />';
+                                                               $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'])) {
@@ -1526,6 +1550,8 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                                                <input type="hidden" name="_do_install" value="1" />
                                                                <input type="hidden" name="_clrCmd" value="' . $this->CMD['clrCmd'] . '" />
                                                                <input type="hidden" name="standAlone" value="' . $this->CMD['standAlone'] . '" />
+                                                               <input type="hidden" name="silentMode" value="' . $this->CMD['silentMode'] . '" />
+
                                                                </form>';
                                                                $labelDBUpdate = $GLOBALS['LANG']->csConvObj->conv_case(
                                                                        $GLOBALS['LANG']->charSet,
@@ -1546,16 +1572,17 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                                        $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));
 
-                                                       $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 (!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));
@@ -1572,8 +1599,7 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                                                                                        $GLOBALS['LANG']->getLL('ext_details_removed')
                                                                        )
                                                                ) .
-                                                                               '<br /><br /><a href="javascript:opener.top.list.iframe.document.forms[0].submit();window.close();">' .
-                                                                               $GLOBALS['LANG']->getLL('ext_import_close_check') . '</a>';
+                                                                               '<br /><br />' . $this->getSubmitAndOpenerCloseLink();
                                                        } else {
                                                                // Determine if new modules were installed:
                                                                $techInfo = $this->install->makeDetailedExtensionAnalysis($extKey, $list[$extKey]);
@@ -2203,11 +2229,11 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
 
                                if (is_array($techInfo['tables'])) {
                                        $lines[] = '<tr class="bgColor4"><td><strong>' . $GLOBALS['LANG']->getLL('extBackup_data_tables') .
-                                                       '</strong></td><td>' . $this->extBackup_dumpDataTablesLine($techInfo['tables'], $extKey) . '</td></tr>';
+                                                       '</strong></td><td>' . tx_em_Database::dumpDataTablesLine($techInfo['tables'], $extKey) . '</td></tr>';
                                }
                                if (is_array($techInfo['static'])) {
                                        $lines[] = '<tr class="bgColor4"><td><strong>' . $GLOBALS['LANG']->getLL('extBackup_static_tables') .
-                                                       '</strong></td><td>' . $this->extBackup_dumpDataTablesLine($techInfo['static'], $extKey) . '</td></tr>';
+                                                       '</strong></td><td>' . tx_em_Database::dumpDataTablesLine($techInfo['static'], $extKey) . '</td></tr>';
                                }
 
                                $content = '<table border="0" cellpadding="2" cellspacing="2">' . implode('', $lines) . '</table>';
@@ -2221,51 +2247,6 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                }
        }
 
-       /**
-        * Link to dump of database tables
-        *
-        * @param       string          Extension key
-        * @param       array           Extension information array
-        * @return      string          HTML
-        */
-       function extBackup_dumpDataTablesLine($tablesArray, $extKey) {
-               $tables = array();
-               $tablesNA = array();
-               $allTables = array_keys($GLOBALS['TYPO3_DB']->admin_get_tables());
-
-               foreach ($tablesArray as $tN) {
-                       if (in_array($tN, $allTables)) {
-                               $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $tN);
-                               $tables[$tN] = '<tr><td>&nbsp;</td><td>
-                                       <a class="t3-link" href="' . htmlspecialchars(t3lib_div::linkThisScript(array(
-                                       'CMD[dumpTables]' => rawurlencode($tN),
-                                       'CMD[showExt]' => $extKey
-                               ))) .
-                                               '" title="' .
-                                               sprintf($GLOBALS['LANG']->getLL('extBackup_dump_table'),
-                                                       $tN) .
-                                               '">' . $tN . '</a></td><td>&nbsp;&nbsp;&nbsp;</td><td>' .
-                                               sprintf($GLOBALS['LANG']->getLL('extBackup_number_of_records'),
-                                                       $count) . '</td></tr>';
-                       } else {
-                               $tablesNA[$tN] = '<tr><td>&nbsp;</td><td>' . $tN . '</td><td>&nbsp;</td><td>' .
-                                               $GLOBALS['LANG']->getLL('extBackup_table_not_there') . '</td></tr>';
-                       }
-               }
-               $label = '<table border="0" cellpadding="0" cellspacing="0">' . implode('', array_merge($tables, $tablesNA)) . '</table>'; // Candidate for t3lib_div::array_merge() if integer-keys will some day make trouble...
-               if (count($tables)) {
-                       $label = '<a class="t3-link" href="' . htmlspecialchars(t3lib_div::linkThisScript(array(
-                               'CMD[dumpTables]' => rawurlencode(implode(',', array_keys($tables))),
-                               'CMD[showExt]' => $extKey
-                       ))) .
-                                       '" title="' . $GLOBALS['LANG']->getLL('extBackup_dump_all_tables') . '">' .
-                                       $GLOBALS['LANG']->getLL('extBackup_download_all_data') . '</a><br /><br />' . $label;
-               }
-               else {
-                       $label = $GLOBALS['LANG']->getLL('extBackup_nothing_to_dump') . '<br /><br />' . $label;
-               }
-               return $label;
-       }
 
 
        /**
@@ -2523,6 +2504,20 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
        public function getInstalledExtensions() {
                return $this->extensionList->getInstalledExtensions();
        }
+
+
+       /**
+        * @return string
+        */
+       protected function getSubmitAndOpenerCloseLink() {
+               if (!$this->CMD['standAlone'] && ($this->CMD['standAlone'] || t3lib_div::_GP('standAlone'))) {
+                       $link = '<a href="javascript:opener.top.list.iframe.document.forms[0].submit();window.close();">' .
+                               $GLOBALS['LANG']->getLL('ext_import_close_check') . '</a>';
+                       return $link;
+               } else {
+                       return '<a id="closewindow" href="javascript:parent.TYPO3.EM.Tools.closeImportWindow();">' . $GLOBALS['LANG']->getLL('ext_import_close') . '</a>';
+               }
+       }
 }
 
 // Make instance:
index 6c99f7c..1d2ef79 100644 (file)
@@ -59,6 +59,11 @@ class tx_em_Install {
        protected $systemInstall = 0; // If "1" then installs in the sysext directory is allowed. Default: 0
 
        /**
+        * @var boolean
+        */
+       protected $silentMode;
+
+       /**
         * Constructor
         *
         * @param SC_mod_tools_em_index $parentObject
@@ -72,6 +77,9 @@ class tx_em_Install {
                $this->systemInstall = isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['allowSystemInstall']) && $GLOBALS['TYPO3_CONF_VARS']['EXT']['allowSystemInstall'];
        }
 
+       public function setSilentMode(boolean $silentMode) {
+               $this->silentMode = $silentMode;
+       }
        /**
         * Imports the data of an extension  from upload
         *
@@ -130,7 +138,7 @@ class tx_em_Install {
         * @return mixed|string
         */
        public function installExtension($fetchData, $loc, $version, $uploadedTempFile, $dontDelete) {
-               $xmlhandler =& $this->parentObject->xmlhandler;
+               $xmlHandler =& $this->parentObject->xmlHandler;
                $extensionList =& $this->parentObject->extensionList;
                $extensionDetails =& $this->parentObject->extensionDetails;
                $content = '';
@@ -140,7 +148,7 @@ class tx_em_Install {
                                if ($fetchData[0]['extKey'] && is_array($fetchData[0]['FILES'])) {
                                        $extKey = $fetchData[0]['extKey'];
                                        if (!isset($fetchData[0]['EM_CONF']['constraints'])) {
-                                               $fetchData[0]['EM_CONF']['constraints'] = $xmlhandler->extensionsXML[$extKey]['versions'][$version]['dependencies'];
+                                               $fetchData[0]['EM_CONF']['constraints'] = $xmlHandler->extensionsXML[$extKey]['versions'][$version]['dependencies'];
                                        }
                                        $EM_CONF = tx_em_Tools::fixEMCONF($fetchData[0]['EM_CONF']);
                                        if (!$EM_CONF['lockType'] || !strcmp($EM_CONF['lockType'], $loc)) {
@@ -228,12 +236,16 @@ class tx_em_Install {
                                                                                                )));
                                                                                        }
 
-                                                                                       $flashMessage = t3lib_div::makeInstance(
-                                                                                               't3lib_FlashMessage',
-                                                                                               $messageContent,
-                                                                                               $GLOBALS['LANG']->getLL('ext_import_success')
-                                                                                       );
-                                                                                       $content = $flashMessage->render() . $updateContent;
+                                                                                       if (!$this->silentMode) {
+                                                                                               $flashMessage = t3lib_div::makeInstance(
+                                                                                                       't3lib_FlashMessage',
+                                                                                                       $messageContent,
+                                                                                                       $GLOBALS['LANG']->getLL('ext_import_success')
+                                                                                               );
+                                                                                               $content = $flashMessage->render();
+                                                                                       } else {
+                                                                                               $content = $updateContent;
+                                                                                       }
 
 
                                                                                        // Install / Uninstall:
@@ -553,21 +565,27 @@ class tx_em_Install {
                        if ($command['doDelete'] && !strcmp($absPath, urldecode($command['absPath']))) {
                                $res = $this->removeExtDirectory($absPath);
                                if ($res) {
-                                       $flashMessage = t3lib_div::makeInstance(
-                                               't3lib_FlashMessage',
-                                               nl2br($res),
-                                               sprintf($GLOBALS['LANG']->getLL('extDelete_remove_dir_failed'), $absPath),
-                                               t3lib_FlashMessage::ERROR
-                                       );
-                                       return $flashMessage->render();
+                                       if (!$this->silentMode) {
+                                               $flashMessage = t3lib_div::makeInstance(
+                                                       't3lib_FlashMessage',
+                                                       nl2br($res),
+                                                       sprintf($GLOBALS['LANG']->getLL('extDelete_remove_dir_failed'), $absPath),
+                                                       t3lib_FlashMessage::ERROR
+                                               );
+                                               return $flashMessage->render();
+                                       }
+                                       return '';
                                } else {
-                                       $flashMessage = t3lib_div::makeInstance(
-                                               't3lib_FlashMessage',
-                                               sprintf($GLOBALS['LANG']->getLL('extDelete_removed'), $absPath),
-                                               $GLOBALS['LANG']->getLL('extDelete_removed_header'),
-                                               t3lib_FlashMessage::OK
-                                       );
-                                       return $flashMessage->render();
+                                       if (!$this->silentMode) {
+                                               $flashMessage = t3lib_div::makeInstance(
+                                                       't3lib_FlashMessage',
+                                                       sprintf($GLOBALS['LANG']->getLL('extDelete_removed'), $absPath),
+                                                       $GLOBALS['LANG']->getLL('extDelete_removed_header'),
+                                                       t3lib_FlashMessage::OK
+                                               );
+                                               return $flashMessage->render();
+                                       }
+                                       return '';
                                }
                        } else {
                                $areYouSure = $GLOBALS['LANG']->getLL('extDelete_sure');
@@ -831,13 +849,16 @@ class tx_em_Install {
                                }
                                $res = $this->removeExtDirectory($extDirPath);
                                if ($res) {
-                                       $flashMessage = t3lib_div::makeInstance(
-                                               't3lib_FlashMessage',
-                                               nl2br($res),
-                                               sprintf($GLOBALS['LANG']->getLL('clearMakeExtDir_could_not_remove_dir'), $extDirPath),
-                                               t3lib_FlashMessage::ERROR
-                                       );
-                                       return $flashMessage->render();
+                                       if (!$this->silentMode) {
+                                               $flashMessage = t3lib_div::makeInstance(
+                                                       't3lib_FlashMessage',
+                                                       nl2br($res),
+                                                       sprintf($GLOBALS['LANG']->getLL('clearMakeExtDir_could_not_remove_dir'), $extDirPath),
+                                                       t3lib_FlashMessage::ERROR
+                                               );
+                                               return $flashMessage->render();
+                                       }
+                                       return '';
                                }
                        }
 
@@ -1185,20 +1206,21 @@ class tx_em_Install {
                                        </tr>
                                </table>';
                } else {
-                       $flashMessage = t3lib_div::makeInstance(
-                               't3lib_FlashMessage',
-                               $GLOBALS['LANG']->getLL('tsStyleConfigForm_additional_config'),
-                               '',
-                               t3lib_FlashMessage::INFO
-                       );
-
+                       if (!$this->silentMode) {
+                               $flashMessage = t3lib_div::makeInstance(
+                                       't3lib_FlashMessage',
+                                       $GLOBALS['LANG']->getLL('tsStyleConfigForm_additional_config'),
+                                       '',
+                                       t3lib_FlashMessage::INFO
+                               );
+                       }
                        $form = '
                                <table border="0" cellpadding="0" cellspacing="0" width="600">
                                        <tr>
                                                <td>
                                                        <form action="' . htmlspecialchars($script) . '" method="post">' .
                                        $addFields .
-                                       $flashMessage->render() .
+                                       (!$this->silentMode ? '' : $flashMessage->render()) .
                                        '<br /><input type="submit" name="write" value="' . $GLOBALS['LANG']->getLL('updatesForm_make_updates') . '" />
                                                        </form>
                                                </td>
index bc5e397..a69bcd4 100644 (file)
@@ -218,6 +218,7 @@ abstract class tx_em_Parser_MirrorXmlAbstractParser extends tx_em_Parser_XmlAbst
         * @return  void
         */
        protected function throwException($message = "", $code = 0) {
+               t3lib_div::requireOnce(t3lib_extMgm::extPath('em') . 'classes/exception/class.tx_em_mirrorxml_exception.php');
                throw new tx_em_MirrorXmlException(get_class($this) . ': ' . $message, $code);
        }
 }
index ec99907..93e0d65 100644 (file)
@@ -118,9 +118,9 @@ class tx_em_Repository {
         * @access  public
         * @return  void
         */
-       function __construct($uid = 0) {
+       function __construct($uid = 1) {
                $row = tx_em_Database::getRepositoryByUID($uid);
-               if (is_null($row)) {
+               if (!is_array($row) && $uid === 1) {
                        $this->fixMainRepository();
                } else {
                        $this->setTitle($row['title']);
@@ -260,7 +260,7 @@ class tx_em_Repository {
         * @see  $mirrorListUrl, getMirrorListUrl()
         */
        public function setMirrorListUrl($url) {
-               if (!empty($url) && t3lib_div::isValidUrl($url)) {
+               if (empty($url) || (!empty($url) && t3lib_div::isValidUrl($url))) {
                        $this->mirrorListUrl = $url;
                }
        }
index af45e24..29d489a 100644 (file)
@@ -99,13 +99,13 @@ class tx_em_Settings implements t3lib_Singleton {
        protected function readSettings() {
                $this->MOD_MENU = array(
                        'function' => array(
+                               'extensionmanager' => 'New Extension manager (beta4)', //$GLOBALS['LANG']->getLL('header'),
                                'loaded_list' => $GLOBALS['LANG']->getLL('menu_loaded_extensions'),
                                'installed_list' => $GLOBALS['LANG']->getLL('menu_install_extensions'),
                                'import' => $GLOBALS['LANG']->getLL('menu_import_extensions'),
                                'translations' => $GLOBALS['LANG']->getLL('menu_translation_handling'),
                                'settings' => $GLOBALS['LANG']->getLL('menu_settings'),
                                'updates' => $GLOBALS['LANG']->getLL('menu_extension_updates'),
-                               'extensionmanager' => 'New Extension manager (beta3)', //$GLOBALS['LANG']->getLL('header'),
                                'develop' => $GLOBALS['LANG']->getLL('menu_extension_develop'),
                        ),
                        'listOrder' => array(
@@ -128,6 +128,8 @@ class tx_em_Settings implements t3lib_Singleton {
                        'display_obsolete' => '',
                        'display_installed' => '',
                        'display_files' => '',
+                       'hide_shy' => 0,
+                       'hide_obsolete' => 0,
 
 
                        'singleDetails' => array(
@@ -168,11 +170,24 @@ class tx_em_Settings implements t3lib_Singleton {
                }
 
                $mirrors = unserialize($this->settings['extMirrors']);
-               /*if(!is_array($mirrors)) {
-                       $this->fetchMetaData('mirrors');
-                       $mirrors = unserialize($this->MOD_SETTINGS['extMirrors']);
-                       if(!is_array($mirrors)) return false;
-               }*/
+
+               if(!is_array($mirrors)) {
+                       if ($this->settings['selectedRepository'] < 1) {
+                               $this->settings['selectedRepository'] = 1;
+                       }
+               }
+                       /** @var $repository tx_em_Repository */
+                       $repository = t3lib_div::makeInstance('tx_em_Repository', $this->settings['selectedRepository']);
+                       if ($repository->getMirrorListUrl()) {
+                       $objRepositoryUtility = t3lib_div::makeInstance('tx_em_Repository_Utility', $repository);
+                       $mirrors = $objRepositoryUtility->getMirrors(TRUE)->getMirrors();
+                       if(!is_array($mirrors)) {
+                               return FALSE;
+                       } else {
+                               $this->settings['extMirrors'] = serialize($mirrors);
+                               $this->saveSetting('extMirrors', $this->settings['extMirrors']);
+                       }
+               }
                if (!$this->settings['selectedMirror']) {
                        $rand = array_rand($mirrors);
                        $url = 'http://' . $mirrors[$rand]['host'] . $mirrors[$rand]['path'];
index 3126d46..0feed8e 100644 (file)
@@ -456,6 +456,23 @@ final class tx_em_Tools {
        }
 
        /**
+        * Render version from intVersion
+        *
+        * @static
+        * @param  int  $intVersion
+        * @return string version
+        */
+       public static function versionFromInt($intVersion) {
+               $versionString = str_pad($intVersion, 9, '0', STR_PAD_LEFT);
+               $parts = array(
+                       substr($versionString, 0, 3),
+                       substr($versionString, 3, 3),
+                       substr($versionString, 6, 3)
+               );
+               return intval($parts[0]) . '.' . intval($parts[1]) . '.' . intval($parts[2]);
+       }
+
+       /**
         * Evaluates differences in version numbers with three parts, x.x.x. Returns true if $v1 is greater than $v2
         *
         * @param       string          Version number 1
@@ -906,12 +923,13 @@ final class tx_em_Tools {
                                                                // Check for proper XCLASS definition
                                                                // Match $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS'] with single or doublequotes
                                                        $XclassSearch = '\$TYPO3_CONF_VARS\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]';
-                                                       $XclassParts = preg_split('/if \(defined\([\'"]TYPO3_MODE[\'"]\) && ' . $XclassSearch . '/', $fContent, 2);
+                                                       $XclassParts = preg_split('/if \(defined\([\'"]TYPO3_MODE[\'"]\)(.*)' . $XclassSearch . '/', $fContent, 2);
                                                        if (count($XclassParts) !== 2) {
                                                                        // Match $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS'] with single or doublequotes
                                                                $XclassSearch = '\$GLOBALS\[[\'"]TYPO3_CONF_VARS[\'"]\]\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]';
-                                                               $XclassParts = preg_split('/if \(defined\([\'"]TYPO3_MODE[\'"]\) && ' . $XclassSearch . '/', $fContent, 2);
+                                                               $XclassParts = preg_split('/if \(defined\([\'"]TYPO3_MODE[\'"]\)(.*)' . $XclassSearch . '/', $fContent, 2);
                                                        }
+
                                                        if (count($XclassParts) == 2) {
                                                                unset($reg);
                                                                preg_match('/^\[[\'"]([[:alnum:]_\/\.]*)[\'"]\]/', $XclassParts[1], $reg);
index 4041c08..29eb971 100644 (file)
@@ -542,6 +542,11 @@ class tx_em_Tools_Unzip {
                        }
                }
 
+                       // added by TYPO3 secteam to check for invalid paths
+               if (!t3lib_div::validPathStr($p_entry['filename'])) {
+                               return $v_result;
+               }
+
                // Add the path
                if ($p_path != '') {
                        $p_entry['filename'] = $p_path . "/" . $p_entry['filename'];
index dd1127d..9d7070b 100644 (file)
@@ -100,6 +100,8 @@ class tx_em_Translations {
                                t3lib_div::mkdir_deep(PATH_typo3conf, $path);
                        }
                        t3lib_div::writeFile($file, $l10n[0]);
+                       // SteffenG tried this to get first update without errors
+                       //t3lib_div::rmdir(PATH_typo3conf . $path, TRUE);
                        if (tx_em_Tools::unzip($file, PATH_typo3conf . $path)) {
                                return true;
                        } else {
index c755269..5f0ef3b 100644 (file)
@@ -1,6 +1,7 @@
 <?php
-$emClassesPath = PATH_site . 'typo3/sysext/em/classes/';
-$emInterfacesPath = PATH_site . 'typo3/sysext/em/interfaces/';
+$extensionPath = dirname(__FILE__);
+$emClassesPath = $extensionPath . '/classes/';
+$emInterfacesPath = $extensionPath . '/interfaces/';
 return array(
        'tx_em_index_checkdatabaseupdateshook' => $emInterfacesPath . 'interface.tx_em_index_checkdatabaseupdateshook.php',
 
diff --git a/typo3/sysext/em/ext_conf_template.txt b/typo3/sysext/em/ext_conf_template.txt
new file mode 100644 (file)
index 0000000..26bb1a5
--- /dev/null
@@ -0,0 +1,8 @@
+  # cat=basic; type=boolean; label=LLL:EXT:em/language/locallang.xml:extTemplate_showOldModules
+showOldModules = 1
+
+  # cat=basic; type=boolean; label=LLL:EXT:em/language/locallang.xml:extTemplate_inlineToWindow
+inlineToWindow = 0
+
+  # cat=basic; type=string; label=LLL:EXT:em/language/locallang.xml:extTemplate_selectedLanguages
+selectedLanguages =
index 1b81715..945c247 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "em".
 #
-# Auto generated 28-12-2010 15:54
+# Auto generated 12-01-2011 22:50
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -11,7 +11,7 @@
 ########################################################################
 
 $EM_CONF[$_EXTKEY] = array(
-       'title' => 'Ext Manager',
+       'title' => 'Extension Manager',
        'description' => 'TYPO3 Extension Manager',
        'category' => 'module',
        'shy' => 1,
@@ -34,7 +34,7 @@ $EM_CONF[$_EXTKEY] = array(
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
        'version' => '4.5.0',
-       '_md5_values_when_last_written' => 'a:98:{s:16:"ext_autoload.php";s:4:"a363";s:12:"ext_icon.gif";s:4:"2cc2";s:17:"ext_localconf.php";s:4:"fd30";s:14:"ext_tables.php";s:4:"93ea";s:14:"ext_tables.sql";s:4:"5a42";s:25:"ext_tables_static+adt.sql";s:4:"3c1b";s:27:"classes/class.tx_em_api.php";s:4:"c09b";s:31:"classes/class.tx_em_develop.php";s:4:"98bd";s:40:"classes/class.tx_em_extensionmanager.php";s:4:"4667";s:16:"classes/conf.php";s:4:"d842";s:17:"classes/index.php";s:4:"0753";s:61:"classes/connection/class.tx_em_connection_extdirectserver.php";s:4:"8a8a";s:59:"classes/connection/class.tx_em_connection_extdirectsoap.php";s:4:"b6c6";s:50:"classes/connection/class.tx_em_connection_soap.php";s:4:"decd";s:49:"classes/connection/class.tx_em_connection_ter.php";s:4:"543b";s:41:"classes/database/class.tx_em_database.php";s:4:"6e3b";s:54:"classes/exception/class.tx_em_connection_exception.php";s:4:"8b14";s:59:"classes/exception/class.tx_em_extensionimport_exception.php";s:4:"62e2";s:56:"classes/exception/class.tx_em_extensionxml_exception.php";s:4:"fcfe";s:53:"classes/exception/class.tx_em_mirrorxml_exception.php";s:4:"ad05";s:47:"classes/exception/class.tx_em_xml_exception.php";s:4:"3679";s:53:"classes/extensions/class.tx_em_extensions_details.php";s:4:"50b9";s:50:"classes/extensions/class.tx_em_extensions_list.php";s:4:"8a24";s:59:"classes/import/class.tx_em_import_extensionlistimporter.php";s:4:"25e8";s:56:"classes/import/class.tx_em_import_mirrorlistimporter.php";s:4:"6c5e";s:39:"classes/install/class.tx_em_install.php";s:4:"5350";s:64:"classes/parser/class.tx_em_parser_extensionxmlabstractparser.php";s:4:"469f";s:60:"classes/parser/class.tx_em_parser_extensionxmlpullparser.php";s:4:"6d57";s:60:"classes/parser/class.tx_em_parser_extensionxmlpushparser.php";s:4:"eb30";s:61:"classes/parser/class.tx_em_parser_mirrorxmlabstractparser.php";s:4:"f14d";s:57:"classes/parser/class.tx_em_parser_mirrorxmlpullparser.php";s:4:"8092";s:57:"classes/parser/class.tx_em_parser_mirrorxmlpushparser.php";s:4:"7267";s:55:"classes/parser/class.tx_em_parser_xmlabstractparser.php";s:4:"6d00";s:54:"classes/parser/class.tx_em_parser_xmlparserfactory.php";s:4:"471c";s:55:"classes/reports/class.tx_em_reports_extensionstatus.php";s:4:"f631";s:45:"classes/repository/class.tx_em_repository.php";s:4:"d727";s:53:"classes/repository/class.tx_em_repository_mirrors.php";s:4:"987c";s:53:"classes/repository/class.tx_em_repository_utility.php";s:4:"33ed";s:41:"classes/settings/class.tx_em_settings.php";s:4:"b6d5";s:55:"classes/tasks/class.tx_em_tasks_updateextensionlist.php";s:4:"b634";s:35:"classes/tools/class.tx_em_tools.php";s:4:"86a1";s:41:"classes/tools/class.tx_em_tools_unzip.php";s:4:"e6b9";s:46:"classes/tools/class.tx_em_tools_xmlhandler.php";s:4:"9686";s:49:"classes/translations/class.tx_em_translations.php";s:4:"b1a6";s:61:"interfaces/interface.tx_em_index_checkdatabaseupdateshook.php";s:4:"7178";s:22:"language/locallang.xml";s:4:"c7b2";s:18:"res/css/editor.css";s:4:"d4a2";s:17:"res/css/t3_em.css";s:4:"ddfe";s:24:"res/icons/arrow_redo.png";s:4:"343b";s:24:"res/icons/arrow_undo.png";s:4:"9a4f";s:20:"res/icons/cancel.png";s:4:"757a";s:22:"res/icons/download.png";s:4:"c5b2";s:19:"res/icons/drive.png";s:4:"9520";s:25:"res/icons/filebrowser.png";s:4:"25b9";s:18:"res/icons/flag.png";s:4:"8798";s:19:"res/icons/image.png";s:4:"82ab";s:21:"res/icons/install.gif";s:4:"8d57";s:20:"res/icons/jslint.gif";s:4:"2e24";s:19:"res/icons/oodoc.gif";s:4:"744b";s:20:"res/icons/server.png";s:4:"92ce";s:22:"res/icons/settings.png";s:4:"30a1";s:25:"res/icons/text_indent.png";s:4:"47f0";s:19:"res/icons/tools.png";s:4:"16d9";s:23:"res/icons/uninstall.gif";s:4:"a77f";s:16:"res/js/em_app.js";s:4:"7d34";s:23:"res/js/em_components.js";s:4:"e09b";s:18:"res/js/em_files.js";s:4:"ce62";s:22:"res/js/em_languages.js";s:4:"d086";s:20:"res/js/em_layouts.js";s:4:"90a1";s:22:"res/js/em_locallist.js";s:4:"185d";s:27:"res/js/em_repositorylist.js";s:4:"da7a";s:21:"res/js/em_settings.js";s:4:"08b3";s:16:"res/js/em_ter.js";s:4:"a237";s:18:"res/js/em_tools.js";s:4:"8845";s:22:"res/js/em_usertools.js";s:4:"8935";s:33:"res/js/overrides/ext_overrides.js";s:4:"3bc1";s:24:"res/js/ux/GridFilters.js";s:4:"95db";s:27:"res/js/ux/custom_plugins.js";s:4:"a27f";s:28:"res/js/ux/fileuploadfield.js";s:4:"06a5";s:19:"res/js/ux/jslint.js";s:4:"8c75";s:29:"res/js/ux/rowpanelexpander.js";s:4:"2158";s:24:"res/js/ux/searchfield.js";s:4:"41a1";s:29:"res/js/ux/css/GridFilters.css";s:4:"78fa";s:27:"res/js/ux/css/RangeMenu.css";s:4:"c5f6";s:33:"res/js/ux/filter/BooleanFilter.js";s:4:"d67f";s:30:"res/js/ux/filter/DateFilter.js";s:4:"1d6d";s:26:"res/js/ux/filter/Filter.js";s:4:"5e35";s:30:"res/js/ux/filter/ListFilter.js";s:4:"a9ab";s:33:"res/js/ux/filter/NumericFilter.js";s:4:"abb4";s:32:"res/js/ux/filter/StringFilter.js";s:4:"0923";s:27:"res/js/ux/images/equals.png";s:4:"87b7";s:25:"res/js/ux/images/find.png";s:4:"9f1c";s:33:"res/js/ux/images/greater_than.png";s:4:"746c";s:30:"res/js/ux/images/less_than.png";s:4:"2fb7";s:38:"res/js/ux/images/sort_filtered_asc.gif";s:4:"9e7a";s:39:"res/js/ux/images/sort_filtered_desc.gif";s:4:"6d59";s:26:"res/js/ux/menu/ListMenu.js";s:4:"d6c1";s:27:"res/js/ux/menu/RangeMenu.js";s:4:"cc46";}',
+       '_md5_values_when_last_written' => 'a:101:{s:16:"ext_autoload.php";s:4:"5d4e";s:21:"ext_conf_template.txt";s:4:"5e54";s:12:"ext_icon.gif";s:4:"2cc2";s:17:"ext_localconf.php";s:4:"fd30";s:14:"ext_tables.php";s:4:"93ea";s:14:"ext_tables.sql";s:4:"5a42";s:25:"ext_tables_static+adt.sql";s:4:"3c1b";s:27:"classes/class.tx_em_api.php";s:4:"c09b";s:31:"classes/class.tx_em_develop.php";s:4:"7b6e";s:40:"classes/class.tx_em_extensionmanager.php";s:4:"5a63";s:16:"classes/conf.php";s:4:"d842";s:17:"classes/index.php";s:4:"c5af";s:61:"classes/connection/class.tx_em_connection_extdirectserver.php";s:4:"6b7a";s:59:"classes/connection/class.tx_em_connection_extdirectsoap.php";s:4:"e0e8";s:50:"classes/connection/class.tx_em_connection_soap.php";s:4:"decd";s:49:"classes/connection/class.tx_em_connection_ter.php";s:4:"1f3c";s:41:"classes/database/class.tx_em_database.php";s:4:"0ed7";s:54:"classes/exception/class.tx_em_connection_exception.php";s:4:"8b14";s:59:"classes/exception/class.tx_em_extensionimport_exception.php";s:4:"62e2";s:56:"classes/exception/class.tx_em_extensionxml_exception.php";s:4:"fcfe";s:53:"classes/exception/class.tx_em_mirrorxml_exception.php";s:4:"ad05";s:47:"classes/exception/class.tx_em_xml_exception.php";s:4:"3679";s:53:"classes/extensions/class.tx_em_extensions_details.php";s:4:"7b5a";s:50:"classes/extensions/class.tx_em_extensions_list.php";s:4:"7dc0";s:59:"classes/import/class.tx_em_import_extensionlistimporter.php";s:4:"25e8";s:56:"classes/import/class.tx_em_import_mirrorlistimporter.php";s:4:"6c5e";s:39:"classes/install/class.tx_em_install.php";s:4:"8dbb";s:64:"classes/parser/class.tx_em_parser_extensionxmlabstractparser.php";s:4:"469f";s:60:"classes/parser/class.tx_em_parser_extensionxmlpullparser.php";s:4:"6d57";s:60:"classes/parser/class.tx_em_parser_extensionxmlpushparser.php";s:4:"eb30";s:61:"classes/parser/class.tx_em_parser_mirrorxmlabstractparser.php";s:4:"8f3c";s:57:"classes/parser/class.tx_em_parser_mirrorxmlpullparser.php";s:4:"8092";s:57:"classes/parser/class.tx_em_parser_mirrorxmlpushparser.php";s:4:"7267";s:55:"classes/parser/class.tx_em_parser_xmlabstractparser.php";s:4:"6d00";s:54:"classes/parser/class.tx_em_parser_xmlparserfactory.php";s:4:"471c";s:55:"classes/reports/class.tx_em_reports_extensionstatus.php";s:4:"f631";s:45:"classes/repository/class.tx_em_repository.php";s:4:"a953";s:53:"classes/repository/class.tx_em_repository_mirrors.php";s:4:"987c";s:53:"classes/repository/class.tx_em_repository_utility.php";s:4:"33ed";s:41:"classes/settings/class.tx_em_settings.php";s:4:"3938";s:55:"classes/tasks/class.tx_em_tasks_updateextensionlist.php";s:4:"b634";s:35:"classes/tools/class.tx_em_tools.php";s:4:"aacf";s:41:"classes/tools/class.tx_em_tools_unzip.php";s:4:"d183";s:46:"classes/tools/class.tx_em_tools_xmlhandler.php";s:4:"1bbd";s:49:"classes/translations/class.tx_em_translations.php";s:4:"935d";s:61:"interfaces/interface.tx_em_index_checkdatabaseupdateshook.php";s:4:"7178";s:22:"language/locallang.xml";s:4:"33cd";s:18:"res/css/editor.css";s:4:"d4a2";s:17:"res/css/t3_em.css";s:4:"fbbf";s:24:"res/icons/arrow_redo.png";s:4:"343b";s:24:"res/icons/arrow_undo.png";s:4:"9a4f";s:20:"res/icons/cancel.png";s:4:"757a";s:22:"res/icons/download.png";s:4:"c5b2";s:19:"res/icons/drive.png";s:4:"9520";s:19:"res/icons/email.png";s:4:"af58";s:25:"res/icons/filebrowser.png";s:4:"25b9";s:18:"res/icons/flag.png";s:4:"8798";s:19:"res/icons/image.png";s:4:"82ab";s:21:"res/icons/install.gif";s:4:"8d57";s:20:"res/icons/jslint.gif";s:4:"2e24";s:19:"res/icons/oodoc.gif";s:4:"744b";s:23:"res/icons/repupdate.png";s:4:"eaa5";s:20:"res/icons/server.png";s:4:"92ce";s:22:"res/icons/settings.png";s:4:"30a1";s:25:"res/icons/text_indent.png";s:4:"47f0";s:19:"res/icons/tools.png";s:4:"16d9";s:23:"res/icons/uninstall.gif";s:4:"a77f";s:16:"res/js/em_app.js";s:4:"1596";s:23:"res/js/em_components.js";s:4:"d243";s:18:"res/js/em_files.js";s:4:"d34c";s:22:"res/js/em_languages.js";s:4:"78c6";s:20:"res/js/em_layouts.js";s:4:"9dca";s:22:"res/js/em_locallist.js";s:4:"8d39";s:27:"res/js/em_repositorylist.js";s:4:"2888";s:21:"res/js/em_settings.js";s:4:"0264";s:16:"res/js/em_ter.js";s:4:"b7bf";s:18:"res/js/em_tools.js";s:4:"5c6e";s:22:"res/js/em_usertools.js";s:4:"385b";s:33:"res/js/overrides/ext_overrides.js";s:4:"2a8d";s:24:"res/js/ux/GridFilters.js";s:4:"95db";s:29:"res/js/ux/RowPanelExpander.js";s:4:"d4dd";s:27:"res/js/ux/custom_plugins.js";s:4:"d761";s:28:"res/js/ux/fileuploadfield.js";s:4:"06a5";s:19:"res/js/ux/jslint.js";s:4:"8c75";s:24:"res/js/ux/searchfield.js";s:4:"1aeb";s:29:"res/js/ux/css/GridFilters.css";s:4:"78fa";s:27:"res/js/ux/css/RangeMenu.css";s:4:"c5f6";s:33:"res/js/ux/filter/BooleanFilter.js";s:4:"d67f";s:30:"res/js/ux/filter/DateFilter.js";s:4:"1d6d";s:26:"res/js/ux/filter/Filter.js";s:4:"5e35";s:30:"res/js/ux/filter/ListFilter.js";s:4:"a9ab";s:33:"res/js/ux/filter/NumericFilter.js";s:4:"abb4";s:32:"res/js/ux/filter/StringFilter.js";s:4:"0923";s:27:"res/js/ux/images/equals.png";s:4:"87b7";s:25:"res/js/ux/images/find.png";s:4:"9f1c";s:33:"res/js/ux/images/greater_than.png";s:4:"746c";s:30:"res/js/ux/images/less_than.png";s:4:"2fb7";s:38:"res/js/ux/images/sort_filtered_asc.gif";s:4:"9e7a";s:39:"res/js/ux/images/sort_filtered_desc.gif";s:4:"6d59";s:26:"res/js/ux/menu/ListMenu.js";s:4:"d6c1";s:27:"res/js/ux/menu/RangeMenu.js";s:4:"cc46";}',
        'constraints' => array(
                'depends' => array(
                        'cms' => '',
index f594bbb..ab515b8 100644 (file)
@@ -10,7 +10,7 @@
                        <label index="tasks_updateExtensionlistTask.description">Update extension list on a regular basis. Once a day is a good interval.</label>
                        <label index="mlang_labels_tablabel">TYPO3 Extension Manager</label>
                        <label index="mlang_labels_tabdescr">Manages TYPO3 extensions from a central repository, which includes plugins, modules, class extensions, configuration code etc.</label>
-                       <label index="mlang_tabs_tab">Ext Manager</label>
+                       <label index="mlang_tabs_tab">Extension Manager</label>
                        <label index="category_BE">Backend</label>
                        <label index="category_BE_modules">Backend Modules</label>
                        <label index="category_FE">Frontend</label>
@@ -40,6 +40,7 @@
                        <label index="menu_loaded_extensions">Loaded extensions</label>
                        <label index="menu_install_extensions">Install extensions</label>
                        <label index="menu_import_extensions">Import extensions</label>
+                       <label index="menu_update_extensions">Update extensions</label>
                        <label index="menu_translation_handling">Translation handling</label>
                        <label index="menu_settings">Settings</label>
                        <label index="lang_language">Language</label>
                        <label index="show">Show:</label>
                        <label index="display_shy">Display shy extensions</label>
                        <label index="display_obsolete">Display obsolete extensions</label>
+                       <label index="hide_shy">Hide shy extensions</label>
+                       <label index="hide_obsolete">Hide obsolete extensions</label>
                        <label index="display_installedOnly">Display installed extensions only</label>
+                       <label index="display_updatesOnly">Display updatable extensions only</label>
+                       <label index="display_all">Display all extensions</label>
                        <label index="only_my_ext">Only my extensions:</label>
                        <label index="show_obsolete">Show obsolete:</label>
                        <label index="extensions">Extensions:</label>
@@ -92,6 +97,7 @@
                        <label index="look_up_button">Look up</label>
                        <label index="privacy_notice_header">PRIVACY NOTICE:</label>
                        <label index="extensions_repository_group_by">Extensions in TYPO3 Extension Repository (online) - Grouped by:</label>
+                       <label index="extensions_repository_short">Extensions in repository:</label>
                        <label index="extension_required_short">Rq</label>
                        <label index="list_of_local_extensions">This is the list of extensions which are available locally, but not in the repository.</label>
                        <label index="might_be_user_defined">They might be user-defined and should be prepended user_ then.</label>
                        <label index="global_folder">Global (typo3/ext/)</label>
                        <label index="system_folder">System (typo3/sysext/)</label>
                        <label index="overwrite_ext">Overwrite any existing extension!</label>
+                       <label index="upload_ext">Extension Upload</label>
                        <label index="upload_ext_file">Upload extension file</label>
-                       <label index="upload_ext_directly">Upload extension file directly (.t3x):</label>
+                       <label index="upload_ext_from">Upload extension from your computer</label>
+                       <label index="upload_ext_directly">Upload extension file directly (.t3x)</label>
+                       <label index="upload_selectExtension">Select Extension (*.t3x)</label>
                        <label index="previous_page">Prev page</label>
                        <label index="next_page">Next page</label>
                        <label index="showing_extensions_from_to">Showing extensions %s to %s</label>
                        <label index="repository_created">Repository "{0}" was created.</label>
                        <label index="repository_saved">Repository "{0}" was saved.</label>
                        <label index="repository">Repository</label>
+                       <label index="repository_main_nodelete">Main repository can not be deleted!</label>
+                       <label index="repository_upToDate">Repository is up-to-date.</label>
                        <label index="translation_settings">Translation Settings</label>
                        <label index="languages_to_fetch">Languages to fetch:</label>
                        <label index="translation_info">For the selected languages the EM tries to download and install translation files if available, whenever an extension is installed. (This replaces the &lt;code&gt;csh_*&lt;/code&gt; extensions that were used to install core translations before TYPO3 version 4!)</label>
                        <label index="translation_checking_extension">Check languages against repository</label>
                        <label index="translation_update_extension">Update languages from repository</label>
                        <label index="translation_no_translation">No translation available</label>
-                       <label index="translation_n_a">n/a</label>
+                       <label index="translation_n_a">not available</label>
                        <label index="translation_not_installed">Not installed/Unknown</label>
                        <label index="translation_status_unknown">???</label>
-                       <label index="translation_status_new">new</label>
-                       <label index="translation_status_ok">ok</label>
+                       <label index="translation_status_new">New translation available</label>
+                       <label index="translation_status_uptodate">up-to-date</label>
                        <label index="translation_needs_update">Needs update</label>
-                       <label index="translation_status_update">update</label>
+                       <label index="translation_status_update">Update available</label>
                        <label index="translation_status_notchecked">not checked</label>
                        <label index="translation_is_ok">Is up to date</label>
-                       <label index="translation_status_ok">OK</label>
+                       <label index="translation_status_ok">updated</label>
                        <label index="translation_check_done">Check done.</label>
                        <label index="translation_update_status">Updating translations, please wait...</label>
                        <label index="translation_table_update">This table shows the update results of the translations of the loaded extensions.</label>
                        <label index="ext_import_install">Install extension</label>
                        <label index="ext_import_imported">The extension has been imported.</label>
                        <label index="ext_import_close_check">Close window and recheck dependencies.</label>
+                       <label index="ext_import_close">Close window.</label>
                        <label index="ext_import_ext_path_different">Error: The extension path '%s' was different than expected...</label>
                        <label index="ext_import_ext_only_here">Error: The extension can only be installed in the path %s (lockType=%s).</label>
                        <label index="ext_import_no_ext_key_files">Error: No extension key!!! Why? - nobody knows... (Or there are no files in the file array...)</label>
                        <label index="ext_import_data_transfer">Error: The data transfer did not succeed. %s</label>
                        <label index="ext_import_no_install_here">Error: Installation is not allowed in this path (%s).</label>
                        <label index="ext_import_results">Extension import results</label>
+                       <label index="ext_import_versions">Import versions of "{0}"</label>
+                       <label index="ext_import_versions_available">{0} versions available</label>
                        <label index="ext_details_ext">Extension:</label>
                        <label index="ext_details_new_tables_fields">Before the extension can be installed the database needs to be updated with new tables or fields.</label>
                        <label index="ext_details_new_tables_fields_select">Please select which operations to perform:</label>
                        <label index="note_last_update2">To get and update the list, go to the section "Import extensions" and use the button "Retrieve/Update".</label>
                        <label index="note_last_update2_new">To get and update the list, %sgo to the section "Import extensions" and use the button "Retrieve/Update"%s.</label>
                        <label index="double_inclusion">%1$s takes precedence over %2$s</label>
+                       <label index="double_inclusion_js">{0} takes precedence over {1}</label>
                        <label index="globalext">Globally installed extension</label>
                        <label index="localext">Locally installed extension</label>
                        <label index="sysext">System extension</label>
                        <label index="cmd_redo">Redo</label>
                        <label index="cmd_indent">Indent</label>
                        <label index="cmd_jslint">JS Lint</label>
-                       <label index="msg_terupload">Extension was uploaded to TER.</label>
+                       <label index="msg_terupload">Extension "{0}" was uploaded to TER.</label>
+                       <label index="msg_uploaded">Extension "{0}" was uploaded.</label>
                        <label index="msg_error">Error</label>
                        <label index="msg_invalid">Invalid</label>
                        <label index="msg_status">Status</label>
                        <label index="msg_finished">Finished!</label>
                        <label index="msg_checking">Checking</label>
                        <label index="msg_updating">Updating</label>
+                       <label index="msg_updated">Updated</label>
+                       <label index="msg_failed">Failed</label>
                        <label index="msg_interrupted">Interrupted!</label>
                        <label index="msg_info">Info</label>
                        <label index="msg_debug">Debug</label>
                        <label index="msg_files">Files</label>
                        <label index="msg_line">Line</label>
                        <label index="msg_character">Character</label>
-                       <label index="msg_terupload">Upload to TER</label>
                        <label index="msg_developerinformation">Developer Information</label>
                        <label index="msg_fileSaved">File "{0}" was saved.</label>
+                       <label index="msg_extUpToDate">Extension is up-to-date.</label>
+                       <label index="msg_extNotInstalled">Extension "%s" is not installed.</label>
+                       <label index="msg_extNoConfiguration">This extension has no configuration.</label>
+                       <label index="msg_loginFailed">login failed!</label>
+                       <label index="msg_noUserLoginData">No user login data!</label>
+                       <label index="msg_ok">Okay</label>
+                       <label index="msg_userNotExists">User does not exists!</label>
+                       <label index="msg_extkexExists">Extensionkey already exists.</label>
+                       <label index="msg_extkexNotExists">Extensionkey does not exists.</label>
+                       <label index="msg_extkexNotValid">Extensionkey is not valid.</label>
+                       <label index="msg_extkexRegistered">Extensionkey was successful registered.</label>
+                       <label index="msg_extkexUploadedSuccess">Extension was successful uploaded.</label>
+                       <label index="msg_extkexDeletedSuccess">Extension was successful deleted.</label>
+                       <label index="msg_unknownError">Unknow error occured.</label>
                        <label index="configurationSaved">Configuration was saved.</label>
                        <label index="action_loading_extlist">Loading Extensionlist ...</label>
                        <label index="action_loadingRepositoryExtlist">Loading Repository Extensionlist ...</label>
                        <label index="action_loading">Loading  ...</label>
                        <label index="action_searching">Searching ...</label>
+                       <label index="action_saving_settings">Saving settings ...</label>
+                       <label index="action_sending_data">Sending data ...</label>
                        <label index="registerkeys_rules_heading">Extension key format rules</label>
                        <label index="registerkeys_rules_allowedcharacters">Allowed characters are: a-z (lowercase), 0-9 and '_' (underscore)</label>
                        <label index="registerkeys_rules_prefixes">The key must not being with one of the following prefixes: tx,u,user_,pages,tt_,sys_,ts_language_,csh_</label>
                        <label index="registerkeys_check_validity_extkey_isvalid">Extension key is valid</label>
                        <label index="registerkeys_checking_validity">Checking validity ...</label>
                        <label index="registerkeys_register_extkey">Register extension key ...</label>
-                       <label index="registerkeys_register_extkey_success">Extensionkey {0] was registered</label>
+                       <label index="registerkeys_register_extkey_success">Extensionkey {0} was registered</label>
                        <label index="registerkeys_registerkey">Register extension key</label>
                        <label index="registerkeys_cancel_register">Cancel register</label>
                        <label index="transferkeys_info">Transfer an extension key to another user. There is no undo, be sure you have the right username of the user you want to transfer the extension key to.</label>
                        <label index="reports_insecureExistingExtensions">The following extensions were found on your system, but are currently not installed. Please delete the extension using the extension manager:</label>
                        <label index="reports_StatusInstalledExtensions">Security status of installed extensions</label>
                        <label index="reports_StatusExistingExtensions">Security status of existing extensions</label>
+                       <label index="insecureExtension">This extension is marked as insecure and usage might damage your system. Please update this extension as soon as possible or remove it from your system.</label>
                        <label index="reports_insecureExtensionsFound">%s insecure extension(s) found</label>
                        <label index="reports_sysTerNotFound">The table "sys_ter" was not found. Please go to install tool and make a database compare!</label>
                        <label index="reports_MainRepositoryNotFound">The Main Repository entry in table "sys_ter" was not found. Please go to extension manager / em and import static data!</label>
                        <label index="reports_MainRepositoryOldList">The Main Repository extension list is older than 7 days. Please make an update in extension manager or scheduler.</label>
                        <label index="reports_NoExtensionsFound">No extensions found!</label>
                        <label index="reports_ExtensionsNotUpToDate">Extension list is not up to date!</label>
-                       <label index="stateProvider">State provider</label>
-                       <label index="stateProviderDescription">States are saved interface changes like grid sorting, grid filtering, column resize, column reorder etc. All these states are saved in the user session and are restored on next load. To get the initial state of the interface, you can clear save states by clicking on button below.</label>
-                       <label index="stateProviderClear">Clear user states and reset interface to defaults</label>
-                       <label index="stateProviderCleared">User states are cleared, interface is reset to default.</label>
                        <label index="wsdlUrl">WSDL URL</label>
                        <label index="msg_items">Items</label>
                        <label index="msg_item">Item</label>
                        <label index="cmd_ClearAllFilters">Clear all Filters</label>
-                       <label index="cmd_ClearGrouping">Clear Grouping</label>
                        <label index="cmd_RetrieveUpdate">Retrieve / Update</label>
+                       <label index="help_localFilter">Enter something for filter and press Enter. Look up is in fields "title, description and extkey"</label>
                        <label index="help_remoteFilter">Enter something for search and press Enter. To list all, use "*"</label>
                        <label index="help_loadFileInEditor">Click on a file to load in editor</label>
+                       <label index="extTemplate_showOldModules">Show old modules: Enable this option to have old modules like "Loaded Extensions, Installed extensions ..." available in upper left select box of extension manager</label>
+                       <label index="extTemplate_selectedLanguages">Language selection: The language setting is saved here as a global setting. You might not change it at this place, use the tab "Translation handling" to add / remove languages to your installation</label>
+                       <label index="extTemplate_inlineToWindow">Use windows instead inline expander: On small screens the inline row expanders might take too much space. This switch move this info to windows.</label>
+                       <label index="soap_error">Unexpected result from SOAP</label>
 
                </languageKey>
        </data>
index 039aa31..bdae6ed 100644 (file)
@@ -11,6 +11,23 @@ strong {
        vertical-align: middle;
 }
 
+.x-grid-panel .x-panel-body {
+       overflow: auto !important;
+}
+
+.x-panel-tbar {
+    border-bottom: none;
+    padding: 0;
+}
+
+.x-form fieldset {
+        border: none;
+}
+
+.bold button {
+       font-weight: bold;
+}
+
 /* extension states */
 .state-alpha div {background-color:#d12438;color:#fff !important;font-weight:bold !important;}
 .state-beta div {background-color:#97b17e;color:#fff !important;font-weight:bold !important;}
@@ -23,6 +40,9 @@ strong {
 img.installExtension, img.removeExtension {
        cursor: pointer;
 }
+.extLangTitleWithIcon img {
+       vertical-align: bottom;
+}
 
 /* Repository Update Form */
 .em-repupdate {
@@ -44,9 +64,7 @@ img.installExtension, img.removeExtension {
        -khtml-user-select: text;
        -webkit-user-select: text;
 }
-#editarea-context_help::selection, #editarea-context_help::-moz-selection {
-       background: #ffb7b7 !important;
-}
+
 
 
 .x-btn-filebrowser { background-image:url(../icons/filebrowser.png) !important; }
@@ -57,6 +75,7 @@ img.installExtension, img.removeExtension {
 .x-btn-flag { background-image:url(../icons/flag.png) !important;}
 .x-btn-tools { background-image:url(../icons/tools.png) !important;}
 .x-btn-settings { background-image:url(../icons/settings.png) !important;}
+.x-btn-repupdate { background-image:url(../icons/repupdate.png) !important;}
 
 
 /*
@@ -99,6 +118,7 @@ img.installExtension, img.removeExtension {
 
 .em-info {
        margin: 10px;
+       line-height: 18px;
 }
 
 
@@ -111,14 +131,23 @@ img.installExtension, img.removeExtension {
        line-height: 14px;
 }
 
+#em-extlanguagegrid .x-grid3-row-selected {
+       background-color: #cfffda;
+}
+
 .em-extlist-extinfo label,
 .em-info label {
-       vertical-align: none;
+       vertical-align: top;
        display: inline-block;
        width: 100px;
        font-weight: bold;
 }
 
+a.email {
+       background: url(../icons/email.png) no-repeat;
+       padding-left: 20px;
+}
+
 #hbox-settings .x-box-inner {
        overflow-x: hidden;
        overflow-y: auto;
@@ -131,4 +160,13 @@ img.installExtension, img.removeExtension {
        color: #888;
        font-size: 12px;
        line-height: 14px;
+}
+
+.insecureExtension {
+       color: red;
+       font-weight: bold;
+}
+
+.paddingActionIcon img {
+       margin-right: 5px;
 }
\ No newline at end of file
diff --git a/typo3/sysext/em/res/icons/email.png b/typo3/sysext/em/res/icons/email.png
new file mode 100644 (file)
index 0000000..7348aed
Binary files /dev/null and b/typo3/sysext/em/res/icons/email.png differ
diff --git a/typo3/sysext/em/res/icons/repupdate.png b/typo3/sysext/em/res/icons/repupdate.png
new file mode 100644 (file)
index 0000000..61a8556
Binary files /dev/null and b/typo3/sysext/em/res/icons/repupdate.png differ
index b79a346..0c22da9 100644 (file)
@@ -42,20 +42,29 @@ Ext.onReady(function() {
                Ext.state.Manager.getProvider().initState(TYPO3.settings.EM.States);
        }
        Ext.QuickTips.init();
-
+       TYPO3.EM.ImportWindow = null;
 
                // fire app
        var EM = new TYPO3.EM.App.init();
-       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.header, TYPO3.lang.emLoaded, 2);
-
-       /*Ext.state.Manager.getProvider().logState();
-       var val = Ext.state.Manager.getProvider().get('mainTab', '');
-       console.log(val);*/
 });
 
 TYPO3.EM.App = {
+       categoryLabels : [
+                       TYPO3.lang.category_BE,
+                       TYPO3.lang.category_BE_modules,
+                       TYPO3.lang.category_FE,
+                       TYPO3.lang.category_FE_plugins,
+                       TYPO3.lang.category_miscellanous,
+                       TYPO3.lang.category_services,
+                       TYPO3.lang.category_templates,
+                       '',
+                       TYPO3.lang.category_documentation,
+                       TYPO3.lang.category_examples
+       ],
 
        init : function() {
+
+               TYPO3.settings.EM.selectedRepository = TYPO3.settings.EM.selectedRepository || 1;
                var appPanel = new Ext.TabPanel( {
                        renderTo : 'em-app',
                        id: 'em-main',
@@ -83,5 +92,9 @@ TYPO3.EM.App = {
                        ],
                        plugins: [new Ext.ux.plugins.FitToParent()]
                });
+       },
+
+       getCategoryLabel: function(index) {
+               return this.categoryLabels[parseInt(index, 10)];
        }
 };
index 893ac4e..58e4efc 100644 (file)
@@ -89,7 +89,7 @@ TYPO3.EM.RemoteFilters = new Ext.ux.grid.GridFilters({
                dataIndex: 'extkey'
                }, {
                type: 'string',
-               dataIndex: 'author'
+               dataIndex: 'authorname'
                }, {
                type: 'list',
                dataIndex: 'statevalue',
@@ -97,8 +97,18 @@ TYPO3.EM.RemoteFilters = new Ext.ux.grid.GridFilters({
                phpMode: true
                }, {
                type: 'list',
-               dataIndex: 'categoryvalue',
-               options: [[0, 'be'], [1, 'module'], [2, 'fe'], [3, 'plugin'], [4, 'misc'], [5, 'services'], [6, 'templates'], [8, 'doc'], [9, 'example']],
+               dataIndex: 'category',
+               options: [
+                       [0, TYPO3.lang.category_BE],
+                       [1, TYPO3.lang.category_BE_modules],
+                       [2, TYPO3.lang.category_FE],
+                       [3, TYPO3.lang.category_FE_plugins],
+                       [4, TYPO3.lang.category_miscellanous],
+                       [5, TYPO3.lang.category_services],
+                       [6, TYPO3.lang.category_templates],
+                       [8, TYPO3.lang.category_documentation],
+                       [9, TYPO3.lang.category_examples]
+               ],
                phpMode: true
                }, {
                type: 'boolean',
@@ -106,9 +116,19 @@ TYPO3.EM.RemoteFilters = new Ext.ux.grid.GridFilters({
        }]
 });
 
+TYPO3.EM.GridColumns.DummyColumn = {
+       header: '',
+       width: 20,
+       sortable: false,
+       hideable: false,
+       fixed: true,
+       groupable: false,
+       menuDisabled: true
+};
+
 TYPO3.EM.GridColumns.InstallExtension = {
        header: '',
-       width: 30,
+       width: 45,
        sortable: false,
        hideable: false,
        fixed: true,
@@ -130,103 +150,101 @@ TYPO3.EM.GridColumns.InstallExtension = {
                                var record = grid.store.getAt(rowIndex).data;
                                var action = record.installed ? TYPO3.lang.ext_details_remove_ext : TYPO3.lang.menu_install_extensions;
                                var link = TYPO3.settings.EM.scriptLink
-                                               + '&nodoc=1&view=installed_list&CMD[showExt]=' + record.extkey
+                                               + '&nodoc=1&view=info&CMD[silentMode]=1&CMD[standAlone]=1&CMD[showExt]=' + record.extkey
                                                + '&CMD[' + (record.installed ? 'remove' : 'load') + ']=1&CMD[clrCmd]=1&SET[singleDetails]=info';
 
-                               var w = new TYPO3.EM.InstallWindow({
+                               TYPO3.EM.ImportWindow = new TYPO3.EM.InstallWindow({
                                        title: action + ': ' + record.title + ' (' + record.extkey + ') version ' + record.version,
+                                       record: record,
+                                       installAction: 'install',
+                                       url: link,
                                        listeners: {
                                                close: function() {
                                                        grid.store.reload();
+                                                       TYPO3.EM.Tools.refreshMenu();
                                                }
                                        }
                                }).show(true, function(){
                                        Ext.getCmp('emInstallIframeWindow').setUrl(link);
                                });
                        }
+               },
+               {
+                       hidden: (TYPO3.settings.EM.inlineToWindow == 0),
+                       getClass: function(value, meta, record) {
+                               meta.css += ' paddingActionIcon';
+                               if (TYPO3.settings.EM.inlineToWindow == 1) {
+                                       return 't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-info';
+                               }
+                               return '';
+                       },
+                       handler: function(grid, rowIndex, colIndex) {
+                               grid.showExtInfoInWindow(rowIndex);
+                       }
                }
        ]
-}
+};
 
 TYPO3.EM.GridColumns.ImportExtension = {
        header: '',
-       width: 30,
+       width: 45,
        sortable: false,
        fixed: true,
        groupable: false,
-       hideable: false,
        menuDisabled: true,
        xtype: 'actioncolumn',
        items: [
                {
                        getClass: function(value, meta, record) {
-                               if (record.get('installed') == 0) {
-                                       this.items[0].tooltip = TYPO3.lang.menu_install_extensions;
-                                       return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-install';
+                               if (record.get('exists') == 1) {
+                                       if (record.get('versionislower')) {
+                                               this.items[0].tooltip = TYPO3.lang.menu_update_extensions;
+                                               return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-update';
+                                       } else {
+                                               return '';
+                                       }
                                } else {
-                                       this.items[0].tooltip = TYPO3.lang.ext_details_remove_ext;
-                                       return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-uninstall';
+                                       this.items[0].tooltip = TYPO3.lang.menu_import_extensions;
+                                       return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-import';
                                }
                        },
                        handler: function(grid, rowIndex, colIndex) {
                                var record = grid.store.getAt(rowIndex).data;
                                var action = record.installed ? TYPO3.lang.ext_details_remove_ext : TYPO3.lang.menu_install_extensions;
                                var link = TYPO3.settings.EM.scriptLink
-                                               + '&nodoc=1&view=import&ter_connect=1&CMD[importExt]=' + record.extkey
-                                               + '&CMD[extVersion]=' + record.version + ''
-                                               + '&CMD[loc]=L';
+                                               + '&nodoc=1&view=info&CMD[silentMode]=1&CMD[standAlone]=1&ter_connect=1&CMD[importExt]='
+                                               + record.extkey  + '&CMD[extVersion]=' + record.version + '&CMD[loc]=L'
+
 
-                               var w = new TYPO3.EM.ImportWindow({
+                               TYPO3.EM.ImportWindow = new TYPO3.EM.InstallWindow({
                                        title: action + ': ' + record.title + ' (' + record.extkey + ') version ' + record.version,
+                                       record: record,
+                                       installAction: 'import',
                                        listeners: {
                                                close: function() {
-                                                       grid.store.reload();
+                                                       TYPO3.EM.Tools.refreshMenu();
                                                }
                                        }
                                }).show(true, function(){
                                        Ext.getCmp('emInstallIframeWindow').setUrl(link);
                                });
                        }
-               }
-       ]
-}
-
-TYPO3.EM.GridColumns.ImportExtension = {
-       header: '',
-       width: 30,
-       sortable: false,
-       fixed: true,
-       groupable: false,
-       menuDisabled: true,
-       xtype: 'actioncolumn',
-       items: [
+               },
                {
                        getClass: function(value, meta, record) {
-                               if (record.get('installed') == 0) {
-                                       this.items[0].tooltip = TYPO3.lang.menu_install_extensions;
-                                       return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-install';
-                               } else {
-                                       this.items[0].tooltip = TYPO3.lang.ext_details_remove_ext;
-                                       return 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-import';
+                               meta.css += ' paddingActionIcon';
+                               if (TYPO3.settings.EM.inlineToWindow == 1) {
+                                       return 't3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-info';
                                }
+                               return '';
                        },
                        handler: function(grid, rowIndex, colIndex) {
-                               var record = grid.store.getAt(rowIndex).data;
-                               var action = record.installed ? TYPO3.lang.ext_details_remove_ext : TYPO3.lang.menu_install_extensions;
-                               //http://intro.local.com/typo3/mod.php?M=tools_em&ter_connect=1&ter_search=templavoila&CMD[importExt]=ics_templavoila_migration_tool&CMD[extVersion]=1.0.3&CMD[loc]=L
-                               var link = TYPO3.settings.EM.scriptLink
-                                               + '&nodoc=1&view=installed_list&ter_connect=1&CMD[importExt]=' + record.extkey  + '&CMD[extVersion]=' + record.version + '&CMD[loc]=L'
-
-
-                               var w = new TYPO3.EM.InstallWindow({
-                                       title: action + ': ' + record.title + ' (' + record.extkey + ') version ' + record.version
-                               }).show(true, function(){
-                                       Ext.getCmp('emInstallIframeWindow').setUrl(link);
-                               });
+                               grid.showExtInfoInWindow(rowIndex);
                        }
                }
        ]
-}
+};
+
 
 TYPO3.EM.GridColumns.ExtensionTitle = {
        header: TYPO3.lang.tab_mod_name,
@@ -236,15 +254,20 @@ TYPO3.EM.GridColumns.ExtensionTitle = {
        filterable: true,
        hideable: true,
        renderer:function(value, metaData, record, rowIndex, colIndex, store) {
+               var description = record.data.description;
                if (value == '') {
                        value = '[no title]';
                }
-               if (record.data.description) {
-                       metaData.attr = 'ext:qtip="' + record.data.description + '"';
+               if (record.data.reviewstate < 0) {
+                       metaData.css += ' insecureExtension';
+                       description += '<br><br><strong>' + TYPO3.lang.insecureExtension + '</strong>';
+               }
+               if (description) {
+                       metaData.attr = 'ext:qtip="' + description + '"';
                }
                return record.data.icon + ' ' + value + ' (v' + record.data.version + ')';
        }
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionKey = {
        header: TYPO3.lang.tab_mod_key,
@@ -253,7 +276,7 @@ TYPO3.EM.GridColumns.ExtensionKey = {
        filterable: true,
        hideable: true,
        dataIndex: 'extkey'
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionCategory = {
        header: TYPO3.lang.list_order_category,
@@ -263,19 +286,18 @@ TYPO3.EM.GridColumns.ExtensionCategory = {
        filterable: true,
        hideable: true,
        hidden: true
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionCategoryRemote = {
        header: TYPO3.lang.list_order_category,
        width: 70,
        sortable: true,
        hideable: true,
-       dataIndex: 'categoryvalue',
+       dataIndex: 'category',
        renderer: function(value, metaData, record, rowIndex, colIndex, store) {
-               var cats = ['be', 'module', 'fe', 'plugin', 'misc', 'services', 'templates', '', 'doc', 'example'];
-               return cats[value];
+               return TYPO3.EM.App.getCategoryLabel(value);
        }
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionAuthor = {
        header: TYPO3.lang.list_order_author,
@@ -285,15 +307,33 @@ TYPO3.EM.GridColumns.ExtensionAuthor = {
        hideable: true,
        dataIndex:'author',
        renderer: function(value, metaData, record, rowIndex, colIndex, store) {
-               metaData.attr='ext:qtip="'+value+'"';
+               metaData.attr = 'ext:qtip="' + value + '"';
                var t = Ext.util.Format.ellipsis(value, 20);
                if (record.data.author_email) {
-                       return '<a href="mailto:' + record.data.author_email + '">' + t + '</a>';
+                       return '<a class="email" href="mailto:' + record.data.author_email + '">' + t + '</a>';
+               } else {
+                       return t;
+               }
+       }
+};
+
+TYPO3.EM.GridColumns.ExtensionRemoteAuthor = {
+       header: TYPO3.lang.list_order_author,
+       width: 120,
+       sortable: true,
+       hidden: true,
+       hideable: true,
+       dataIndex:'authorname',
+       renderer: function(value, metaData, record, rowIndex, colIndex, store) {
+               metaData.attr = 'ext:qtip="' + value + '"';
+               var t = Ext.util.Format.ellipsis(value, 20);
+               if (record.data.authoremail) {
+                       return '<a class="email" href="mailto:' + record.data.authoremail + '">' + t + '</a>';
                } else {
                        return t;
                }
        }
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionType = {
        header: TYPO3.lang.list_order_type,
@@ -301,8 +341,16 @@ TYPO3.EM.GridColumns.ExtensionType = {
        sortable:true,
        dataIndex:'type',
        hideable: true,
-       hidden: true
-}
+       hidden: true,
+       renderer: function(value, metaData, record, rowIndex, colIndex, store) {
+               if (record.data.doubleInstallShort && record.data.doubleInstallShort.length > 1) {
+                       var temp = record.data.doubleInstall.split('/');
+                       value = '<strong>' + record.data.doubleInstall + '</strong>';
+                       metaData.attr = 'ext:qtip="' + String.format(TYPO3.lang.double_inclusion_js, temp[1], temp[0]) + '"';
+               }
+               return value;
+       }
+};
 
 TYPO3.EM.GridColumns.ExtensionState = {
        header: TYPO3.lang.list_order_state,
@@ -318,7 +366,7 @@ TYPO3.EM.GridColumns.ExtensionState = {
                return value;
        },
        filterable: true
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionStateValue = {
        header: TYPO3.lang.list_order_state,
@@ -334,7 +382,7 @@ TYPO3.EM.GridColumns.ExtensionStateValue = {
                return record.data.state;
        },
        filterable: true
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionDownloads = {
        header: TYPO3.lang.list_order_downloads,
@@ -342,7 +390,7 @@ TYPO3.EM.GridColumns.ExtensionDownloads = {
        sortable: true,
        hideable: true,
        dataIndex:'alldownloadcounter'
-}
+};
 
 TYPO3.EM.GridColumns.ExtensionVersion = {
        header: TYPO3.lang.extInfoArray_version,
@@ -350,7 +398,7 @@ TYPO3.EM.GridColumns.ExtensionVersion = {
        sortable: true,
        hideable: true,
        dataIndex:'version'
-}
+};
 
 
 ///////////////////////////////////////////////////////
@@ -487,20 +535,18 @@ TYPO3.EM.LanguagesActionPanel = {
        items: [{
                xtype: 'button',
                text: TYPO3.lang.translation_check_status_button,
-               id: 'lang-checkbutton',
-               disabled: true
+               id: 'lang-checkbutton'
        }, {
                xtype: 'button',
                text: TYPO3.lang.translation_update_button,
-               id: 'lang-updatebutton',
-               disabled: true
+               id: 'lang-updatebutton'
        }]
 };
 
 
 TYPO3.EM.InstallWindow = Ext.extend(Ext.Window, {
-       width: 800,
-       height: 600,
+       width: 500,
+       height: 400,
        closable: true,
        resizable: true,
        plain: true,
@@ -523,8 +569,8 @@ TYPO3.EM.InstallWindow = Ext.extend(Ext.Window, {
 });
 
 TYPO3.EM.ImportWindow = Ext.extend(Ext.Window, {
-       width: 800,
-       height: 600,
+       width: 500,
+       height: 400,
        closable: true,
        resizable: true,
        plain: true,
@@ -601,7 +647,7 @@ TYPO3.EM.TerUpload = Ext.extend(Ext.form.FormPanel, {
                                scope: this,
                                handler: function() {
                                        this.form.submit({
-                                               waitMsg : 'Sending data...',
+                                               waitMsg : TYPO3.lang.action_sending_data,
                                                success: function(form, action) {
                                                        TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.cmd_terupload, TYPO3.lang.msg_terupload, 5);
                                                        form.reset();
@@ -680,7 +726,7 @@ TYPO3.EM.ExtensionUploadWindow = Ext.extend(Ext.Window, {
                                                {
                                                        xtype: 'fileuploadfield',
                                                        id: 'form-file',
-                                                       emptyText: 'Select Extension (*.t3x)',
+                                                       emptyText: TYPO3.lang.upload_selectExtension,
                                                        fieldLabel: 'Extension',
                                                        name: 'extupload-path',
                                                        buttonText: '...',
@@ -695,13 +741,13 @@ TYPO3.EM.ExtensionUploadWindow = Ext.extend(Ext.Window, {
                                                TYPO3.EM.UploadLocationCombo,
                                                {
                                                        xtype: 'checkbox',
-                                                       fieldLabel: 'Overwrite any existing extension!',
+                                                       fieldLabel: TYPO3.lang.overwrite_ext,
                                                        name: 'uploadOverwrite',
                                                        labelWidth: 250
                                                },
                                                {
                                                        xtype: 'button',
-                                                       text: 'Upload extension from your computer',
+                                                       text: TYPO3.lang.upload_ext_from,
                                                        id: 'uploadSubmitButton',
                                                        width: 420,
                                                        scope: this,
@@ -709,22 +755,22 @@ TYPO3.EM.ExtensionUploadWindow = Ext.extend(Ext.Window, {
                                                                var form = this.getComponent('uploadForm').getForm();
                                                                if (form.isValid()) {
                                                                        form.submit({
-                                                                               waitMsg : 'Sending data...',
+                                                                               waitMsg : TYPO3.lang.action_sending_data,
                                                                                success: function(form, action) {
                                                                                        form.reset();
-                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, 'Extension Upload', 'Extension "' + action.result.extKey + '" was uploaded.', 5);
+                                                                                       TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.upload_ext, String.format(TYPO3.lang.msg_uploaded, action.result.extKey), 5);
                                                                                        TYPO3.EM.ExtensionUploadWindowInstance.hide();
                                                                                        TYPO3.EM.Tools.displayLocalExtension(action.result.extKey, true);
                                                                                },
-                                                                               failure: function(form, action) {console.log(action);
+                                                                               failure: function(form, action) {
                                                                                        if (action.failureType === Ext.form.Action.CONNECT_FAILURE) {
-                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Error',
-                                                                                                               'Status:' + action.response.status + ': ' +
+                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error,
+                                                                                                               TYPO3.lang.msg_status + ': ' + action.response.status + ': ' +
                                                                                                                                action.response.statusText, 15);
                                                                                        }
                                                                                        if (action.failureType === Ext.form.Action.SERVER_INVALID) {
                                                                                                // server responded with success = false
-                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Invalid', action.result.error, 5);
+                                                                                               TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_invalid, action.result.error, 5);
                                                                                        }
                                                                                }
                                                                        });
index f94aae8..940c3fa 100644 (file)
@@ -11,9 +11,6 @@
 Ext.ns('TYPO3.EM');
 
 TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
-       //border: false,
-       height: 400,
-
        recordData: null,
        isWindow: false,
 
@@ -30,13 +27,11 @@ TYPO3.EM.ExtFilelist = Ext.extend(Ext.Panel, {
 
 
                var fileTree = new Ext.tree.TreePanel ({
-                       //directFn: TYPO3.EM.ExtDirect.getExtFileTree,
                        itemId: 'extfiletree',
                        autoScroll: true,
-                       containerScroll: true,
+                       //containerScroll: true,
                        margins: '0 0 0 0',
                        cmargins: '0 0 0 0',
-                       //useArrows: true,
 
                        root: {
                                text: TYPO3.lang.ext_details_ext_files,
@@ -327,7 +322,6 @@ TYPO3.EM.CodeMirrorConfig = {
 
 TYPO3.EM.CodeMirror = Ext.extend(Ext.Panel, {
        layout: 'fit',
-       //bodyStyle: 'background:green;',
        sourceCode: '',
        stylesheet: null,
        initComponent: function() {
@@ -443,7 +437,6 @@ TYPO3.EM.CodeMirror = Ext.extend(Ext.Panel, {
                        path: TYPO3.EM.CodeMirrorConfig.jsPath,
                        autoMatchParens: true,
                        initCallback: function(editor) {
-                               editor.win.document.body.lastChild.scrollIntoView();
                                try {
                                        var iLineNmbr = ((Ext.state.Manager.get("edcmr_" + me.itemId + '_lnmbr') !== undefined) ? Ext.state.Manager.get("edcmr_" + me.itemId + '_lnmbr') : 1);
                                        editor.jumpToLine(iLineNmbr);
index eedf67d..cc4440f 100644 (file)
@@ -23,6 +23,55 @@ Ext.override(Ext.grid.CheckboxSelectionModel, {
        }
 });
 
+Ext.grid.DynamicColumnModelForLanguages = function(store){
+       var cols = [];
+       var recordType = store.recordType;
+       var fields = recordType.prototype.fields;
+
+       for (var i = 0; i < fields.keys.length; i++) {
+               var fieldName = fields.keys[i];
+               var field = recordType.getField(fieldName);
+
+               if (i === 0) {
+                       cols[i] = {
+                               header: 'Extension',
+                               dataIndex: field.name,
+                               width: 200,
+                               fixed: true,
+                               sortable: false,
+                               hidable: false,
+                               menuDisabled: true,
+                               renderer: function(value, metaData, record, rowIndex, colIndex, store){
+                                       metaData.css += ' extLangTitleWithIcon';
+                                       return record.data.icon + ' <strong>' + value + '</strong>';
+                               }
+                       };
+               } else if (i === 1 || i === 2 || i === 3) {
+                       //bypass
+               } else {
+                       cols[i - 3] = {
+                               header: field.name,
+                               dataIndex: field.name,
+                               hidden: true,
+                               fixed: true,
+                               sortable: false,
+                               hidable: false,
+                               menuDisabled: true,
+                               renderer: function(value, metaData, record, rowIndex, colIndex, store) {
+                                       if (value == TYPO3.lang.translation_checking) {
+                                               return '<span class="x-mask-loading">&nbsp;</span>' + value;
+                                       }
+                                       return '<span class="x-mask-loading">&nbsp;</span>' + value;;
+                               }
+                       };
+
+               }
+       }
+       Ext.grid.DynamicColumnModelForLanguages.superclass.constructor.call(this, cols);
+};
+Ext.extend(Ext.grid.DynamicColumnModelForLanguages, Ext.grid.ColumnModel, {defaultWidth: 170});
+
+
 TYPO3.EM.LanguagesSelectionModel  = new Ext.grid.CheckboxSelectionModel({
        singleSelect: false,
        header: '',
@@ -85,7 +134,6 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                        directFn        : TYPO3.EM.ExtDirect.getInstalledExtkeys,
                        root            : 'data',
                        idProperty  : 'extkey',
-                       //fields : [{name : 'extkey'},{name : 'icon'},{name : 'lang'},{name: 'Danish'}, {name: 'German'}, {name: 'Norwegian'}, {name: 'Italian'}, {name: 'French'}, {name: 'Spanish'}, {name: 'Dutch'}, {name: 'Czech'}, {name: 'Polish'}, {name: 'Slovenian'}, {name: 'Finnish'}, {name: 'Turkish'}, {name: 'Swedish'}, {name: 'Portuguese'}, {name: 'Russian'}, {name: 'Romanian'}, {name: 'Chinese (Simpl)'}, {name: 'Slovak'}, {name: 'Lithuanian'}, {name: 'Icelandic'}, {name: 'Croatian'}, {name: 'Hungarian'}, {name: 'Greenlandic'}, {name: 'Thai'}, {name: 'Greek'}, {name: 'Chinese (Trad)'}, {name: 'Basque'}, {name: 'Bulgarian'}, {name: 'Brazilian Portuguese'}, {name: 'Estonian'}, {name: 'Arabic'}, {name: 'Hebrew'}, {name: 'Ukrainian'}, {name: 'Latvian'}, {name: 'Japanese'}, {name: 'Vietnamese'}, {name: 'Catalan'}, {name: 'Bosnian'}, {name: 'Korean'}, {name: 'Esperanto'}, {name: 'Bahasa Malaysia'}, {name: 'Hindi'}, {name: 'Faroese'}, {name: 'Persian'}, {name: 'Serbian'}, {name: 'Albanian'}, {name: 'Georgian'}, {name: 'Galician'}],
                        fields : [{name : 'extkey'},{name : 'icon'},{name: 'stype'}],
                        listeners : {
                                'load': function(store, records, options){
@@ -101,7 +149,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
 
                });
 
-               var langStore = new Ext.data.DirectStore({
+               this.langStore = new Ext.data.DirectStore({
                        storeId     : 'em-language-store',
                        autoLoad        : false,
                        directFn        : TYPO3.EM.ExtDirect.getLanguages,
@@ -116,7 +164,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                        ],
                        listeners : {
                                'load': function(store, records){
-                                       // get selected languages and update selection and extGrid
+                                               // get selected languages and update selection and extGrid
                                        TYPO3.settings.LangLoaded = false;
                                        var a = [];
                                        for (var i=0; i<records.length; i++) {
@@ -158,7 +206,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                                xtype: 'grid',
                                                id: 'em-languagegrid',
                                                stripeRows: true,
-                                               store: langStore,
+                                               store: this.langStore,
                                                cm: TYPO3.EM.LanguagesColumnModel,
                                                sm: TYPO3.EM.LanguagesSelectionModel,
                                                enableColumnMove: false,
@@ -223,6 +271,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                }).defer(5000, this);
                                if (!this.interruptProcess) {
                                        TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.translation_checking_extension, TYPO3.lang.translation_check_done, 3);
+                                       Ext.getCmp('em-extlanguagegrid').getSelectionModel().clearSelections();
                                }
                        });
                } else {
@@ -231,6 +280,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                TYPO3.EM.LanguagesProgressBar.updateText(this.interruptProcess ? TYPO3.lang.msg_interrupted : TYPO3.lang.msg_finished);
                                if (!this.interruptProcess) {
                                        TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.translation_update_extension, TYPO3.lang.translation_update_done, 3);
+                                       Ext.getCmp('em-extlanguagegrid').getSelectionModel().clearSelections();
                                }
                                pp.hide();
                                bp.show();
@@ -252,15 +302,10 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
        saveSelection: function() {
                if (this.languageLoaded === true) {
                        this.getSelectedLanguages();
-                       if (this.selectedLanguages.length > 0 ) {
-                               (function() {
-                                       this.restoreExtLanguageGrid();
-                               }).defer(100, this);
-                       }
-
                        TYPO3.EM.ExtDirect.saveLanguageSelection(this.selectedLanguages, function(response) {
-                               TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.translation_selection_saved, response, 3);
-                       });
+                               record = this.langStore.getById(response.diff);
+                               this.addRemoveExtLanguageGridColumn(record.data);
+                       },this);
                }
        },
 
@@ -270,7 +315,8 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                this.cb = callback;
 
 
-               // fill arrays
+                       // fill arrays
+               this.extkeyArray = [];
                for (var i = 0; i < this.extCount; i++) {
                        this.extkeyArray.push(store.data.items[i].data.extkey);
                }
@@ -294,11 +340,9 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
 
                if (res) {
                        // update fetched record
-                       var fetchedRecord = grid.store.getAt(row-1);
-                       var key = '';
+                       var fetchedRecord = grid.store.getAt(row - 1);
                        for (i = 0; i < this.selectedLanguages.length; i++) {
-                               key = this.selectedLanguages[i];
-                               fetchedRecord.set(key, res[0][key]);
+                               fetchedRecord.set(this.selectedLanguages[i], res[this.selectedLanguages[i]]);
                }
                fetchedRecord.commit();
                }
@@ -311,16 +355,17 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                        grid.getView().focusRow(row);
                        grid.getSelectionModel().selectRow(row);
                        for (i = 0; i < this.selectedLanguages.length; i++) {
-                               record.set(this.selectedLanguages[i], TYPO3.lang.translation_checking);
-               }
-               record.commit();
-
+                               record.set(this.selectedLanguages[i], '<span class="loading-indicator"></span>' + TYPO3.lang.translation_checking);
+                       }
+                       record.commit();
+                       var prefix = TYPO3.lang.msg_checking;
+                       if (this.fetchType === 1) {
+                               prefix = TYPO3.lang.msg_updating;
+                       }
                        // update Progressbar
                        Ext.getCmp('langpb').updateProgress(
-                               (row+1)/this.extCount,
-                               (this.fetchType === 0 ?
-                                               TYPO3.lang.msg_checking + ': ' :
-                                               TYPO3.lang.msg_updating + ': ') +
+                               (row + 1) / this.extCount,
+                               prefix+ ': ' +
                                        String.format(TYPO3.lang.translation_fetch_extension, ext, (row+1), this.extCount));
 
                        // fetch language request
@@ -331,6 +376,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                                // finished
                        Ext.getCmp('lang-checkbutton').enable();
                        Ext.getCmp('lang-updatebutton').enable();
+                       Ext.getCmp('em-extlanguagegrid').getSelectionModel().clearSelections();
                        // call callback
                        this.cb();
                }
@@ -345,11 +391,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                var selLanguages = Ext.getCmp('em-languagegrid').getSelectionModel().getSelections();
                var columns = extLangGrid.getColumnModel();
                var count = columns.getColumnCount();
-               if (count > 1) {
-                       for(i=1; i<count; i++) {
-                               columns.removeColumn(1);
-                       }
-               }
+
                if (selLanguages.length > 0 ) {
                        for (i=0; i < selLanguages.length; i++) {
                                this.addRemoveExtLanguageGridColumn(selLanguages[i].data);
@@ -376,28 +418,7 @@ TYPO3.EM.Languages = Ext.extend(Ext.FormPanel, {
                }
        },
 
-       langColumnRenderer: function(value) {
-               if (value === 'update') {
-                       return '<div style="background:#ff0;">' + TYPO3.lang.translation_status_update + '</div>';
-               } else if(value === 'N/A') {
-                       return '<div style="background:red;">' + TYPO3.lang.translation_n_a + '</div>';
-               } else if(value === 'ok') {
-                       return '<div style="background:#69a550;">' + TYPO3.lang.translation_status_ok + '</div>';
-               } else if(value === 'new') {
-                       return '<div style="background:#ff0;">' + TYPO3.lang.translation_status_new + '</div>';
-               } else {
-                       return '<i>' + value + '</i>';
-               }
-       },
-
-       onRender:function() {
-
-               // call parent
-               TYPO3.EM.Languages.superclass.onRender.apply(this, arguments);
-
-       },
-
-       afterRender:function() {
+       afterRender: function() {
                        // call parent
                TYPO3.EM.Languages.superclass.afterRender.apply(this, arguments);
                        //The following are all of the possible keys that can be implemented: enter, left, right, up, down, tab, esc, pageUp, pageDown, del, home, end
index eb82617..4465575 100644 (file)
@@ -61,19 +61,27 @@ TYPO3.EM.Layouts = {
                        '<div class="em-info">',
                                '<p><label>' + TYPO3.lang.extInfoArray_title + ':</label>{title}</p>',
                                '<p><label>' + TYPO3.lang.listRowHeader_ext_key + '</label>{extkey}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_category + ':</label>{category}</p>',
+                               '<p><label>' + TYPO3.lang.extInfoArray_category + ':</label>{[TYPO3.EM.App.getCategoryLabel(values.category)]}</p>',
                                '<p><label>' + TYPO3.lang.extInfoArray_version + ':</label>{version}</p>',
                                '<p><label>' + TYPO3.lang.extInfoArray_downloads + ':</label>{alldownloadcounter}</p>',
                                '<p><label>' + TYPO3.lang.extInfoArray_state + ':</label>{state}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_author + ':</label>{authorname}</p>',
+                               '<p><label>' + TYPO3.lang.extInfoArray_author + ':</label>{[this.getAuthor(values)]}</p>',
                                '<p><label>' + TYPO3.lang.extInfoArray_versions + ':</label>{versions}</p>',
-                               '<p><label>' + TYPO3.lang.extInfoArray_description + ':</label>{description}</p>',
+                               '<p><label>' + TYPO3.lang.extInfoArray_description + ':</label>{description:this.getDescription}</p>',
                        '</div>',
                {
-                       getCls: function(value) {
-                               return '';
+                       getDescription: function(value) {
+                               return value ? value : '';
+                       },
+
+                       getAuthor: function(values) {
+                               if (values.author && values.author_email) {
+                                       return '<a class="email" href="mailto:' + values.author_email + '">' + values.author + '</a>';
+                               }
+                               return values.authorname;
                        }
-               });
+               }
+               );
        },
 
        getExtensionRules: function() {
@@ -92,20 +100,19 @@ TYPO3.EM.Layouts = {
        repositoryInfo: function() {
                return new Ext.XTemplate(
                        '<span class="typo3-message message-notice" style="padding-right: 50px;">',
-                       'last update: {updated}&nbsp;&nbsp;',
-                       'Extensions in repository: {count}</span>'
+                       '{updated:this.updatedFormat}&nbsp;&nbsp;',
+                       TYPO3.lang.extensions_repository_short + ' {count}</span>',
+                       {
+                               updatedFormat: function(value) {
+                                       return TYPO3.lang.ext_list_last_updated.replace('%s', value).replace('(', '').replace(')', '');
+                               }
+                       }
                );
        },
 
-       showExtInfo: function (panel, data) {
-               panel.update('');
-               var t = this.getInfoTemplate().compile();
+       showExtInfo: function (data) {
                data.shyword = data.shy ? 'Yes' : 'No';
-               t.append(panel.body, data);
-       },
-
-       showExtUpdate: function(panel, data) {
-
+               return this.getInfoTemplate().applyTemplate(data);
        }
 };
 
index 4677a58..5d1b281 100644 (file)
 Ext.ns('TYPO3.EM', 'TYPO3.EM.GridColumns');
 
 TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
-       border:false,
+       border: false,
+       plain: true,
        stripeRows: true,
        stateful: true,
        stateId: 'LocalList',
        stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange'],
+       bodyStyle: 'padding: 10px;',
 
        rowExpander: new Ext.ux.grid.RowPanelExpander({
                hideable: false,
+               id: 'LocalListExpander',
                createExpandingRowPanelItems: function(record, rowIndex){
                        var panelItems = [
                                new Ext.TabPanel({
                                        plain: true,
                                        activeTab: 0,
                                        defaults: {
-                                               bodyStyle: 'background:#fff;padding:10px;',
-                                               boxMinHeight: 150
+                                               bodyStyle: 'background:#fff;padding:10px;overflow: auto;',
+                                               height: 250
                                        },
                                        record: record,
                                        items:[
                                                {
                                                        title: TYPO3.lang.msg_info,
-                                                       autoHeight: true,
-                                                       listeners: {
-                                                               activate: function(panel) {
-                                                                       TYPO3.EM.Layouts.showExtInfo(panel, panel.ownerCt.record.data);
-                                                               }
-                                                       }
+                                                       html: TYPO3.EM.Layouts.showExtInfo(record.data)
                                                },
                                                {
                                                        title: TYPO3.lang.msg_update,
-                                                       html: '<div class="loading-indicator">Loading...</div>',
+                                                       html: '<div class="loading-indicator">' + TYPO3.lang.action_loading + '</div>',
                                                        disabled: record.data.installed === 0,
                                                        listeners: {
                                                                activate: function(panel) {
@@ -77,8 +75,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        title: TYPO3.lang.msg_configuration,
                                                        xtype: 'form',
                                                        disabled: record.data.installed === 0,
-                                                       autoHeight: true,
-                                                       html: '<div class="loading-indicator">Loading...</div>',
+                                                       html: '<div class="loading-indicator">' + TYPO3.lang.action_loading + '</div>',
                                                        listeners: {
                                                                activate: function(panel) {
                                                                        TYPO3.EM.ExtDirect.getExtensionConfiguration(record.data.extkey, function(response) {
@@ -88,7 +85,6 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        },
                                                        scope: this,
                                                        readConfigForm: function() {
-                                                               var key = record.data.extkey;
                                                                var button = Ext.select('input[type="submit"]');
                                                                if (button) {
                                                                        button.on('click', function() {
@@ -100,7 +96,11 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
 
                                                                        });
                                                                                this.form.submit({
-                                                                                       waitMsg : 'Saving Settings...',
+                                                                                       waitMsg : TYPO3.lang.action_saving_settings,
+                                                                                       params: {
+                                                                                               extkey: record.data.extkey,
+                                                                                               exttype: record.data.typeShort
+                                                                                       },
                                                                                        success: function(form, action) {
                                                                                                TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.lang.msg_configuration, TYPO3.lang.configurationSaved, 5);
                                                                                        },
@@ -124,17 +124,15 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                        title: TYPO3.lang.msg_files,
                                                        xtype: 'extfilelist',
                                                        recordData: record.data
-
                                                },
                                                {
                                                        xtype: 'terupload',
-                                                       title: TYPO3.lang.msg_terupload,
+                                                       title: TYPO3.lang.cmd_terupload,
                                                        recordData: record.data,
                                                        disabled: !TYPO3.settings.EM.hasCredentials
                                                },
                                                {
                                                        title: TYPO3.lang.msg_developerinformation,
-                                                       autoHeight: true,
                                                        html: '<div class="loading-indicator">' + TYPO3.lang.action_loading+ '</div>',
                                                        listeners: {
                                                                activate: function(panel) {
@@ -146,7 +144,26 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                                },
                                                {
                                                        title: TYPO3.lang.details_backup_delete,
-                                                       disabled: true //record.data.installed === 0
+                                                       //disabled: record.data.installed === 0,
+                                                       html: '<div class="loading-indicator">' + TYPO3.lang.action_loading + '</div>',
+                                                       listeners: {
+                                                               activate: function(panel) {
+                                                                       TYPO3.EM.ExtDirect.getExtensionBackupDelete(record.data.extkey, function(response) {
+                                                                               panel.update(response, true, this.readBackupDeleteLinks.createDelegate(this));
+                                                                       }, this);
+                                                               }
+                                                       },
+                                                       scope: this,
+                                                       readBackupDeleteLinks: function() {
+                                                               var emconflink = Ext.select('a.t3-link emconfLink');
+                                                               if (emconflink) {
+                                                                               //todo catch the link and do it the ext way
+                                                                       emconflink.on('click', function() {
+                                                                               return false;
+                                                                       });
+                                                               }
+
+                                                       }
                                                }
                                        ]
                                })
@@ -156,12 +173,12 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
        }),
 
        initComponent:function() {
-               var localstore = new Ext.data.GroupingStore({
+               this.localstore = new Ext.data.GroupingStore({
                        storeId: 'localstore',
                        proxy: new Ext.data.DirectProxy({
                                directFn: TYPO3.EM.ExtDirect.getExtensionList
                        }),
-
+                       autoLoad: false,
                        reader: new Ext.data.JsonReader({
                                idProperty: 'extkey',
                                root: 'data',
@@ -184,7 +201,11 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                        {name:'download'},
                                        {name:'doc'},
                                        {name:'typeShort'},
-                                       {name:'nodePath'}
+                                       {name:'nodePath'},
+                                       {name:'reviewstate'},
+                                       {name:'required'},
+                                       {name:'doubleInstall'},
+                                       {name:'doubleInstallShort'}
                                ]
                        }),
 
@@ -197,7 +218,7 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                        showAction: false,
                        listeners: {
                                beforeload: function() {
-                                       this.reloadButton.disable();
+
                                },
                                datachanged: function(store){
                                        Ext.getCmp('displayExtensionLabel').setText(TYPO3.lang.extensions + ' ' + store.data.length);
@@ -209,12 +230,18 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                        });
                                        if (hasFilters) {
                                                this.doClearFilters.show();
+                                               this.doClearFiltersSeperator.show();
                                        } else {
                                                this.doClearFilters.hide();
+                                               this.doClearFiltersSeperator.hide();
+                                       }
+                                       if (!TYPO3.settings.EM.hide_obsolete && !TYPO3.settings.EM.hide_shy && !TYPO3.settings.EM.display_installed) {
+                                               this.filterMenuButton.removeClass('bold');
+                                       } else {
+                                               this.filterMenuButton.addClass('bold');
                                        }
                                },
                                load: function(store) {
-                                       this.reloadButton.enable();
                                        if (store.showAction) {
                                                this.showExtension.defer(500, this);
                                        }
@@ -230,19 +257,19 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                        if (filtertext) {
                                                        //filter by search string
                                                var re = new RegExp(Ext.escapeRe(filtertext));
-                                               var isMatched = record.data.extkey.match(re) || record.data.title.match(re);
+                                               var isMatched = record.data.extkey.match(re) || record.data.title.match(re) ||  record.data.description.match(re);
                                                if (!isMatched) {
                                                        return false;
                                                }
                                        }
                                }
-                               if (TYPO3.settings.EM.display_obsolete === '0' && record.data.state === 'obsolete'){
+                               if (TYPO3.settings.EM.hide_obsolete == 1 && record.data.state === 'obsolete'){
                                        return false;
                                }
-                               if (TYPO3.settings.EM.display_shy === '0' && record.data.shy == 1){
+                               if (TYPO3.settings.EM.hide_shy == 1 && record.data.shy == 1){
                                        return false;
                                }
-                               if (TYPO3.settings.EM.display_installed === '1' && record.data.installed == 0) {
+                               if (TYPO3.settings.EM.display_installed == 1 && record.data.installed == 0) {
                                        return false;
                                }
 
@@ -251,14 +278,13 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                });
 
                var searchField = new Ext.ux.form.FilterField({
-                       store: localstore,
+                       store: this.localstore,
                        id: 'localSearchField',
                        width: 200
                });
 
-               var cm = new Ext.grid.ColumnModel({
-                       columns: [
-                               this.rowExpander,
+               var cols = [
+                               TYPO3.settings.EM.inlineToWindow == 1 ? TYPO3.EM.GridColumns.DummyColumn : this.rowExpander,
                                TYPO3.EM.GridColumns.InstallExtension,
                                TYPO3.EM.GridColumns.ExtensionTitle,
                                TYPO3.EM.GridColumns.ExtensionKey,
@@ -266,23 +292,24 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                TYPO3.EM.GridColumns.ExtensionAuthor,
                                TYPO3.EM.GridColumns.ExtensionType,
                                TYPO3.EM.GridColumns.ExtensionState
-                       ],
+               ];
+
+               var cm = new Ext.grid.ColumnModel({
+                       columns: cols,
                        defaults: {
                                sortable: true
                        }
 
                });
 
-
-
                Ext.apply(this, {
                        itemId: 'em-localLocalExtensionlist',
                        title: TYPO3.lang.localExtensionList,
                        loadMask: {msg: TYPO3.lang.action_loading_extlist},
                        layout: 'fit',
-                       store: localstore,
+                       store: this.localstore,
                        cm: cm,
-                       plugins: [this.rowExpander, TYPO3.EM.Filters],
+                       plugins: TYPO3.settings.EM.inlineToWindow == 1 ? [TYPO3.EM.Filters] : [this.rowExpander, TYPO3.EM.Filters],
                        view : new Ext.grid.GroupingView({
                                forceFit : true,
                                groupTextTpl : '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "' + TYPO3.lang.msg_items + '" : "' + TYPO3.lang.msg_item + '"]})',
@@ -294,19 +321,52 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                        }),
 
                        tbar: [
+                               ' ',
                                {
-                                       xtype: 'tbtext',
-                                       text: TYPO3.lang.cmd_filter
+                                       text: TYPO3.lang.cmd_filter,
+                                       tooltip: TYPO3.lang.help_localFilter,
+                                       scale: 'small',
+                                       ref: '../filterMenuButton',
+                                       iconAlign: 'right',
+                                       menu : {
+                                               items: [
+                                                       {
+                                                               checked: TYPO3.settings.EM.display_installed ? true : false,
+                                                               text: TYPO3.lang.display_installedOnly,
+                                                               handler: function(item, event) {
+                                                                       TYPO3.settings.EM.display_installed =  item.checked ? 0 : 1;
+                                                                       TYPO3.EM.ExtDirect.saveSetting('display_installed', TYPO3.settings.EM.display_installed);
+                                                                       this.store.reload();
+                                                               },
+                                                               scope: this
+                                                       }, {
+                                                               checked: TYPO3.settings.EM.hide_shy ? true : false,
+                                                               text: TYPO3.lang.hide_shy,
+                                                               handler: function(item, event) {
+                                                                       TYPO3.settings.EM.hide_shy =  item.checked ? 0 : 1;
+                                                                               TYPO3.EM.ExtDirect.saveSetting('hide_shy', TYPO3.settings.EM.hide_shy);
+                                                                               this.store.reload();
+                                                               },
+                                                               scope: this
+                                                       }, {
+                                                               checked: TYPO3.settings.EM.hide_obsolete ? true : false,
+                                                               text: TYPO3.lang.hide_obsolete,
+                                                               handler: function(item, event) {
+                                                                       TYPO3.settings.EM.hide_obsolete = item. checked ? 0 : 1;
+                                                                       TYPO3.EM.ExtDirect.saveSetting('hide_obsolete', TYPO3.settings.EM.hide_obsolete);
+                                                                       this.store.reload();
+                                                               } ,
+                                                               scope: this
+                                                       }
+                                               ]
+                                       }
                                },
                                searchField,
                                {
-                                       iconCls: 'x-tbar-loading',
-                                       ref: '../reloadButton',
-                                       handler: function() {
-                                               this.store.reload();
-                                       },
-                                       scope: this
-                               }, '-', {
+                                       xtype: 'tbseparator',
+                                       ref: '../doClearFiltersSeperator',
+                                       hidden: true
+                               }, {
                                        text: TYPO3.lang.cmd_ClearAllFilters,
                                        ref: '../doClearFilters',
                                        handler: function() {
@@ -315,90 +375,28 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
                                        scope: this,
                                        hidden: true
                                },
-                               '->',
+                               '-',
                                {
-                                       id: 'installedFlag',
-                                       xtype: 'checkbox',
-                                       checked: TYPO3.settings.EM.display_installed === '1' ? true : false,
-                                       boxLabel: TYPO3.lang.display_installedOnly + '&nbsp;',
-                                       listeners: {
-                                               check: function(checkbox, checked) {
-                                                       TYPO3.settings.EM.display_installed =  checked ? '1' : '0';
-                                                       TYPO3.EM.ExtDirect.saveSetting('display_installed', TYPO3.settings.EM.display_installed);
-                                                       localstore.filterBy(localstore.validateRecord, this);
-                                               },
-                                               scope: this
-                                       }
-                               }, {
-                                       id: 'shyFlag',
-                                       xtype: 'checkbox',
-                                       checked: TYPO3.settings.EM.display_shy === '1' ? true : false,
-                                       boxLabel: TYPO3.lang.display_shy + '&nbsp;',
-                                       listeners: {
-                                               check: function(checkbox, checked) {
-                                                       TYPO3.settings.EM.display_shy =  checked ? '1' : '0';
-                                                       TYPO3.EM.ExtDirect.saveSetting('display_shy', TYPO3.settings.EM.display_shy);
-                                                       localstore.filterBy(localstore.validateRecord, this);
-                                               },
-                                               scope: this
-                                       }
-                               },{
-                                       id: 'obsoleteFlag',
-                                       xtype: 'checkbox',
-                                       checked: TYPO3.settings.EM.display_obsolete === '1' ? true : false,
-                                       boxLabel: TYPO3.lang.display_obsolete + '&nbsp;',
-                                       listeners: {
-                                               check: function(checkbox, checked) {
-                                                       TYPO3.settings.EM.display_obsolete =  checked ? '1' : '0';
-                                                       TYPO3.EM.ExtDirect.saveSetting('display_obsolete', TYPO3.settings.EM.display_obsolete);
-                                                       localstore.filterBy(localstore.validateRecord, this);
-                                               } ,
-                                               scope: this
-                                       }
-                               }
-                       ],
-                       bbar:[
+                                       iconCls: 't3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-upload',
+                                       tooltip: TYPO3.lang.upload_ext_directly,
+                                       ref: '../uploadButton',
+                                       handler: function() {
+                                               TYPO3.EM.Tools.uploadExtension();
+                                       },
+                                       scope: this
+                               },
+                               '->',
                                {
                                        xtype: 'tbtext',
                                        text: TYPO3.lang.action_loading_extlist,
                                        id: 'displayExtensionLabel',
                                        style: {fontWeight: 'bold'}
                                },
-                               '->',
-                               {
-                                       text: TYPO3.lang.repositoryUploadForm_upload,
-                                       handler : function(){
-                                               TYPO3.EM.Tools.uploadExtension();
-                                       }
-                               }, ' ', {
-                                       text: TYPO3.lang.cmd_ClearGrouping,
-                                       handler : function(){
-                                               localstore.clearGrouping();
-                                       }
-                               }
+                               ' '
                        ]
                });
 
                TYPO3.EM.LocalList.superclass.initComponent.apply(this, arguments);
-
-               /* get install / uninstall clicks */
-               this.on('cellclick', function(grid, rowIndex, columnIndex, event) {
-                       var record = grid.getStore().getAt(rowIndex);  // Get the Record
-
-                       if (columnIndex === 1) { // column with install / remove images
-                               if (event.getTarget('.installExtension', 1)) {
-                                       // install extension
-                               }
-                               if (event.getTarget('.removeExtension', 1)) {
-                                       // remove extension
-                               }
-                       }
-               }, this);
-
-               /*this.on('staterestore', function() {
-                       this.store.filterBy(this.store.storeFilter, this);
-               }, this);   */
-               localstore.load();
        },
 
 
@@ -414,13 +412,36 @@ TYPO3.EM.LocalList = Ext.extend(Ext.grid.GridPanel, {
 
        onRender: function() {
                TYPO3.EM.LocalList.superclass.onRender.apply(this, arguments);
+               if (this.localstore.getCount() == 0) {
+                       this.localstore.load();
+               }
+
+               this.on('rowdblclick',function(grid, rowIndex, event) {
+                       if (TYPO3.settings.EM.inlineToWindow) {
+                               this.showExtInfoInWindow(rowIndex);
+                       }
+               });
+
        },
 
        afterRender: function() {
                TYPO3.EM.LocalList.superclass.afterRender.apply(this, arguments);
-       }
-
+       },
 
+       showExtInfoInWindow: function(index) {
+               var record = this.store.getAt(index);
+               var tabs = this.rowExpander.createExpandingRowPanelItems(record,index);
+               Ext.apply(tabs, {
+                       height: 'auto'
+               });
+               var w = new Ext.Window({
+                       title: TYPO3.EM.Tools.renderExtensionTitle(record),
+                       width: 700,
+                       height: 400,
+                       layout: 'fit',
+                       items : tabs
+               }).show();
+       }
 
 });
 
index 9974ffe..cdd88e5 100644 (file)
@@ -37,9 +37,12 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
        stripeRows: true,
        stateful: true,
        stateId: 'RepositoryList',
-       stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange', 'expand', 'collapse'],
+       stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange'],
+       bodyStyle: 'padding: 10px;',
+       showInstalledOnly: false,
 
        expander: new Ext.ux.grid.RowPanelExpander({
+               id: 'RepositoryListExpander',
                createExpandingRowPanelItems: function(record, rowIndex){
                        var panelItems = [
                                new Ext.TabPanel({
@@ -65,25 +68,10 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                }
        }),
 
-       listeners: { /*
-               beforestaterestore: function(grid, state) {
-                       console.log('restore:', state);
-                       return true;
-               },
-               statesave: function(grid, state) {
-                       console.log('save:', state);
-               },
-               beforestatesave: function(grid, state) {
-                       console.log('beforesave:', state);
-                       return true;
-               }  */
-       },
-
        initComponent:function() {
                this.repositoryListStore = new Ext.data.DirectStore({
                        storeId: 'repositoryliststore',
                        directFn: TYPO3.EM.ExtDirect.getRemoteExtensionList,
-                       //paramsAsHash: false,
                        idProperty: 'extkey',
                        root: 'data',
                        totalProperty: 'length',
@@ -91,7 +79,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                {name:'install'},
                                {name:'title'},
                                {name:'extkey'},
-                               {name:'categoryvalue'},
+                               {name:'category', type: 'int'},
                                {name:'version'},
                                {name:'alldownloadcounter', type: 'int'},
                                {name:'statevalue'},
@@ -99,9 +87,12 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                {name:'icon'},
                                {name:'description'},
                                {name:'lastuploaddate'},
-                               {name:'author', mapping: 'authorname'},
-                               {name:'author_email', mapping: 'authoremail'},
-                               {name:'versions', type: 'int'}
+                               {name:'authorname'},
+                               {name:'authoremail'},
+                               {name:'versions', type: 'int'},
+                               {name:'installed', type: 'int'},
+                               {name:'versionislower', type: 'bool'},
+                               {name:'exists', type: 'int'}
                        ],
                        paramNames: {
                                start : 'start',
@@ -125,6 +116,13 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                        listeners: {
                                beforeload: function(store, records){
                                        store.setBaseParam('rep', Ext.getCmp('repCombo').getValue());
+                                       store.setBaseParam('installedOnly', this.showInstalledOnly);
+                                       if (!this.showInstalledOnly) {
+                                               this.filterMenuButton.removeClass('bold');
+                                       } else {
+                                               this.filterMenuButton.addClass('bold');
+                                       }
+
                                },
                                load: function(store, records){
                                        var hasFilters = false;
@@ -162,12 +160,12 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
 
                var cm = new Ext.grid.ColumnModel({
                        columns: [
-                               this.expander,
+                               TYPO3.settings.EM.inlineToWindow == 1 ? TYPO3.EM.GridColumns.DummyColumn : this.expander,
                                TYPO3.EM.GridColumns.ImportExtension,
                                TYPO3.EM.GridColumns.ExtensionTitle,
                                TYPO3.EM.GridColumns.ExtensionKey,
                                TYPO3.EM.GridColumns.ExtensionCategoryRemote,
-                               TYPO3.EM.GridColumns.ExtensionAuthor,
+                               TYPO3.EM.GridColumns.ExtensionRemoteAuthor,
                                TYPO3.EM.GridColumns.ExtensionType,
                                TYPO3.EM.GridColumns.ExtensionStateValue
                        ],
@@ -182,7 +180,7 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                        loadMask: {msg: TYPO3.lang.action_loadingRepositoryExtlist},
                        store: this.repositoryListStore,
                        cm: cm,
-                       plugins: [this.expander, TYPO3.EM.RemoteFilters],
+                       plugins: TYPO3.settings.EM.inlineToWindow == 1 ? [TYPO3.EM.RemoteFilters] : [this.expander, TYPO3.EM.RemoteFilters],
                        viewConfig: {
                                forceFit: true,
                                enableRowBody: true,
@@ -194,10 +192,45 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                select: Ext.emptyFn
                        }),
                        tbar: [
+                               ' ',
                                {
-                                       xtype: 'tbtext',
-                                       text: TYPO3.lang.cmd_filter + ':',
-                                       qTip: TYPO3.lang.help_remoteFilter
+                                       text: TYPO3.lang.cmd_filter,
+                                       qTip: TYPO3.lang.help_remoteFilter,
+                                       scale: 'small',
+                                       iconAlign: 'right',
+                                       ref: '../filterMenuButton',
+                                       menu : {
+                                               items: [
+                                                       {
+                                                               checked: true,
+                                                               group: 'installFilter',
+                                                               text: TYPO3.lang.display_all,
+                                                               handler: function(item, event) {
+                                                                       this.showInstalledOnly = 0;
+                                                                       this.store.reload();
+                                                               },
+                                                               scope: this
+                                                       }, {
+                                                               checked: false,
+                                                               group: 'installFilter',
+                                                               text: TYPO3.lang.display_installedOnly,
+                                                               handler: function(item, event) {
+                                                                       this.showInstalledOnly = 1;
+                                                                       this.store.reload();
+                                                               },
+                                                               scope: this
+                                                       }, {
+                                                               checked: false,
+                                                               group: 'installFilter',
+                                                               text: TYPO3.lang.display_updatesOnly,
+                                                               handler: function(item, event) {
+                                                                       this.showInstalledOnly = 2;
+                                                                       this.store.reload();
+                                                               },
+                                                               scope: this
+                                                       }
+                                               ]
+                                       }
                                },
                                searchField, ' ', {
                                        text: TYPO3.lang.cmd_ClearAllFilters,
@@ -208,24 +241,25 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                        scope: this,
                                        hidden: true
                                },
-                               ' ', '-',
+                               '->',
                                {
                                        xtype: 'tbtext',
                                        text: TYPO3.lang.repository + ': '
                                },
                                TYPO3.EM.RepositoryCombo,
                                {
+                                       iconCls: 'x-btn-repupdate',
+                                       handler: this.repositoryUpdate,
+                                       tooltip: TYPO3.lang.cmd_RetrieveUpdate,
+                                       scope: this,
+                                       hidden: !TYPO3.settings.EM.allowRepositoryUpdate
+                               },
+                               {
                                        xtype: 'container',
-                                       id: 'repInfo',
+                                       id: 'repListInfo',
                                        html: ''
                                },
-                               ' ',
-                               {
-                                       xtype: 'button',
-                                       text: TYPO3.lang.cmd_RetrieveUpdate,
-                                       scope: this,
-                                       handler: this.repositoryUpdate
-                               }
+                               ' '
 
                        ],
                        bbar:[
@@ -246,7 +280,8 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
        onRender:function() {
                TYPO3.EM.RepositoryCombo.store = this.repositoryStore;
                TYPO3.EM.RepositoryCombo.on('select', function(comboBox, newValue, oldValue) {
-            Ext.getCmp('repInfo').update(TYPO3.EM.Layouts.repositoryInfo().applyTemplate(newValue.data));
+                       var info = TYPO3.EM.Layouts.repositoryInfo().applyTemplate(newValue.data);
+            Ext.getCmp('repListInfo').update(info);
                        this.repositoryListStore.reload({ params: {repository: newValue.data.uid} });
                }, this);
                this.repositoryStore.load({
@@ -255,13 +290,57 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                                        TYPO3.Flashmessage.display(TYPO3.Severity.error, TYPO3.lang.msg_error, TYPO3.lang.repository_notfound, 15);
                                } else {
                                        var rec = this.getById(TYPO3.settings.EM.selectedRepository);
+                                       if (!rec) {
+                                               TYPO3.settings.EM.selectedRepository = 1;
+                                               rec = this.getById(TYPO3.settings.EM.selectedRepository);
+                                       }
                                        TYPO3.EM.RepositoryCombo.setValue(TYPO3.settings.EM.selectedRepository);
-                                       Ext.getCmp('repInfo').update(TYPO3.EM.Layouts.repositoryInfo().applyTemplate(rec.data));
+                                       Ext.getCmp('repListInfo').update(TYPO3.EM.Layouts.repositoryInfo().applyTemplate(rec.data));
                                }
                        }
 
                });
                TYPO3.EM.RepositoryList.superclass.onRender.apply(this, arguments);
+
+               this.on('rowcontextmenu', function(grid, rowIndex, event) {
+                       if (event.button === 2) {
+                               var record = grid.store.getAt(rowIndex);
+                               if (record.data.versions > 1) {
+                                       var menu = new Ext.menu.Menu({
+                                               record: record,
+                                               items: [{
+                                                       text: String.format(TYPO3.lang.ext_import_versions, record.data.title)
+                                                               + ' (' + String.format(TYPO3.lang.ext_import_versions_available, record.data.versions) + ')',
+                                                       iconCls: 't3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-extension-import',
+                                                       handler: function() {
+                                                               var record = this.ownerCt.record.data;
+                                                               var link = TYPO3.settings.EM.scriptLink
+                                                                       + '&nodoc=1&ter_connect=1&ter_search=' + record.extkey  +'&CMD[importExtInfo]=' + record.extkey;
+                                                               TYPO3.EM.ImportWindow = new TYPO3.EM.InstallWindow({
+                                                                       title: String.format(TYPO3.lang.ext_import_versions, record.title) + ' (' + record.extkey + ')',
+                                                                       record: record,
+                                                                       installAction: 'import',
+                                                                       listeners: {
+                                                                               close: function() {
+                                                                                       TYPO3.EM.Tools.refreshMenu();
+                                                                               }
+                                                                       }
+                                                               }).show(true, function(){
+                                                                       Ext.getCmp('emInstallIframeWindow').setUrl(link);
+                                                               });
+                                                       }
+                                               }]
+                                       }).showAt(event.getXY());
+                               }
+                       event.stopEvent();
+                       }
+               });
+
+               this.on('rowdblclick',function(grid, rowIndex, event) {
+                       if (TYPO3.settings.EM.inlineToWindow) {
+                               this.showExtInfoInWindow(rowIndex);
+                       }
+               });
        },
 
        repositoryUpdate: function() {
@@ -280,6 +359,16 @@ TYPO3.EM.RepositoryList = Ext.extend(Ext.grid.GridPanel, {
                        m.hide();
                }, this);
 
+       },
+
+       showExtInfoInWindow: function(index) {
+               record = this.store.getAt(index);
+               var w = new Ext.Window({
+                       title: TYPO3.EM.Tools.renderExtensionTitle(record),
+                       width: 600,
+                       height: 250,
+                       items : this.expander.createExpandingRowPanelItems(record,index)
+               }).show();
        }
 });
 
index 618d749..a2af58d 100644 (file)
@@ -28,7 +28,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                        listeners: {
                                load: function(store) {
                                        if (this.isLoaded) {
-                                               record = store.getById(this.repSettingsCombo.getValue()).data;
+                                               record = store.getById(TYPO3.settings.EM.selectedRepository).data;
                                                this.repositoryInfo(record);
                                        }
                                },
@@ -52,6 +52,7 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                        listeners: {
                                scope: this,
                                select: function(comboBox, newValue, oldValue) {
+                                       TYPO3.settings.EM.selectedRepository = newValue.data.uid;
                                        this.repositoryInfo(newValue.data);
                                        TYPO3.EM.ExtDirect.saveSetting('selectedRepository', newValue.data.uid);
                                }
@@ -163,63 +164,15 @@ TYPO3.EM.Settings = Ext.extend(Ext.FormPanel, {
                                align: 'stretchmax',
                                border: false,
                                id: 'hbox-settings',
-                               bodyStyle: 'padding-top: 10px;',
-                               defaults: {
-                                       height: 800
-                               },
+                               bodyStyle: 'padding-top: 10px;overflow: auto;',
                                items: [{
                                        width: 450,
                                        border: false,
                                        labelWidth: 100,
                                        items: [{
                                                        xtype:'fieldset',
-                                                       stateId: 'fsUserSettings',
-                                                       stateful: true,
-                                                       stateEvents: ['collapse', 'expand'],
-                                                       title: TYPO3.lang.user_settings,
-                                                       collapsible: true,
-                                                       defaults: {},
-                                                       defaultType: 'textfield',
-                                                       items :[
-                                                       {
-                                                               fieldLabel: TYPO3.lang.enter_repository_username,
-                                                               name: 'fe_u'
-                                                       }, {
-                                                               fieldLabel: TYPO3.lang.enter_repository_password,
-                                                               inputType: 'password',
-                                                               name: 'fe_p'
-                                                       },
-                                                               new Ext.Container({
-                                                                       html: '<b>' + TYPO3.lang.notice + '</b> ' + TYPO3.lang.repository_password_info,
-                                                                       xtype: 'displayfield',
-                                                                       labelWidth: 1
-                                                               })
-                                                       ],
-                                                       buttons: [
-                                                               {
-                                                                       text: TYPO3.lang.cmd_save,
-                                                                       iconCls: 'x-btn-save',
-                                                                       handler: function() {
-            &