Documentation TYPO3 par Ameos

class.em_index.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006  * (c) 2005-2006 Karsten Dambekalns <karsten@typo3.org>
00007 *  All rights reserved
00008 *
00009 *  This script is part of the TYPO3 project. The TYPO3 project is
00010 *  free software; you can redistribute it and/or modify
00011 *  it under the terms of the GNU General Public License as published by
00012 *  the Free Software Foundation; either version 2 of the License, or
00013 *  (at your option) any later version.
00014 *
00015 *  The GNU General Public License can be found at
00016 *  http://www.gnu.org/copyleft/gpl.html.
00017 *  A copy is found in the textfile GPL.txt and important notices to the license
00018 *  from the author is found in LICENSE.txt distributed with these scripts.
00019 *
00020 *
00021 *  This script is distributed in the hope that it will be useful,
00022 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 *  GNU General Public License for more details.
00025 *
00026 *  This copyright notice MUST APPEAR in all copies of the script!
00027 ***************************************************************/
00170         // Include classes needed:
00171 require_once(PATH_t3lib.'class.t3lib_tcemain.php');
00172 require_once(PATH_t3lib.'class.t3lib_install.php');
00173 require_once(PATH_t3lib.'class.t3lib_tsstyleconfig.php');
00174 require_once(PATH_t3lib.'class.t3lib_scbase.php');
00175 
00176 require_once('class.em_xmlhandler.php');
00177 require_once('class.em_terconnection.php');
00178 require_once('class.em_unzip.php');
00179 
00180         // from tx_ter by Robert Lemke
00181 define('TX_TER_RESULT_EXTENSIONSUCCESSFULLYUPLOADED', '10504');
00182 
00183 define('EM_INSTALL_VERSION_MIN', 1);
00184 define('EM_INSTALL_VERSION_MAX', 2);
00185 define('EM_INSTALL_VERSION_STRICT', 3);
00186 
00195 class SC_mod_tools_em_index extends t3lib_SCbase {
00196 
00197                 // Internal, static:
00198         var $versionDiffFactor = 1;             // This means that version difference testing for import is detected for sub-versions only, not dev-versions. Default: 1000
00199         var $systemInstall = 0;                         // If "1" then installs in the sysext directory is allowed. Default: 0
00200         var $requiredExt = '';                          // List of required extension (from TYPO3_CONF_VARS)
00201         var $maxUploadSize = 31457280;          // Max size in bytes of extension upload to repository
00202         var $kbMax = 500;                                       // Max size in kilobytes for files to be edited.
00203         var $doPrintContent = true;                     // If set (default), the function printContent() will echo the content which was collected in $this->content. You can set this to FALSE in order to echo content from elsewhere, fx. when using outbut buffering
00204 
00209         var $defaultCategories = Array(
00210                 'cat' => Array (
00211                         'be' => array(),
00212                         'module' => array(),
00213                         'fe' => array(),
00214                         'plugin' => array(),
00215                         'misc' => array(),
00216                         'services' => array(),
00217                         'templates' => array(),
00218                         'example' => array(),
00219                         'doc' => array()
00220                 )
00221         );
00222 
00227         var $categories = Array(
00228                 'be' => 'Backend',
00229                 'module' => 'Backend Modules',
00230                 'fe' => 'Frontend',
00231                 'plugin' => 'Frontend Plugins',
00232                 'misc' => 'Miscellaneous',
00233                 'services' => 'Services',
00234                 'templates' => 'Templates',
00235                 'example' => 'Examples',
00236                 'doc' => 'Documentation'
00237         );
00238 
00243         var $states = Array (
00244                 'alpha' => 'Alpha',
00245                 'beta' => 'Beta',
00246                 'stable' => 'Stable',
00247                 'experimental' => 'Experimental',
00248                 'test' => 'Test',
00249                 'obsolete' => 'Obsolete',
00250         );
00251 
00255         var $stateColors = Array (
00256                 'alpha' => '#d12438',
00257                 'beta' => '#97b17e',
00258                 'stable' => '#3bb65c',
00259                 'experimental' => '#007eba',
00260                 'test' => '#979797',
00261                 'obsolete' => '#000000',
00262         );
00263 
00267         var $typeLabels = Array (
00268                 'S' => 'System',
00269                 'G' => 'Global',
00270                 'L' => 'Local',
00271         );
00272         var $typeDescr = Array (
00273                 'S' => 'System extension (typo3/sysext/) - Always distributed with source code (Static).',
00274                 'G' => 'Global extensions (typo3/ext/) - Available for shared source on server (Dynamic).',
00275                 'L' => 'Local extensions (typo3conf/ext/) - Local for this TYPO3 installation only (Dynamic).',
00276         );
00277         var $typePaths = Array();                       // Also static, set in init()
00278         var $typeBackPaths = Array();           // Also static, set in init()
00279 
00280         var $typeRelPaths = Array (
00281                 'S' => 'sysext/',
00282                 'G' => 'ext/',
00283                 'L' => '../typo3conf/ext/',
00284         );
00285 
00286         var $detailCols = Array (
00287                 0 => 2,
00288                 1 => 5,
00289                 2 => 6,
00290                 3 => 6,
00291                 4 => 4,
00292                 5 => 1
00293         );
00294 
00295         var $fe_user = array(
00296                 'username' => '',
00297                 'password' => '',
00298         );
00299 
00300         var $privacyNotice = 'When you interact with the online repository, server information may be sent and stored in the repository for statistics.';
00301         var $editTextExtensions = 'html,htm,txt,css,tmpl,inc,php,sql,conf,cnf,pl,pm,sh,xml,ChangeLog';
00302         var $nameSpaceExceptions = 'beuser_tracking,design_components,impexp,static_file_edit,cms,freesite,quickhelp,classic_welcome,indexed_search,sys_action,sys_workflows,sys_todos,sys_messages,direct_mail,sys_stat,tt_address,tt_board,tt_calender,tt_guest,tt_links,tt_news,tt_poll,tt_rating,tt_products,setup,taskcenter,tsconfig_help,context_help,sys_note,tstemplate,lowlevel,install,belog,beuser,phpmyadmin,aboutmodules,imagelist,setup,taskcenter,sys_notepad,viewpage,adodb';
00303 
00304 
00305 
00306 
00307 
00308                 // Default variables for backend modules
00309         var $MCONF = array();                           // Module configuration
00310         var $MOD_MENU = array();                        // Module menu items
00311         var $MOD_SETTINGS = array();            // Module session settings
00312         var $doc;                                                       // Document Template Object
00313         var $content;                                           // Accumulated content
00314 
00315         var $inst_keys = array();                       // Storage of installed extensions
00316         var $gzcompress = 0;                            // Is set true, if system support compression.
00317 
00318         var $terConnection;                     // instance of TER connection handler
00319 
00320                 // GPvars:
00321         var $CMD = array();                                     // CMD array
00322         var $listRemote;                                        // If set, connects to remote repository
00323         var $lookUpStr;                                         // Search string when listing local extensions
00324 
00325 
00326 
00327 
00328         /*********************************
00329         *
00330         * Standard module initialization
00331         *
00332         *********************************/
00333 
00339         function init() {
00340                 global $BE_USER,$LANG,$BACK_PATH,$TYPO3_CONF_VARS;
00341 
00342                 // Setting paths of install scopes:
00343                 $this->typePaths = Array (
00344                         'S' => TYPO3_mainDir.'sysext/',
00345                         'G' => TYPO3_mainDir.'ext/',
00346                         'L' => 'typo3conf/ext/'
00347                 );
00348                 $this->typeBackPaths = Array (
00349                         'S' => '../../../',
00350                         'G' => '../../../',
00351                         'L' => '../../../../'.TYPO3_mainDir
00352                 );
00353 
00354                 // Setting module configuration:
00355                 $this->MCONF = $GLOBALS['MCONF'];
00356 
00357                 // Setting GPvars:
00358                 $this->CMD = t3lib_div::_GP('CMD');
00359                 $this->lookUpStr = t3lib_div::_GP('_lookUp');
00360                 $this->listRemote = t3lib_div::_GP('ter_connect');
00361                 $this->listRemote_search = t3lib_div::_GP('ter_search');
00362 
00363 
00364                         // Configure menu
00365                 $this->menuConfig();
00366 
00367                         // Setting internal static:
00368                 if ($TYPO3_CONF_VARS['EXT']['allowSystemInstall'])      $this->systemInstall = 1;
00369                 $this->requiredExt = t3lib_div::trimExplode(',',$TYPO3_CONF_VARS['EXT']['requiredExt'],1);
00370 
00371 
00372                         // Initialize helper object
00373                 $this->terConnection = t3lib_div::makeInstance('SC_mod_tools_em_terconnection');
00374                 $this->terConnection->emObj =& $this;
00375                 $this->terConnection->wsdlURL = $TYPO3_CONF_VARS['EXT']['em_wsdlURL'];
00376                 $this->xmlhandler = t3lib_div::makeInstance('SC_mod_tools_em_xmlhandler');
00377                 $this->xmlhandler->emObj =& $this;
00378                 $this->xmlhandler->useUnsupported = $this->MOD_SETTINGS['display_unsupported'];
00379                 $this->xmlhandler->useObsolete = $this->MOD_SETTINGS['display_obsolete'];
00380 
00381                         // Initialize Document Template object:
00382                 $this->doc = t3lib_div::makeInstance('noDoc');
00383                 $this->doc->backPath = $BACK_PATH;
00384                 $this->doc->docType = 'xhtml_trans';
00385 
00386                         // JavaScript
00387                 $this->doc->JScode = $this->doc->wrapScriptTags('
00388                         script_ended = 0;
00389                         function jumpToUrl(URL) {       //
00390                                 window.location.href = URL;
00391                         }
00392                 ');
00393                 $this->doc->form = '<form action="index.php" method="post" name="pageform">';
00394 
00395                 // Descriptions:
00396                 $this->descrTable = '_MOD_'.$this->MCONF['name'];
00397                 if ($BE_USER->uc['edit_showFieldHelp']) {
00398                         $LANG->loadSingleTableDescription($this->descrTable);
00399                 }
00400 
00401                 // Setting username/password etc. for upload-user:
00402                 $this->fe_user['username'] = $this->MOD_SETTINGS['fe_u'];
00403                 $this->fe_user['password'] = $this->MOD_SETTINGS['fe_p'];
00404                 parent::init();
00405                 $this->handleExternalFunctionValue('singleDetails');
00406         }
00407 
00419         function handleExternalFunctionValue($MM_key='function', $MS_value=NULL)        {
00420                 $MS_value = is_null($MS_value) ? $this->MOD_SETTINGS[$MM_key] : $MS_value;
00421                 $externalItems = $this->getExternalItemConfig($this->MCONF['name'],$MM_key,$MS_value);
00422                 if (is_array($externalItems))   $this->extClassConf = array_merge($externalItems,is_array($this->extClassConf)?$this->extClassConf:array());
00423                 if (is_array($this->extClassConf) && $this->extClassConf['path'])       {
00424                         $this->include_once[]=$this->extClassConf['path'];
00425                 }
00426         }
00427 
00433         function menuConfig()   {
00434                 global $BE_USER, $TYPO3_CONF_VARS;
00435 
00436                 // MENU-ITEMS:
00437                 $this->MOD_MENU = array(
00438                         'function' => array(
00439                                 0 => 'Loaded extensions',
00440                                 1 => 'Install extensions',
00441                                 2 => 'Import extensions',
00442                                 4 => 'Translation handling',
00443                                 3 => 'Settings',
00444                         ),
00445                         'listOrder' => array(
00446                                 'cat' => 'Category',
00447                                 'author_company' => 'Author',
00448                                 'state' => 'State',
00449                                 'type' => 'Type'
00450                         ),
00451                         'display_details' => array(
00452                                 1 => 'Details',
00453                                 0 => 'Description',
00454                                 2 => 'More details',
00455 
00456                                 3 => 'Technical (takes time!)',
00457                                 4 => 'Validating (takes time!)',
00458                                 5 => 'Changed? (takes time!)',
00459                         ),
00460                         'display_shy' => '',
00461                         'display_own' => '',
00462                         'display_unsupported' => '',
00463                         'display_obsolete' => '',
00464 
00465                         'singleDetails' => array(
00466                                 'info' => 'Information',
00467                                 'edit' => 'Edit files',
00468                                 'backup' => 'Backup/Delete',
00469                                 'dump' => 'Dump DB',
00470                                 'upload' => 'Upload to TER',
00471                                 'updateModule' => 'UPDATE!',
00472                         ),
00473                         'fe_u' => '',
00474                         'fe_p' => '',
00475 
00476                         'mirrorListURL' => '',
00477                         'rep_url' => '',
00478                         'extMirrors' => '',
00479                         'selectedMirror' => '',
00480 
00481                         'selectedLanguages' => ''
00482                 );
00483 
00484                 $this->MOD_MENU['singleDetails'] = $this->mergeExternalItems($this->MCONF['name'],'singleDetails',$this->MOD_MENU['singleDetails']);
00485 
00486                 // page/be_user TSconfig settings and blinding of menu-items
00487                 if (!$BE_USER->getTSConfigVal('mod.'.$this->MCONF['name'].'.allowTVlisting'))   {
00488                         unset($this->MOD_MENU['display_details'][3]);
00489                         unset($this->MOD_MENU['display_details'][4]);
00490                         unset($this->MOD_MENU['display_details'][5]);
00491                 }
00492 
00493                 // CLEANSE SETTINGS
00494                 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
00495 
00496                 if ($this->MOD_SETTINGS['function']==2) {
00497                         // If listing from online repository, certain items are removed though:
00498                         unset($this->MOD_MENU['listOrder']['type']);
00499                         unset($this->MOD_MENU['display_details'][2]);
00500                         unset($this->MOD_MENU['display_details'][3]);
00501                         unset($this->MOD_MENU['display_details'][4]);
00502                         unset($this->MOD_MENU['display_details'][5]);
00503                         $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
00504                 }
00505                 parent::menuConfig();
00506         }
00507 
00513         function main() {
00514                 global $BE_USER,$LANG,$TYPO3_CONF_VARS;
00515 
00516                 if (empty($this->MOD_SETTINGS['mirrorListURL'])) $this->MOD_SETTINGS['mirrorListURL'] = $TYPO3_CONF_VARS['EXT']['em_mirrorListURL'];
00517 
00518                 // Starting page:
00519                 $this->content.=$this->doc->startPage('Extension Manager');
00520                 $this->content.=$this->doc->header('Extension Manager');
00521                 $this->content.=$this->doc->spacer(5);
00522 
00523                 // Commands given which is executed regardless of main menu setting:
00524                 if ($this->CMD['showExt'])      {       // Show details for a single extension
00525                         $this->showExtDetails($this->CMD['showExt']);
00526                 } elseif ($this->CMD['requestInstallExtensions'])       {       // Show details for a single extension
00527                                 $this->requestInstallExtensions($this->CMD['requestInstallExtensions']);
00528                 } elseif ($this->CMD['importExt'] || $this->CMD['uploadExt'])   {       // Imports an extension from online rep.
00529                         $err = $this->importExtFromRep($this->CMD['importExt'],$this->CMD['extVersion'],$this->CMD['loc'],$this->CMD['uploadExt']);
00530                         if ($err)       {
00531                                 $this->content.=$this->doc->section('',$GLOBALS['TBE_TEMPLATE']->rfw($err));
00532                         }
00533                         if(!$err && $this->CMD['importExt']) {
00534                                 $this->installTranslationsForExtension($this->CMD['importExt'], $this->getMirrorURL());
00535                         }
00536                 } elseif ($this->CMD['importExtInfo'])  {       // Gets detailed information of an extension from online rep.
00537                         $this->importExtInfo($this->CMD['importExtInfo'],$this->CMD['extVersion']);
00538                 } else {        // No command - we show what the menu setting tells us:
00539 
00540                         $menu = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.menu').' '.
00541                         t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']);
00542 
00543                         if (t3lib_div::inList('0,1,2',$this->MOD_SETTINGS['function'])) {
00544                                 $menu.='&nbsp;Group by:&nbsp;'.t3lib_BEfunc::getFuncMenu(0,'SET[listOrder]',$this->MOD_SETTINGS['listOrder'],$this->MOD_MENU['listOrder']).
00545                                 '&nbsp;&nbsp;Show:&nbsp;'.t3lib_BEfunc::getFuncMenu(0,'SET[display_details]',$this->MOD_SETTINGS['display_details'],$this->MOD_MENU['display_details']).'<br />';
00546                         }
00547                         if (t3lib_div::inList('0,1',$this->MOD_SETTINGS['function']))   {
00548                                 $menu.='Display shy extensions:&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck(0,'SET[display_shy]',$this->MOD_SETTINGS['display_shy']);
00549                         }
00550                         if (t3lib_div::inList('2',$this->MOD_SETTINGS['function']) && strlen($this->fe_user['username']))       {
00551                                 $menu.='Only my extensions:&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck(0,'SET[display_own]',$this->MOD_SETTINGS['display_own']);
00552                         }
00553                         if (t3lib_div::inList('0,1,2',$this->MOD_SETTINGS['function'])) {
00554                                 $menu.='&nbsp;&nbsp;Show obsolete:&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck(0,'SET[display_obsolete]',$this->MOD_SETTINGS['display_obsolete']);
00555                         }
00556 
00557                         $this->content.=$this->doc->section('','<span class="nobr">'.$menu.'</span>');
00558                         $this->content.=$this->doc->spacer(10);
00559 
00560                         switch((string)$this->MOD_SETTINGS['function']) {
00561                                 case '0':
00562                                         // Lists loaded (installed) extensions
00563                                         $this->extensionList_loaded();
00564                                         break;
00565                                 case '1':
00566                                         // Lists the installed (available) extensions
00567                                         $this->extensionList_installed();
00568                                         break;
00569                                 case '2':
00570                                         // Lists the extensions available from online rep.
00571                                         $this->extensionList_import();
00572                                         break;
00573                                 case '3':
00574                                         // Shows the settings screen
00575                                         $this->alterSettings();
00576                                         break;
00577                                 case '4':
00578                                         // Allows to set the translation preferences and check the status
00579                                         $this->translationHandling();
00580                                         break;
00581                                 default:
00582                                         $this->extObjContent();
00583                                         break;
00584                         }
00585                 }
00586 
00587                 // Shortcuts:
00588                 if ($BE_USER->mayMakeShortcut())        {
00589                         $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('CMD','function',$this->MCONF['name']));
00590                 }
00591         }
00592 
00598         function printContent() {
00599                 if ($this->doPrintContent) {
00600                         $this->content.= $this->doc->endPage();
00601                         echo $this->content;
00602                 }
00603         }
00604 
00605 
00606 
00607 
00608 
00609 
00610 
00611 
00612 
00613 
00614         /*********************************
00615         *
00616         * Function Menu Applications
00617         *
00618         *********************************/
00619 
00625         function extensionList_loaded() {
00626                 global $TYPO3_LOADED_EXT;
00627 
00628                 list($list,$cat) = $this->getInstalledExtensions();
00629 
00630                 // Loaded extensions
00631                 $content = '';
00632                 $lines = array();
00633 
00634                 // Available extensions
00635                 if (is_array($cat[$this->MOD_SETTINGS['listOrder']]))   {
00636                         $content='';
00637                         $lines=array();
00638                         $lines[] = $this->extensionListRowHeader(' class="bgColor5"',array('<td><img src="clear.gif" width="1" height="1" alt="" /></td>'));
00639 
00640                         foreach($cat[$this->MOD_SETTINGS['listOrder']] as $catName => $extEkeys)        {
00641                                 natcasesort($extEkeys);
00642                                 reset($extEkeys);
00643                                 $extensions = array();
00644                                 while(list($extKey)=each($extEkeys))    {
00645                                         if (array_key_exists($extKey,$TYPO3_LOADED_EXT) && ($this->MOD_SETTINGS['display_shy'] || !$list[$extKey]['EM_CONF']['shy']) && $this->searchExtension($extKey,$list[$extKey])) {
00646                                                 if (in_array($extKey, $this->requiredExt))      {
00647                                                         $loadUnloadLink = '<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'</strong>';
00648                                                 } else {
00649                                                         $loadUnloadLink = '<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1').'">'.$this->removeButton().'</a>';
00650                                                 }
00651 
00652                                                 $extensions[] = $this->extensionListRow($extKey,$list[$extKey],array('<td class="bgColor">'.$loadUnloadLink.'</td>'));
00653                                         }
00654                                 }
00655                                 if(count($extensions)) {
00656                                         $lines[]='<tr><td colspan="'.(3+$this->detailCols[$this->MOD_SETTINGS['display_details']]).'"><br /></td></tr>';
00657                                         $lines[]='<tr><td colspan="'.(3+$this->detailCols[$this->MOD_SETTINGS['display_details']]).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/i/sysf.gif" width="18" height="16" align="top" alt="" /><strong>'.$this->listOrderTitle($this->MOD_SETTINGS['listOrder'],$catName).'</strong></td></tr>';
00658                                         $lines[] = implode(chr(10),$extensions);
00659                                 }
00660                         }
00661                 }
00662 
00663                 $content.= t3lib_BEfunc::cshItem('_MOD_tools_em', 'loaded', $GLOBALS['BACK_PATH'],'');
00664 
00665                 $content.= 'Look up: <input type="text" name="_lookUp" value="'.htmlspecialchars($this->lookUpStr).'" /><input type="submit" value="Search"/><br/><br/>';
00666 
00667                 $content.= '
00668 
00669                         <!-- Loaded Extensions List -->
00670                         <table border="0" cellpadding="2" cellspacing="1">'.implode('',$lines).'</table>';
00671 
00672                 $this->content.=$this->doc->section('Loaded Extensions',$content,0,1);
00673         }
00674 
00680         function extensionList_installed()      {
00681                 global $TYPO3_LOADED_EXT;
00682 
00683                 list($list,$cat)=$this->getInstalledExtensions();
00684 
00685                 // Available extensions
00686                 if (is_array($cat[$this->MOD_SETTINGS['listOrder']]))   {
00687                         $content='';
00688                         $lines=array();
00689                         $lines[]=$this->extensionListRowHeader(' class="bgColor5"',array('<td><img src="clear.gif" width="18" height="1" alt="" /></td>'));
00690 
00691                         $allKeys=array();
00692                         foreach($cat[$this->MOD_SETTINGS['listOrder']] as $catName => $extEkeys)        {
00693                                 if(!$this->MOD_SETTINGS['display_obsolete'] && $catName=='obsolete') continue;
00694 
00695                                 $allKeys[]='';
00696                                 $allKeys[]='TYPE: '.$catName;
00697 
00698                                 natcasesort($extEkeys);
00699                                 reset($extEkeys);
00700                                 $extensions = array();
00701                                 while(list($extKey)=each($extEkeys))    {
00702                                         $allKeys[]=$extKey;
00703                                         if ((!$list[$extKey]['EM_CONF']['shy'] || $this->MOD_SETTINGS['display_shy']) &&
00704                                                         ($list[$extKey]['EM_CONF']['state']!='obsolete' || $this->MOD_SETTINGS['display_obsolete'])
00705                                          && $this->searchExtension($extKey,$list[$extKey]))     {
00706                                                 $loadUnloadLink = t3lib_extMgm::isLoaded($extKey)?
00707                                                 '<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->removeButton().'</a>':
00708                                                 '<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[load]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->installButton().'</a>';
00709                                                 if (in_array($extKey,$this->requiredExt))       {
00710                                                         $loadUnloadLink='<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'</strong>';
00711                                                 }
00712                                                 $theRowClass = t3lib_extMgm::isLoaded($extKey)? 'em-listbg1' : 'em-listbg2';
00713                                                 $extensions[]=$this->extensionListRow($extKey,$list[$extKey],array('<td class="bgColor">'.$loadUnloadLink.'</td>'),$theRowClass);
00714                                         }
00715                                 }
00716                                 if(count($extensions)) {
00717                                         $lines[]='<tr><td colspan="'.(3+$this->detailCols[$this->MOD_SETTINGS['display_details']]).'"><br /></td></tr>';
00718                                         $lines[]='<tr><td colspan="'.(3+$this->detailCols[$this->MOD_SETTINGS['display_details']]).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/i/sysf.gif" width="18" height="16" align="top" alt="" /><strong>'.$this->listOrderTitle($this->MOD_SETTINGS['listOrder'],$catName).'</strong></td></tr>';
00719                                         $lines[] = implode(chr(10),$extensions);
00720                                 }
00721                         }
00722 
00723                         $content.='
00724 
00725 
00726 <!--
00727 EXTENSION KEYS:
00728 
00729 '.trim(implode(chr(10),$allKeys)).'
00730 
00731 -->
00732 
00733 ';
00734 
00735                         $content.= t3lib_BEfunc::cshItem('_MOD_tools_em', 'avail', $GLOBALS['BACK_PATH'],'|<br/>');
00736                         $content.= 'If you want to use an extension in TYPO3, you should simply click the "plus" button '.$this->installButton().' . <br />
00737                                                 Installed extensions can also be removed again - just click the remove button '.$this->removeButton().' .<br /><br />';
00738 
00739                         $content.= 'Look up: <input type="text" name="_lookUp" value="'.htmlspecialchars($this->lookUpStr).'" /><input type="submit" value="Search"/><br/><br/>';
00740 
00741                         $content.= '<table border="0" cellpadding="2" cellspacing="1">'.implode('',$lines).'</table>';
00742 
00743                         $this->content.=$this->doc->section('Available Extensions - Grouped by: '.$this->MOD_MENU['listOrder'][$this->MOD_SETTINGS['listOrder']],$content,0,1);
00744                 }
00745         }
00746 
00752         function extensionList_import() {
00753                 global $TYPO3_LOADED_EXT;
00754                 $content='';
00755 
00756                         // Listing from online repository:
00757                 if ($this->listRemote)  {
00758                         list($inst_list,) = $this->getInstalledExtensions();
00759                         $this->inst_keys = array_flip(array_keys($inst_list));
00760 
00761                         $this->detailCols[1]+=6;
00762 
00763                                 // see if we have an extensionlist at all
00764                         $this->xmlhandler->loadExtensionsXML();
00765                         if (!count($this->xmlhandler->extensionsXML))   {
00766                                 $content .= $this->fetchMetaData('extensions');
00767                         }
00768 
00769                         if($this->MOD_SETTINGS['display_own'] && strlen($this->fe_user['username'])) {
00770                                 $this->xmlhandler->searchExtensionsXML($this->listRemote_search, $this->fe_user['username']);
00771                         } else {
00772                                 $this->xmlhandler->searchExtensionsXML($this->listRemote_search);
00773                         }
00774                         if (count($this->xmlhandler->extensionsXML))    {
00775                                 list($list,$cat) = $this->prepareImportExtList();
00776 
00777                                         // Available extensions
00778                                 if (is_array($cat[$this->MOD_SETTINGS['listOrder']]))   {
00779                                         $lines=array();
00780                                         $lines[]=$this->extensionListRowHeader(' class="bgColor5"',array('<td><img src="clear.gif" width="18" height="1" alt="" /></td>'),1);
00781 
00782                                         foreach($cat[$this->MOD_SETTINGS['listOrder']] as $catName => $extEkeys)        {
00783                                                 if (count($extEkeys))   {
00784                                                         $lines[]='<tr><td colspan="'.(3+$this->detailCols[$this->MOD_SETTINGS['display_details']]).'"><br /></td></tr>';
00785                                                         $lines[]='<tr><td colspan="'.(3+$this->detailCols[$this->MOD_SETTINGS['display_details']]).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/i/sysf.gif" width="18" height="16" align="top" alt="" /><strong>'.$this->listOrderTitle($this->MOD_SETTINGS['listOrder'],$catName).'</strong></td></tr>';
00786 
00787                                                         natcasesort($extEkeys);
00788                                                         reset($extEkeys);
00789                                                         while(list($extKey)=each($extEkeys))    {
00790                                                                 $version = array_keys($list[$extKey]['versions']);
00791                                                                 $version = end($version);
00792                                                                 $ext = $list[$extKey]['versions'][$version];
00793                                                                 $ext['downloadcounter_all'] = $list[$extKey]['downloadcounter'];
00794                                                                 $ext['_ICON'] = $list[$extKey]['_ICON'];
00795                                                                 $loadUnloadLink='';
00796                                                                 if ($inst_list[$extKey]['type']!='S' && (!isset($inst_list[$extKey]) || $this->versionDifference($version,$inst_list[$extKey]['EM_CONF']['version'],$this->versionDiffFactor))) {
00797                                                                         if (isset($inst_list[$extKey])) {
00798                                                                                         // update
00799                                                                                 $loc= ($inst_list[$extKey]['type']=='G'?'G':'L');
00800                                                                                 $aUrl = 'index.php?CMD[importExt]='.$extKey.'&CMD[extVersion]='.$version.'&CMD[loc]='.$loc;
00801                                                                                 $loadUnloadLink.= '<a href="'.htmlspecialchars($aUrl).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/import_update.gif" width="12" height="12" title="Update the extension in \''.($loc=='G'?'global':'local').'\' from online repository to server" alt="" /></a>';
00802                                                                         } else {
00803                                                                                         // import
00804                                                                                 $aUrl = 'index.php?CMD[importExt]='.$extKey.'&CMD[extVersion]='.$version.'&CMD[loc]=L';
00805                                                                                 $loadUnloadLink.= '<a href="'.htmlspecialchars($aUrl).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/import.gif" width="12" height="12" title="Import this extension to \'local\' dir typo3conf/ext/ from online repository." alt="" /></a>';
00806                                                                         }
00807                                                                 } else {
00808                                                                         $loadUnloadLink = '&nbsp;';
00809                                                                 }
00810 
00811                                                                 if (isset($inst_list[$extKey])) {
00812                                                                         $theRowClass = t3lib_extMgm::isLoaded($extKey) ? 'em-listbg1' : 'em-listbg2';
00813                                                                 } else {
00814                                                                         $theRowClass = 'em-listbg3';
00815                                                                 }
00816 
00817                                                                 $lines[]=$this->extensionListRow($extKey,$ext,array('<td class="bgColor">'.$loadUnloadLink.'</td>'),$theRowClass,$inst_list,1,'index.php?CMD[importExtInfo]='.rawurlencode($extKey));
00818                                                         }
00819                                                 }
00820                                         }
00821 
00822                                                 // CSH:
00823                                         $content.= t3lib_BEfunc::cshItem('_MOD_tools_em', 'import_ter', $GLOBALS['BACK_PATH'],'|<br/>');
00824                                         $onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['_lookUp'].value);return false;";
00825                                         $content.= '</form><form action="index.php" method="post" onsubmit="'.htmlspecialchars($onsubmit).'">List or look up extensions<br />
00826                                                         <input type="text" name="_lookUp" value="'.htmlspecialchars($this->listRemote_search).'" /> <input type="submit" value="Look up" /><br /><br />';
00827 
00828                                         $content.= '
00829 
00830                                         <!-- TER Extensions list -->
00831                                         <table border="0" cellpadding="2" cellspacing="1">'.implode(chr(10),$lines).'</table>';
00832                                         $content.= '<br /><br /><strong>PRIVACY NOTICE:</strong><br /> '.$this->privacyNotice;
00833 
00834                                         $this->content.=$this->doc->section('Extensions in TYPO3 Extension Repository (online) - Grouped by: '.$this->MOD_MENU['listOrder'][$this->MOD_SETTINGS['listOrder']],$content,0,1);
00835 
00836                                                 // Plugins which are NOT uploaded to repository but present on this server.
00837                                         $content='';
00838                                         $lines=array();
00839                                         if (count($this->inst_keys))    {
00840                                                 reset($this->inst_keys);
00841                                                 while(list($extKey)=each($this->inst_keys))     {
00842                                                         if(strlen($this->listRemote_search) && !stristr($extKey,$this->listRemote_search)) continue;
00843 
00844                                                         $loadUnloadLink = t3lib_extMgm::isLoaded($extKey)?
00845                                                         '<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->removeButton().'</a>':
00846                                                         '<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[load]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->installButton().'</a>';
00847                                                         if (in_array($extKey,$this->requiredExt))       $loadUnloadLink='<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'</strong>';
00848                                                         $lines[]=$this->extensionListRow($extKey,$inst_list[$extKey],array('<td class="bgColor">'.$loadUnloadLink.'</td>'),t3lib_extMgm::isLoaded($extKey)?'em-listbg1':'em-listbg2');
00849                                                 }
00850                                         }
00851                                         if(count($lines)) {
00852                                                 $content.= 'This is the list of extensions which are available locally, but not in the repository.<br />The might be user-defined and should be prepended user_ then.<br /><br />';
00853                                                 $content.= '<table border="0" cellpadding="2" cellspacing="1">'.
00854                                                         $this->extensionListRowHeader(' class="bgColor5"',array('<td><img src="clear.gif" width="18" height="1" alt="" /></td>')).
00855                                                         implode('',$lines).'</table>';
00856                                                 $this->content.=$this->doc->spacer(20);
00857                                                 $this->content.=$this->doc->section('Extensions found only on this server',$content,0,1);
00858                                         }
00859                                 }
00860                         }       else {
00861                                 $content.= t3lib_BEfunc::cshItem('_MOD_tools_em', 'import_ter', $GLOBALS['BACK_PATH'],'|<br/>');
00862                                 $onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['_lookUp'].value);return false;";
00863                                 $content.= '</form><form action="index.php" method="post" onsubmit="'.htmlspecialchars($onsubmit).'">List or look up extensions<br />
00864                                         <input type="text" name="_lookUp" value="'.htmlspecialchars($this->listRemote_search).'" /> <input type="submit" value="Look up" /><br /><br />';
00865 
00866                                 $content.= '<p><strong>No matching extensions found.</strong></p>';
00867 
00868                                 $content.= '<br /><br /><strong>PRIVACY NOTICE:</strong><br /> '.$this->privacyNotice;
00869                                 $this->content.=$this->doc->section('Extensions in TYPO3 Extension Repository (online) - Grouped by: '.$this->MOD_MENU['listOrder'][$this->MOD_SETTINGS['listOrder']],$content,0,1);
00870                         }
00871                 } else {
00872                                 // CSH
00873                         $content.= t3lib_BEfunc::cshItem('_MOD_tools_em', 'import', $GLOBALS['BACK_PATH'],'|<br/>');
00874 
00875                         $onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['_lookUp'].value);return false;";
00876                         $content.= '</form><form action="index.php" method="post" onsubmit="'.htmlspecialchars($onsubmit).'">List or look up extensions<br />
00877                         <input type="text" name="_lookUp" value="" /> <input type="submit" value="Look up" /><br /><br />';
00878 
00879                         if ($this->CMD['fetchMetaData'])        {       // fetches mirror/extension data from online rep.
00880                                 $content .= $this->fetchMetaData($this->CMD['fetchMetaData']);
00881                         } else {
00882                                 $onCLick = "window.location.href='index.php?CMD[fetchMetaData]=extensions';return false;";
00883                                 $content.= 'Connect to the current mirror and retrieve the current list of available plugins from the TYPO3 Extension Repository.<br />
00884                                 <input type="submit" value="Retrieve/Update" onclick="'.htmlspecialchars($onCLick).'" />';
00885                                 if(is_file(PATH_site.'typo3temp/extensions.bin')) {
00886                                         $content .= ' (last update: '.date('Y-m-d H:i',filemtime(PATH_site.'typo3temp/extensions.bin')).')';
00887                                 }
00888                         }
00889 
00890                         $content .= '<br /><br /><strong>PRIVACY NOTICE:</strong><br />'.$this->privacyNotice;
00891 
00892                         $this->content.=$this->doc->section('Extensions in TYPO3 Extension Repository',$content,0,1);
00893                 }
00894 
00895                         // Upload:
00896                 if ($this->importAtAll())       {
00897                         $content= '</form><form action="index.php" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" method="post">
00898                         Upload extension file (.t3x):<br />
00899                                 <input type="file" size="60" name="upload_ext_file" /><br />
00900                                 ... to location:<br />
00901                                 <select name="CMD[loc]">';
00902                         if ($this->importAsType('L'))   $content.='<option value="L">Local (../typo3conf/ext/)</option>';
00903                         if ($this->importAsType('G'))   $content.='<option value="G">Global (typo3/ext/)</option>';
00904                         if ($this->importAsType('S'))   $content.='<option value="S">System (typo3/sysext/)</option>';
00905                         $content.='</select><br />
00906         <input type="checkbox" value="1" name="CMD[uploadOverwrite]" /> Overwrite any existing extension!<br />
00907         <input type="submit" name="CMD[uploadExt]" value="Upload extension file" /><br />
00908                         ';
00909                 } else $content=$this->noImportMsg();
00910 
00911                 $this->content.=$this->doc->spacer(20);
00912                 $this->content.=$this->doc->section('Upload extension file directly (.t3x):',$content,0,1);
00913         }
00914 
00920         function alterSettings()        {
00921 
00922                         // Prepare the HTML output:
00923                 $content.= '
00924                         '.t3lib_BEfunc::cshItem('_MOD_tools_em', 'settings', $GLOBALS['BACK_PATH'],'|<br/>').'
00925                         <fieldset><legend>Security Settings</legend>
00926                         <table border="0" cellpadding="2" cellspacing="2">
00927                                 <tr class="bgColor4">
00928                                         <td>Enable unsupported extensions:</td>
00929                                         <td>'.t3lib_BEfunc::getFuncCheck(0,'SET[display_unsupported]',$this->MOD_SETTINGS['display_unsupported']).'</td>
00930                                 </tr>
00931                         </table>
00932                         <strong>Notice:</strong> Make sure you know what consequences enabling this checkbox might have. Check the information on typo3.org about security reviewing!
00933                         </fieldset>
00934                         <br />
00935                         <br />
00936                         <fieldset><legend>User Settings</legend>
00937                         <table border="0" cellpadding="2" cellspacing="2">
00938                                 <tr class="bgColor4">
00939                                         <td>Enter repository username:</td>
00940                                         <td><input type="text" name="SET[fe_u]" value="'.htmlspecialchars($this->MOD_SETTINGS['fe_u']).'" /></td>
00941                                 </tr>
00942                                 <tr class="bgColor4">
00943                                         <td>Enter repository password:</td>
00944                                         <td><input type="password" name="SET[fe_p]" value="'.htmlspecialchars($this->MOD_SETTINGS['fe_p']).'" /></td>
00945                                 </tr>
00946                         </table>
00947                         <strong>Notice:</strong> This is <em>not</em> your password to the TYPO3 backend! This user information is what is needed to log in at typo3.org with your account there!
00948                         </fieldset>
00949                         <br />
00950                         <br />
00951                         <fieldset><legend>Mirror selection</legend>
00952                         <table border="0" cellpadding="2" cellspacing="2">
00953                                 <tr class="bgColor4">
00954                                         <td>Enter mirror list URL:</td>
00955                                         <td><input type="text" size="50" name="SET[mirrorListURL]" value="'.htmlspecialchars($this->MOD_SETTINGS['mirrorListURL']).'" /></td>
00956                                 </tr>
00957                         </table>
00958                         <br />
00959                         <p>Select a mirror from below. This list is built from the online mirror list retrieved from the URL above.<br /><br /></p>
00960                         <fieldset><legend>Mirror list</legend>';
00961                 if(!empty($this->MOD_SETTINGS['mirrorListURL'])) {
00962                         if ($this->CMD['fetchMetaData'])        {       // fetches mirror/extension data from online rep.
00963                                 $content .= $this->fetchMetaData($this->CMD['fetchMetaData']);
00964                         } else {
00965                                 $content.= '<a href="index.php?CMD[fetchMetaData]=mirrors">Click here to reload the list.</a>';
00966                         }
00967                 }
00968                 $content .= '<br />
00969                         <table cellspacing="4" style="text-align:left; vertical-alignment:top;">
00970                         <tr><td>Use</td><td>Name</td><td>URL</td><td>Country</td><td>Sponsored by</td></tr>
00971                 ';
00972 
00973                 if (!strlen($this->MOD_SETTINGS['extMirrors'])) $this->fetchMetaData('mirrors');
00974                 $extMirrors = unserialize($this->MOD_SETTINGS['extMirrors']);
00975                 $extMirrors[''] = array('title'=>'Random (recommended!)');
00976                 ksort($extMirrors);
00977                 if(is_array($extMirrors)) {
00978                         foreach($extMirrors as $k => $v) {
00979                                 if(isset($v['sponsor'])) {
00980                                         $sponsor = '<a href="'.htmlspecialchars($v['sponsor']['link']).'" target="_new"><img src="'.$v['sponsor']['logo'].'" title="'.htmlspecialchars($v['sponsor']['name']).'" alt="'.htmlspecialchars($v['sponsor']['name']).'" /></a>';
00981                                 }
00982                                 $selected = ($this->MOD_SETTINGS['selectedMirror']==$k) ? 'checked="checked"' : '';
00983                                 $content.='<tr class="bgColor4">
00984                         <td><input type="radio" name="SET[selectedMirror]" value="'.$k.'" '.$selected.'/></td><td>'.htmlspecialchars($v['title']).'</td><td>'.htmlspecialchars($v['host'].$v['path']).'</td><td>'.$v['country'].'</td><td>'.$sponsor.'</td></tr>';
00985                         }
00986                 }
00987                 $content.= '
00988                         </table>
00989                         </fieldset>
00990                         <br />
00991                         <table border="0" cellpadding="2" cellspacing="2">
00992                                 <tr class="bgColor4">
00993                                         <td>Enter repository URL:</td>
00994                                         <td><input type="text" size="50" name="SET[rep_url]" value="'.htmlspecialchars($this->MOD_SETTINGS['rep_url']).'" /></td>
00995                                 </tr>
00996                         </table>
00997 
00998                         If you set a repository URL, this overrides the use of a mirror. Use this to select a specific (private) repository.<br />
00999                         </fieldset>
01000                         <br />
01001                         <input type="submit" value="Update" />
01002                 ';
01003 
01004                 $this->content.=$this->doc->section('Repository settings',$content,0,1);
01005         }
01006 
01012         function translationHandling()  {
01013                 global $LANG, $TYPO3_LOADED_EXT;
01014                 $LANG->includeLLFile('EXT:setup/mod/locallang.xml');
01015 
01016                 $incoming = t3lib_div::_POST('SET');
01017                 if(isset($incoming['selectedLanguages']) && is_array($incoming['selectedLanguages'])) {
01018                         t3lib_BEfunc::getModuleData($this->MOD_MENU, array('selectedLanguages' => serialize($incoming['selectedLanguages'])), $this->MCONF['name'], '', 'selectedLanguages');
01019                         $this->MOD_SETTINGS['selectedLanguages'] = serialize($incoming['selectedLanguages']);
01020                 }
01021 
01022                 $selectedLanguages = unserialize($this->MOD_SETTINGS['selectedLanguages']);
01023                 if(count($selectedLanguages)==1 && empty($selectedLanguages[0])) $selectedLanguages = array();
01024                 $theLanguages = t3lib_div::trimExplode('|',TYPO3_languages);
01025                 foreach($theLanguages as $val)  {
01026                         if ($val!='default')    {
01027                                 $localLabel = '  -  ['.htmlspecialchars($GLOBALS['LOCAL_LANG']['default']['lang_'.$val]).']';
01028                                 $selected = (is_array($selectedLanguages) && in_array($val, $selectedLanguages)) ? ' selected="selected"' : '';
01029                                 $opt[$GLOBALS['LOCAL_LANG']['default']['lang_'.$val].'--'.$val]='
01030              <option value="'.$val.'"'.$selected.'>'.$LANG->getLL('lang_'.$val,1).$localLabel.'</option>';
01031                         }
01032                 }
01033                 ksort($opt);
01034 
01035                         // Prepare the HTML output:
01036                 $content.= '
01037                         '.t3lib_BEfunc::cshItem('_MOD_tools_em', 'translation', $GLOBALS['BACK_PATH'],'|<br/>').'
01038                         <fieldset><legend>Translation Settings</legend>
01039                         <table border="0" cellpadding="2" cellspacing="2">
01040                                 <tr class="bgColor4">
01041                                         <td>Languages to fetch:</td>
01042                                         <td>
01043                                           <select name="SET[selectedLanguages][]" multiple="multiple" size="10">
01044                                           <option></option>'.
01045             implode('',$opt).'
01046             </select>
01047           </td>
01048                                 </tr>
01049                         </table>
01050                         <br />
01051                         <p>For the selected languages the EM tries to download and install translation files if available, whenever an extension is installed. (This replaces the <code>csh_*</code> extensions that were used to install core translations before TYPO3 version 4!)<br />
01052                         <br />To request an update/install for already loaded extensions, see below.</p>
01053                         </fieldset>
01054                         <br />
01055                         <input type="submit" value="Save selection" />
01056                         <br />
01057                         </fieldset>';
01058 
01059                 $this->content.=$this->doc->section('Translation settings',$content,0,1);
01060 
01061                 if(count($selectedLanguages)>0) {
01062                         $mirrorURL = $this->getMirrorURL();
01063                         $content = '<input type="button" value="Check status against repository" onclick="document.location.href=\''.t3lib_div::linkThisScript(array('l10n'=>'check')).'\'" />&nbsp;<input type="button" value="Update from repository" onclick="document.location.href=\''.t3lib_div::linkThisScript(array('l10n'=>'update')).'\'" />';
01064 
01065                         if(t3lib_div::_GET('l10n') == 'check') {
01066                                 $loadedExtensions = array_keys($TYPO3_LOADED_EXT);
01067                                 $loadedExtensions = array_diff($loadedExtensions,array('_CACHEFILE'));
01068 
01069                                         // Override content output - we now do that ourself:
01070                                 echo ($this->content . $this->doc->section('Translation status',$content,0,1));
01071                                 $this->doPrintContent = FALSE;
01072                                 flush();
01073 
01074                                 echo '
01075                                 <br />
01076                                 <br />
01077                                 <p id="progress-message">
01078                                         Checking translation status, please wait ...
01079                                 </p>
01080                                 <br />
01081                                 <div style="width:100%; height:20px; border: 1px solid black;">
01082                                         <div id="progress-bar" style="float: left; width: 0%; height: 20px; background-color:green;">&nbsp;</div>
01083                                         <div id="transparent-bar" style="float: left; width: 100%; height: 20px; background-color:'.$this->doc->bgColor2.';">&nbsp;</div>
01084                                 </div>
01085                                 <br />
01086                                 <br /><p>This table shows the status of the loaded extension\'s translations.</p><br />
01087                                 <table border="0" cellpadding="2" cellspacing="2">
01088                                         <tr class="bgColor2"><td>Extension key</td>
01089                                 ';
01090 
01091                                 foreach($selectedLanguages as $lang) {
01092                                         echo ('<td>'.$LANG->getLL('lang_'.$lang,1).'</td>');
01093                                 }
01094                                 echo ('</tr>');
01095 
01096                                 $counter = 1;
01097                                 foreach($loadedExtensions as $extKey) {
01098 
01099                                         $percentDone = intval (($counter / count($loadedExtensions)) * 100);
01100                                         echo ('
01101                                         <script>
01102                                                 document.getElementById("progress-bar").style.width = "'.$percentDone.'%";
01103                                                 document.getElementById("transparent-bar").style.width = "'.(100-$percentDone).'%";
01104                                                 document.getElementById("progress-message").firstChild.data="Checking translation status for extension \"'.$extKey.'\" ...";
01105                                         </script>
01106                                         ');
01107 
01108                                         flush();
01109                                         $translationStatusArr = $this->terConnection->fetchTranslationStatus($extKey,$mirrorURL);
01110 
01111                                         echo ('<tr class="bgColor4"><td>'.$extKey.'</td>');
01112                                         foreach($selectedLanguages as $lang) {
01113                                                 // remote unknown -> keine l10n
01114                                                 if(!isset($translationStatusArr[$lang])) {
01115                                                         echo ('<td title="No translation available">N/A</td>');
01116                                                         continue;
01117                                                 }
01118                                                         // determine local md5 from zip
01119                                                 if(is_file(PATH_site.'typo3temp/'.$extKey.'-l10n-'.$lang.'.zip')) {
01120                                                         $localmd5 = md5_file(PATH_site.'typo3temp/'.$extKey.'-l10n-'.$lang.'.zip');
01121                                                 } else {
01122                                                         echo ('<td title="Not installed / Unknown" style="background-color:#ff0">???</td>');
01123                                                         continue;
01124                                                 }
01125                                                         // local!=remote -> needs update
01126                                                 if($localmd5 != $translationStatusArr[$lang]['md5']) {
01127                                                         echo ('<td title="Needs update" style="background-color:#ff0">UPD</td>');
01128                                                         continue;
01129                                                 }
01130                                                 echo ('<td title="Is up to date" style="background-color:#69a550">OK</td>');
01131                                         }
01132                                         echo ('</tr>');
01133 
01134                                         $counter ++;
01135                                 }
01136                                 echo '</table>
01137                                         <script>
01138                                                 document.getElementById("progress-message").firstChild.data="Check done.";
01139                                         </script>
01140                                 ';
01141                                 echo $this->doc->endPage();
01142                                 return '';
01143 
01144                         } elseif(t3lib_div::_GET('l10n') == 'update') {
01145                                 $loadedExtensions = array_keys($TYPO3_LOADED_EXT);
01146                                 $loadedExtensions = array_diff($loadedExtensions,array('_CACHEFILE'));
01147 
01148                                         // Override content output - we now do that ourself:
01149                                 echo ($this->content . $this->doc->section('Translation status',$content,0,1));
01150                                 $this->doPrintContent = FALSE;
01151                                 flush();
01152 
01153                                 echo ('
01154                                 <br />
01155                                 <br />
01156                                 <p id="progress-message">
01157                                         Updating translations, please wait ...
01158                                 </p>
01159                                 <br />
01160                                 <div style="width:100%; height:20px; border: 1px solid black;">
01161                                         <div id="progress-bar" style="float: left; width: 0%; height: 20px; background-color:green;">&nbsp;</div>
01162                                         <div id="transparent-bar" style="float: left; width: 100%; height: 20px; background-color:'.$this->doc->bgColor2.';">&nbsp;</div>
01163                                 </div>
01164                                 <br />
01165                                 <br /><p>This table shows the update results of the loaded extension\'s translations.<br />
01166                                 <em>If you want to force a full check/update, delete the l10n zip-files from the typo3temp folder.</em></p><br />
01167                                 <table border="0" cellpadding="2" cellspacing="2">
01168                                         <tr class="bgColor2"><td>Extension key</td>
01169                                 ');
01170 
01171                                 foreach($selectedLanguages as $lang) {
01172                                         echo '<td>'.$LANG->getLL('lang_'.$lang,1).'</td>';
01173                                 }
01174                                 echo '</tr>';
01175 
01176                                 $counter = 1;
01177                                 foreach($loadedExtensions as $extKey) {
01178                                         $percentDone = intval (($counter / count($loadedExtensions)) * 100);
01179