Bug #15663 » em_1638_unix_save.diff
class.em_index.php 2006-07-14 20:22:53.193817600 +0200 | ||
---|---|---|
define('EM_INSTALL_VERSION_MAX', 2);
|
||
define('EM_INSTALL_VERSION_STRICT', 3);
|
||
|
||
if (!defined ('PATH_tslib')) {
|
||
define('PATH_tslib', '../../../sysext/cms/tslib/');
|
||
}
|
||
|
||
require_once(PATH_tslib.'class.tslib_content.php');
|
||
require_once(PATH_tslib.'class.tslib_pibase.php');
|
||
require_once('class.em_tslib_pibase.php');
|
||
|
||
/**
|
||
* Module: Extension manager
|
||
*
|
||
... | ... | |
var $lookUpStr; // Search string when listing local extensions
|
||
|
||
|
||
var $defaultStatesString = 'alpha,beta,stable,experimental,test,obsolete';
|
||
var $defaultCatString = ',be,module,fe,plugin,misc,services,templates,example,doc';
|
||
|
||
var $order = array ('DESC' => 'ASC', 'ASC' => 'DESC');
|
||
|
||
function memory_get_usage() {
|
||
//If its Windows
|
||
//Tested on Win XP Pro SP2. Should work on Win 2003 Server too
|
||
//Doesn't work for 2000
|
||
//If you need it to work for 2000 look at http://us2.php.net/manual/en/function.memory-get-usage.php#54642
|
||
if ( substr(PHP_OS,0,3) == 'WIN') {
|
||
$output = array();
|
||
exec( 'tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $output );
|
||
return preg_replace( '/[\D]/', '', $output[5] ) * 1024;
|
||
} else {
|
||
//We now assume the OS is UNIX
|
||
//Tested on Mac OS X 10.4.6 and Linux Red Hat Enterprise 4
|
||
//This should work on most UNIX systems
|
||
$pid = getmypid();
|
||
exec("ps -eo%mem,rss,pid | grep $pid", $output);
|
||
$output = explode(" ", $output[0]);
|
||
//rss is given in 1024 byte units
|
||
return $output[1] * 1024;
|
||
}
|
||
}
|
||
|
||
/*********************************
|
||
*
|
||
... | ... | |
4 => 'Translation handling',
|
||
3 => 'Settings',
|
||
),
|
||
'cat' => array (
|
||
'all' => 'All',
|
||
'be' => 'Backend',
|
||
'module' => 'Backend Modules',
|
||
'fe' => 'Frontend',
|
||
'plugin' => 'Frontend Plugins',
|
||
'misc' => 'Miscellaneous',
|
||
'services' => 'Services',
|
||
'templates' => 'Templates',
|
||
'example' => 'Examples',
|
||
'doc' => 'Documentation',
|
||
'' => 'Noname'
|
||
),
|
||
'state' => Array (
|
||
'all' => 'All',
|
||
'alpha' => 'Alpha',
|
||
'beta' => 'Beta',
|
||
'stable' => 'Stable',
|
||
'experimental' => 'Experimental',
|
||
'test' => 'Test',
|
||
'obsolete' => 'Obsolete',
|
||
),
|
||
'listOrder' => array(
|
||
'cat' => 'Category',
|
||
'author_company' => 'Author',
|
||
'state' => 'State',
|
||
'type' => 'Type'
|
||
),
|
||
'display_details' => array(
|
||
1 => 'Details',
|
||
... | ... | |
),
|
||
'display_shy' => '',
|
||
'display_own' => '',
|
||
'display_unchecked' => '',
|
||
'display_unsupported' => '',
|
||
'display_obsolete' => '',
|
||
|
||
'singleDetails' => array(
|
||
... | ... | |
unset($this->MOD_MENU['display_details'][5]);
|
||
$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
|
||
}
|
||
parent::menuConfig();
|
||
|
||
t3lib_SCbase::menuConfig();
|
||
}
|
||
|
||
/**
|
||
... | ... | |
$menu = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.menu').' '.
|
||
t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']);
|
||
|
||
if (t3lib_div::inList('0,1,2',$this->MOD_SETTINGS['function'])) {
|
||
$menu.=' Group by: '.t3lib_BEfunc::getFuncMenu(0,'SET[listOrder]',$this->MOD_SETTINGS['listOrder'],$this->MOD_MENU['listOrder']).
|
||
if (t3lib_div::inList('2',$this->MOD_SETTINGS['function']) && t3lib_div::inList('state',$this->MOD_SETTINGS['listOrder'])) {
|
||
$menu.='Category: '.t3lib_BEfunc::getFuncMenu(0,'SET[state]',$this->MOD_SETTINGS['state'],$this->MOD_MENU['state']).
|
||
' Group by: '.t3lib_BEfunc::getFuncMenu(0,'SET[listOrder]',$this->MOD_SETTINGS['listOrder'],$this->MOD_MENU['listOrder']).
|
||
' Show: '.t3lib_BEfunc::getFuncMenu(0,'SET[display_details]',$this->MOD_SETTINGS['display_details'],$this->MOD_MENU['display_details']).'<br />';
|
||
}
|
||
|
||
if ( t3lib_div::inList('2',$this->MOD_SETTINGS['function']) && t3lib_div::inList('cat',$this->MOD_SETTINGS['listOrder'])) {
|
||
$menu.='Category: '.t3lib_BEfunc::getFuncMenu(0,'SET[cat]',$this->MOD_SETTINGS['cat'],$this->MOD_MENU['cat']).
|
||
' Group by: '.t3lib_BEfunc::getFuncMenu(0,'SET[listOrder]',$this->MOD_SETTINGS['listOrder'],$this->MOD_MENU['listOrder']).
|
||
' Show: '.t3lib_BEfunc::getFuncMenu(0,'SET[display_details]',$this->MOD_SETTINGS['display_details'],$this->MOD_MENU['display_details']).'<br />';
|
||
}
|
||
|
||
if ( t3lib_div::inList('2',$this->MOD_SETTINGS['function']) && t3lib_div::inList('author_company',$this->MOD_SETTINGS['listOrder'])) {
|
||
$menu.='Group by: '.t3lib_BEfunc::getFuncMenu(0,'SET[listOrder]',$this->MOD_SETTINGS['listOrder'],$this->MOD_MENU['listOrder']).
|
||
' Show: '.t3lib_BEfunc::getFuncMenu(0,'SET[display_details]',$this->MOD_SETTINGS['display_details'],$this->MOD_MENU['display_details']).'<br />';
|
||
}
|
||
|
||
if (t3lib_div::inList('0,1',$this->MOD_SETTINGS['function'])) {
|
||
$menu.='Group by: '.t3lib_BEfunc::getFuncMenu(0,'SET[listOrder]',$this->MOD_SETTINGS['listOrder'],$this->MOD_MENU['listOrder']).
|
||
' Show: '.t3lib_BEfunc::getFuncMenu(0,'SET[display_details]',$this->MOD_SETTINGS['display_details'],$this->MOD_MENU['display_details']).'<br />';
|
||
}
|
||
if (t3lib_div::inList('0,1',$this->MOD_SETTINGS['function'])) {
|
||
... | ... | |
*/
|
||
function extensionList_import() {
|
||
global $TYPO3_LOADED_EXT;
|
||
|
||
$content='';
|
||
|
||
// Listing from online repository:
|
||
if ($this->listRemote) {
|
||
|
||
list($inst_list,) = $this->getInstalledExtensions();
|
||
$this->inst_keys = array_flip(array_keys($inst_list));
|
||
|
||
$this->detailCols[1]+=6;
|
||
|
||
// see if we have an extensionlist at all
|
||
$this->xmlhandler->loadExtensionsXML();
|
||
if (!count($this->xmlhandler->extensionsXML)) {
|
||
$content .= $this->fetchMetaData('extensions');
|
||
$group = $this->MOD_SETTINGS['listOrder'];
|
||
$cat = $this->MOD_SETTINGS[$group];
|
||
|
||
$lookup = array ('cat' => array (
|
||
'be' => 'AND tx_chlightem_extension.category="be"',
|
||
'module' => 'AND tx_chlightem_extension.category="module"',
|
||
'fe' => 'AND tx_chlightem_extension.category="fe"',
|
||
'plugin' => 'AND tx_chlightem_extension.category="plugin"',
|
||
'misc' => 'AND tx_chlightem_extension.category="misc"',
|
||
'services' => 'AND tx_chlightem_extension.category="services"',
|
||
'templates' => 'AND tx_chlightem_extension.category="templates"',
|
||
'example' => 'AND tx_chlightem_extension.category="example"',
|
||
'doc' => 'AND tx_chlightem_extension.category="doc"',
|
||
'' => 'AND tx_chlightem_extension.category=""',
|
||
),
|
||
|
||
'state' => array (
|
||
'alpha' => 'AND tx_chlightem_extension.extstate="alpha"',
|
||
'beta' => 'AND tx_chlightem_extension.extstate="beta"',
|
||
'stable' => 'AND tx_chlightem_extension.extstate="stable"',
|
||
'experimental' => 'AND tx_chlightem_extension.extstate="experimental"',
|
||
'test' => 'AND tx_chlightem_extension.extstate="test"',
|
||
'obsolete' => 'AND tx_chlightem_extension.extstate="obsolete"',
|
||
),
|
||
|
||
'author_company' => array (
|
||
'author_company' => '',
|
||
),
|
||
);
|
||
|
||
$cmd = $lookup[$group][$cat];
|
||
|
||
if (!$this->MOD_SETTINGS['display_obsolete']) {
|
||
$cmd .= ' AND tx_chlightem_extension.extstate !="obsolete"';
|
||
}
|
||
|
||
if (!$this->MOD_SETTINGS['display_unsupported']) {
|
||
$cmd .= ' AND tx_chlightem_extension.reviewstate > 0';
|
||
}
|
||
|
||
if ($this->listRemote_search) {
|
||
$cmd .= ' AND tx_chlightem_extension.extkey LIKE "%'.$this->listRemote_search.'%"';
|
||
}
|
||
|
||
if($this->MOD_SETTINGS['display_own'] && strlen($this->fe_user['username'])) {
|
||
$this->xmlhandler->searchExtensionsXML($this->listRemote_search, $this->fe_user['username']);
|
||
$cmd .= ' AND tx_chlightem_extension.ownerusername="'.$this->fe_user['username'].'"';
|
||
}
|
||
|
||
$results_at_a_time = 25;
|
||
$piBase = t3lib_div::makeInstance('em_tslib_pibase');
|
||
$piBase->cObj = t3lib_div::makeInstance('tslib_cObj');
|
||
|
||
if (t3lib_div::_GP('ter_pointer') != t3lib_div::_GP('t9r_backup') ) {
|
||
$piBase->ter_pointer = $_GET['t9r_backup'] = t3lib_div::_GP('ter_pointer');
|
||
$order = t3lib_div::_GP('ter_order');
|
||
|
||
} else {
|
||
$this->xmlhandler->searchExtensionsXML($this->listRemote_search);
|
||
|
||
$piBase->ter_pointer = t3lib_div::_GP('ter_pointer');
|
||
if (t3lib_div::_GP('ter_order')) {
|
||
$order = $this->order[t3lib_div::_GP('ter_order')];
|
||
$_GET['ter_order'] = $order;
|
||
} else {
|
||
$order = 'ASC';
|
||
}
|
||
}
|
||
if (count($this->xmlhandler->extensionsXML)) {
|
||
list($list,$cat) = $this->prepareImportExtList();
|
||
|
||
// Available extensions
|
||
if (is_array($cat[$this->MOD_SETTINGS['listOrder']])) {
|
||
if (t3lib_div::_GP('ter_sort')) {
|
||
$sort = t3lib_div::_GP('ter_sort');
|
||
} else {
|
||
$sort = 'extkey';
|
||
}
|
||
|
||
if ($group == 'author_company') {
|
||
$sort = 'ownerusername';
|
||
}
|
||
|
||
|
||
// Initializing the query parameters:
|
||
$piBase->internal["results_at_a_time"]=t3lib_div::intInRange($results_at_a_time,0,1000,9); // Number of results to show in a listing.
|
||
$pibase->internal['results_at_a_time'] = $results_at_a_time;
|
||
|
||
$piBase->internal["maxPages"]=t3lib_div::intInRange(5,0,1000,2); // The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc.
|
||
$piBase->internal["searchFieldList"]='';
|
||
$piBase->internal["orderByList"]= 'extkey,downloadcounter,category,extstate,version,title,ownerusername,lastuploaddate';
|
||
$piBase->internal["orderBy"] = $sort;
|
||
$piBase->internal["descFlag"] = $order;
|
||
$piBase->internal["currentTable"] = "tx_chlightem_extension";
|
||
$piBase->internal['pagefloat'] = 'center';
|
||
|
||
// Get number of records:
|
||
$res = $piBase->pi_exec_query('tx_chlightem_extension',1,$cmd);
|
||
list($piBase->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
|
||
|
||
$lines=array();
|
||
$lines[]=$this->extensionListRowHeader(' class="bgColor5"',array('<td><img src="clear.gif" width="18" height="1" alt="" /></td>'),1);
|
||
|
||
foreach($cat[$this->MOD_SETTINGS['listOrder']] as $catName => $extEkeys) {
|
||
if (count($extEkeys)) {
|
||
$lines[]=$this->extensionListRowHeader(' class="bgColor5"',array('<td><img src="clear.gif" width="18" height="1" alt="" /></td>'),1);
|
||
$lines[]='<tr><td colspan="'.(3+$this->detailCols[$this->MOD_SETTINGS['display_details']]).'"><br /></td></tr>';
|
||
$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>';
|
||
$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'],$cat).'</strong></td></tr>';
|
||
|
||
$this->xmlhandler->extensionsXML = array();
|
||
|
||
// Make listing query, pass query to SQL database:
|
||
$res = $piBase->pi_exec_query('tx_chlightem_extension','',$cmd);
|
||
|
||
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['extkey']=$row['extkey'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['uid']=$row['uid'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['downloadcounter']=$row['downloadcounter'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['icon']=$row['icon'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['type']=$row['type'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['lastuploaddate']=$row['lastuploaddate'];
|
||
}
|
||
mysql_free_result($res);
|
||
|
||
foreach ($this->xmlhandler->extensionsXML as $k => $v) {
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*','tx_chlightem_extension','tx_chlightem_mm','tx_chlightem_version','AND tx_chlightem_extension.uid='.$v['uid']);
|
||
|
||
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['version']=$row['version'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['title']=$row['title'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['description']=$row['description'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['state']=$row['extstate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['reviewstate']=$row['reviewstate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['lastuploaddate']=$row['lastuploaddate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['constraints']=unserialize($row['dependencies']);
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author']=$row['authorname'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author_email']=$row['authoremail'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author_company']=$row['authorcompany'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['ownerusername']=$row['ownerusername'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['t3xfilemd5']=$row['t3xfilemd5'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['category']=$row['category'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['uploadcomment']=$row['uploadcomment'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['downloadcounter']=$row['downloadcounter'];
|
||
}
|
||
}
|
||
mysql_free_result($res);
|
||
|
||
if (count($this->xmlhandler->extensionsXML)) {
|
||
|
||
foreach ($this->xmlhandler->extensionsXML as $k => $v) {
|
||
|
||
// Unset extension key in installed keys array (for tracking)
|
||
if(isset($this->emObj->inst_keys[$k])) unset($this->emObj->inst_keys[$k]);
|
||
|
||
$version = end(array_keys($v['versions']));
|
||
$ext = $v['versions'][$version];
|
||
|
||
$ext['downloadcounter_all'] = $v['downloadcounter'];
|
||
$ext['downloadcounter'] = $ext['EM_CONF']['downloadcounter'];
|
||
$ext['_ICON'] = $v['icon'];
|
||
|
||
natcasesort($extEkeys);
|
||
reset($extEkeys);
|
||
while(list($extKey)=each($extEkeys)) {
|
||
$version = array_keys($list[$extKey]['versions']);
|
||
$version = end($version);
|
||
$ext = $list[$extKey]['versions'][$version];
|
||
$ext['downloadcounter_all'] = $list[$extKey]['downloadcounter'];
|
||
$ext['_ICON'] = $list[$extKey]['_ICON'];
|
||
$loadUnloadLink='';
|
||
if ($inst_list[$extKey]['type']!='S' && (!isset($inst_list[$extKey]) || $this->versionDifference($version,$inst_list[$extKey]['EM_CONF']['version'],$this->versionDiffFactor))) {
|
||
if (isset($inst_list[$extKey])) {
|
||
if ($inst_list[$v['extkey']]['type']!='S' && (!isset($inst_list[$v['extkey']]) || $this->versionDifference($version,$inst_list[$v['extkey']]['EM_CONF']['version'],$this->versionDiffFactor))) {
|
||
if (isset($inst_list[$v['extkey']])) {
|
||
// update
|
||
$loc= ($inst_list[$extKey]['type']=='G'?'G':'L');
|
||
$aUrl = 'index.php?CMD[importExt]='.$extKey.'&CMD[extVersion]='.$version.'&CMD[loc]='.$loc;
|
||
$loc= ($inst_list[$v['extkey']]['type']=='G'?'G':'L');
|
||
$aUrl = 'index.php?CMD[importExt]='.$v['extkey'].'&CMD[extVersion]='.$version.'&CMD[loc]='.$loc;
|
||
$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>';
|
||
} else {
|
||
// import
|
||
$aUrl = 'index.php?CMD[importExt]='.$extKey.'&CMD[extVersion]='.$version.'&CMD[loc]=L';
|
||
$aUrl = 'index.php?CMD[importExt]='.$v['extkey'].'&CMD[extVersion]='.$version.'&CMD[loc]=L';
|
||
$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>';
|
||
}
|
||
} else {
|
||
$loadUnloadLink = ' ';
|
||
}
|
||
|
||
if (isset($inst_list[$extKey])) {
|
||
$theRowClass = t3lib_extMgm::isLoaded($extKey) ? 'em-listbg1' : 'em-listbg2';
|
||
if (isset($inst_list[$v['extkey']])) {
|
||
$theRowClass = t3lib_extMgm::isLoaded($v['extkey']) ? 'em-listbg1' : 'em-listbg2';
|
||
} else {
|
||
$theRowClass = 'em-listbg3';
|
||
}
|
||
|
||
$lines[]=$this->extensionListRow($extKey,$ext,array('<td class="bgColor">'.$loadUnloadLink.'</td>'),$theRowClass,$inst_list,1,'index.php?CMD[importExtInfo]='.rawurlencode($extKey));
|
||
}
|
||
$lines[]=$this->extensionListRow($v['extkey'],$ext,array('<td class="bgColor">'.$loadUnloadLink.'</td>'),$theRowClass,$inst_list,1,'index.php?CMD[importExtInfo]='.rawurlencode($v['extkey']));
|
||
}
|
||
|
||
} else {
|
||
$lines[] = '<strong>No matching extensions found.<strong><br>';
|
||
}
|
||
|
||
// CSH:
|
||
... | ... | |
|
||
<!-- TER Extensions list -->
|
||
<table border="0" cellpadding="2" cellspacing="1">'.implode(chr(10),$lines).'</table>';
|
||
$content.= '<br /><br /><strong>PRIVACY NOTICE:</strong><br /> '.$this->privacyNotice;
|
||
|
||
$this->content.=$this->doc->section('Extensions in TYPO3 Extension Repository (online) - Grouped by: '.$this->MOD_MENU['listOrder'][$this->MOD_SETTINGS['listOrder']],$content,0,1);
|
||
|
||
// Plugins which are NOT uploaded to repository but present on this server.
|
||
$content='';
|
||
$lines=array();
|
||
if (count($this->inst_keys)) {
|
||
reset($this->inst_keys);
|
||
while(list($extKey)=each($this->inst_keys)) {
|
||
if(strlen($this->listRemote_search) && !stristr($extKey,$this->listRemote_search)) continue;
|
||
unset($lines);
|
||
|
||
$loadUnloadLink = t3lib_extMgm::isLoaded($extKey)?
|
||
'<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->removeButton().'</a>':
|
||
'<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[load]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->installButton().'</a>';
|
||
if (in_array($extKey,$this->requiredExt)) $loadUnloadLink='<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'</strong>';
|
||
$lines[]=$this->extensionListRow($extKey,$inst_list[$extKey],array('<td class="bgColor">'.$loadUnloadLink.'</td>'),t3lib_extMgm::isLoaded($extKey)?'em-listbg1':'em-listbg2');
|
||
}
|
||
}
|
||
if(count($lines)) {
|
||
$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 />';
|
||
$content.= '<table border="0" cellpadding="2" cellspacing="1">'.
|
||
$this->extensionListRowHeader(' class="bgColor5"',array('<td><img src="clear.gif" width="18" height="1" alt="" /></td>')).
|
||
implode('',$lines).'</table>';
|
||
$this->content.=$this->doc->spacer(20);
|
||
$this->content.=$this->doc->section('Extensions found only on this server',$content,0,1);
|
||
}
|
||
}
|
||
} else {
|
||
$content.= t3lib_BEfunc::cshItem('_MOD_tools_em', 'import_ter', $GLOBALS['BACK_PATH'],'|<br/>');
|
||
$onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['_lookUp'].value);return false;";
|
||
$content.= '</form><form action="index.php" method="post" onsubmit="'.htmlspecialchars($onsubmit).'">List or look up extensions<br />
|
||
<input type="text" name="_lookUp" value="'.htmlspecialchars($this->listRemote_search).'" /> <input type="submit" value="Look up" /><br /><br />';
|
||
$content.=$piBase->pi_list_browseresults(1,'width="1%"',array ( 'activeLinkWrap' => '<td nowrap="nowrap"><p style="background-color:#FFFF00">|</p></td>',
|
||
'showResultsWrap' => '<td width="99%" align="right" nowrap="nowrap"><p style="padding-right:100px">|</p></td></tr></table>',
|
||
'browseLinksWrap' => '<table width="100%"><tr>|',
|
||
)
|
||
|
||
$content.= '<p><strong>No matching extensions found.</strong></p>';
|
||
);
|
||
|
||
$content.= '<br /><br /><strong>PRIVACY NOTICE:</strong><br /> '.$this->privacyNotice;
|
||
$this->content.=$this->doc->section('Extensions in TYPO3 Extension Repository (online) - Grouped by: '.$this->MOD_MENU['listOrder'][$this->MOD_SETTINGS['listOrder']],$content,0,1);
|
||
}
|
||
} else {
|
||
// CSH
|
||
$content.= t3lib_BEfunc::cshItem('_MOD_tools_em', 'import', $GLOBALS['BACK_PATH'],'|<br/>');
|
||
|
||
$onsubmit = "window.location.href='index.php?ter_connect=1&ter_search='+escape(this.elements['_lookUp'].value);return false;";
|
||
$content.= '</form><form action="index.php" method="post" onsubmit="'.htmlspecialchars($onsubmit).'">List or look up <strong'.($this->MOD_SETTINGS['display_unchecked']?' style="color:#900;">all':' style="color:#090;">reviewed').'</strong> extensions<br />
|
||
$content.= '</form><form action="index.php" method="post" onsubmit="'.htmlspecialchars($onsubmit).'">List or look up extensions<br />
|
||
<input type="text" name="_lookUp" value="" /> <input type="submit" value="Look up" /><br /><br />';
|
||
|
||
if ($this->CMD['fetchMetaData']) { // fetches mirror/extension data from online rep.
|
||
... | ... | |
|
||
$content .= '<br /><br /><strong>PRIVACY NOTICE:</strong><br />'.$this->privacyNotice;
|
||
|
||
$content.= "<br /><br /><strong>Typo3:</strong><br />Total Memory Usage: " . $this->memory_get_usage() / 1024 . " KBytes <br/>\n";
|
||
$this->content.=$this->doc->section('Extensions in TYPO3 Extension Repository',$content,0,1);
|
||
}
|
||
|
||
... | ... | |
$this->content.= $this->doc->section('',$content);
|
||
$content = '';
|
||
|
||
// Fetch remote data:
|
||
$this->xmlhandler->loadExtensionsXML();
|
||
$this->xmlhandler->extensionsXML = array($extKey => $this->xmlhandler->extensionsXML[$extKey]);
|
||
list($fetchData,) = $this->prepareImportExtList();
|
||
$this->xmlhandler->extensionsXML = array();
|
||
|
||
// Make listing query, pass query to SQL database:
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_chlightem_extension','tx_chlightem_extension.extkey="'.$extKey.'"');
|
||
|
||
$versions = array_keys($fetchData[$extKey]['versions']);
|
||
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['extkey']=$row['extkey'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['uid']=$row['uid'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['downloadcounter']=$row['downloadcounter'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['icon']=$row['icon'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['type']=$row['type'];
|
||
}
|
||
mysql_free_result($res);
|
||
|
||
foreach ($this->xmlhandler->extensionsXML as $k => $v) {
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*','tx_chlightem_extension','tx_chlightem_mm','tx_chlightem_version','AND tx_chlightem_extension.uid='.$v['uid']);
|
||
|
||
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['version']=$row['version'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['title']=$row['title'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['description']=$row['description'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['state']=$row['extstate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['reviewstate']=$row['reviewstate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['lastuploaddate']=$row['lastuploaddate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['constraints']=unserialize($row['dependencies']);
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author']=$row['authorname'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author_email']=$row['authoremail'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author_company']=$row['authorcompany'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['ownerusername']=$row['ownerusername'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['t3xfilemd5']=$row['t3xfilemd5'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['category']=$row['category'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['uploadcomment']=$row['uploadcomment'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['downloadcounter']=$row['downloadcounter'];
|
||
}
|
||
}
|
||
mysql_free_result($res);
|
||
|
||
$versions = array_keys($this->xmlhandler->extensionsXML[$extKey]['versions']);
|
||
$version = ($version == '') ? end($versions) : $version;
|
||
|
||
$opt = array();
|
||
foreach(array_keys($fetchData[$extKey]['versions']) as $ver) {
|
||
foreach(array_keys($this->xmlhandler->extensionsXML[$extKey]['versions']) as $ver) {
|
||
$opt[]='<option value="'.$ver.'"'.(($version == $ver) ? ' selected="selected"' : '').'>'.$ver.'</option>';
|
||
}
|
||
|
||
... | ... | |
$select.='
|
||
<input type="submit" value="Import/Update" onclick="'.htmlspecialchars($onClick).'"> to:
|
||
<select name="loc">'.
|
||
($this->importAsType('G',$fetchData['emconf_lockType'])?'<option value="G">Global: '.$this->typePaths['G'].$extKey.'/'.(@is_dir(PATH_site.$this->typePaths['G'].$extKey)?' (OVERWRITE)':' (empty)').'</option>':'').
|
||
($this->importAsType('L',$fetchData['emconf_lockType'])?'<option value="L">Local: '.$this->typePaths['L'].$extKey.'/'.(@is_dir(PATH_site.$this->typePaths['L'].$extKey)?' (OVERWRITE)':' (empty)').'</option>':'').
|
||
($this->importAsType('S',$fetchData['emconf_lockType'])?'<option value="S">System: '.$this->typePaths['S'].$extKey.'/'.(@is_dir(PATH_site.$this->typePaths['S'].$extKey)?' (OVERWRITE)':' (empty)').'</option>':'').
|
||
($this->importAsType('G',$this->xmlhandler->extensionsXML['emconf_lockType'])?'<option value="G">Global: '.$this->typePaths['G'].$extKey.'/'.(@is_dir(PATH_site.$this->typePaths['G'].$extKey)?' (OVERWRITE)':' (empty)').'</option>':'').
|
||
($this->importAsType('L',$this->xmlhandler->extensionsXML['emconf_lockType'])?'<option value="L">Local: '.$this->typePaths['L'].$extKey.'/'.(@is_dir(PATH_site.$this->typePaths['L'].$extKey)?' (OVERWRITE)':' (empty)').'</option>':'').
|
||
($this->importAsType('S',$this->xmlhandler->extensionsXML['emconf_lockType'])?'<option value="S">System: '.$this->typePaths['S'].$extKey.'/'.(@is_dir(PATH_site.$this->typePaths['S'].$extKey)?' (OVERWRITE)':' (empty)').'</option>':'').
|
||
'</select>';
|
||
} else $select.= $this->noImportMsg();
|
||
$content.= $select;
|
||
$this->content.= $this->doc->section('Select command',$content,0,1);
|
||
|
||
// Details:
|
||
$eInfo = $fetchData[$extKey]['versions'][$version];
|
||
$content='<strong>'.$fetchData[$extKey]['_ICON'].' '.$eInfo['EM_CONF']['title'].' ('.$extKey.', '.$version.')</strong><br /><br />';
|
||
$eInfo = $this->xmlhandler->extensionsXML[$extKey]['versions'][$version];
|
||
$content='<strong>'.$this->xmlhandler->extensionsXML[$extKey]['_ICON'].' '.$eInfo['EM_CONF']['title'].' ('.$extKey.', '.$version.')</strong><br /><br />';
|
||
$content.=$this->extInformationArray($extKey,$eInfo,1);
|
||
$this->content.=$this->doc->spacer(10);
|
||
$this->content.=$this->doc->section('Remote Extension Details',$content,0,1);
|
||
... | ... | |
$content = '<p>The mirror list was not updated, it could not be fetched from '.$this->MOD_SETTINGS['mirrorListURL'].'. Possible reasons: network problems, allow_url_fopen is off, curl is not enabled in Install tool.</p>';
|
||
} else {
|
||
t3lib_div::writeFile($mfile, $mirrorsFile);
|
||
$mirrors = implode('',gzfile($mfile));
|
||
$mirrors = implode(chr(10), gzfile($mfile));
|
||
t3lib_div::unlink_tempfile($mfile);
|
||
|
||
$mirrors = $this->xmlhandler->parseMirrorsXML($mirrors);
|
||
... | ... | |
if($extXML === false) {
|
||
$content .= '<p>Error: The extension list could not be fetched from '.$extfile.'. Possible reasons: network problems, allow_url_fopen is off, curl is not enabled in Install tool.</p>';
|
||
} else {
|
||
|
||
t3lib_div::writeFile(PATH_site.'typo3temp/extensions.xml.gz', $extXML);
|
||
$content .= $this->xmlhandler->parseExtensionsXML(implode('',gzfile(PATH_site.'typo3temp/extensions.xml.gz')));
|
||
$this->xmlhandler->saveExtensionsXML();
|
||
$filepath = $this->getMirrorURL();
|
||
|
||
$content .= "Memory (Before): " . $this->memory_get_usage() / 1024 . " KBytes <br/>\n";
|
||
$tStart = microtime(true);
|
||
|
||
$gz = gzopen(PATH_site.'typo3temp/extensions.xml.gz', 'rb');
|
||
|
||
if ($gz) {
|
||
|
||
fseek($gz,51,SEEK_CUR);
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->sql('tx_chlightem_extension','truncate table tx_chlightem_extension');
|
||
$extC = 0;
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->sql('tx_chlightem_version','truncate table tx_chlightem_version');
|
||
$verC = 0;
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->sql('tx_chlightem_mm','truncate table tx_chlightem_mm');
|
||
|
||
$char = '';
|
||
$pos = 0;
|
||
|
||
while (!gzeof($gz)) {
|
||
|
||
$char .= gzgets($gz, 4096);
|
||
$pos = strpos($char,"</extension>");
|
||
|
||
if ($pos) {
|
||
|
||
$extC++;
|
||
|
||
$buffer = substr($char,0,$pos+12);
|
||
$char = substr($char,$pos+12);
|
||
|
||
$result = $this->xmlhandler->parseExtensionsXML($buffer);
|
||
$extKey = key($this->xmlhandler->extXMLResult);
|
||
|
||
// too be very sure extKey exists
|
||
if (is_array($this->xmlhandler->extXMLResult[$extKey])) {
|
||
|
||
$version = array_keys($this->xmlhandler->extXMLResult[$extKey]['versions']);
|
||
$version = end($version);
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_chlightem_extension', array (
|
||
'crdate' => time(),
|
||
'extkey' => $extKey,
|
||
'downloadcounter' => $this->xmlhandler->extXMLResult[$extKey]['downloadcounter'],
|
||
'icon' => '<img alt="" src="'.$filepath.$extKey{0}.'/'.$extKey{1}.'/'.$extKey.'_'.$version.'.gif" />',
|
||
'category' => $this->xmlhandler->extXMLResult[$extKey]['versions'][$version]['category'],
|
||
'extstate' => $this->xmlhandler->extXMLResult[$extKey]['versions'][$version]['state'],
|
||
'version' => $version,
|
||
'title' => $this->xmlhandler->extXMLResult[$extKey]['versions'][$version]['title'],
|
||
'reviewstate' => $this->xmlhandler->extXMLResult[$extKey]['versions'][$version]['reviewstate'],
|
||
'ownerusername' => $this->xmlhandler->extXMLResult[$extKey]['versions'][$version]['ownerusername'],
|
||
'lastuploaddate' => $this->xmlhandler->extXMLResult[$extKey]['versions'][$version]['lastuploaddate'],
|
||
)
|
||
);
|
||
echo $GLOBALS['TYPO3_DB']->sql_error();
|
||
|
||
$query1 = '';
|
||
$q1str = array();
|
||
|
||
$query2 = '';
|
||
$q2str = array();
|
||
|
||
foreach ($this->xmlhandler->extXMLResult[$extKey]['versions'] as $k => $v) {
|
||
$verC++;
|
||
|
||
$qArr = array( $verC,
|
||
0,
|
||
time(),
|
||
$k,
|
||
$v['title'],
|
||
$v['description'],
|
||
$v['state'],
|
||
$v['reviewstate'],
|
||
$v['downloadcounter'],
|
||
$v['lastuploaddate'],
|
||
serialize($v['dependencies']),
|
||
$v['authorname'],
|
||
$v['authoremail'],
|
||
$v['authorcompany'],
|
||
$v['ownerusername'],
|
||
$v['t3xfilemd5'],
|
||
$v['category'],
|
||
$v['uploadcomment'],
|
||
);
|
||
|
||
$q1str[] = '\''.implode('\',\'',$qArr).'\'';
|
||
|
||
$qArr = array ( $extC,
|
||
$verC,
|
||
'',
|
||
''
|
||
);
|
||
|
||
$q2str[] = '\''.implode('\',\'',$qArr).'\'';
|
||
|
||
}
|
||
|
||
$query1 = 'INSERT INTO `tx_chlightem_version` VALUES ('. implode('),(',$q1str).');';
|
||
$query2 = 'INSERT INTO `tx_chlightem_mm` VALUES ('. implode('),(',$q2str).');';
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->sql_query($query1);
|
||
echo $GLOBALS['TYPO3_DB']->sql_error();
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->sql_query($query2);
|
||
echo $GLOBALS['TYPO3_DB']->sql_error();
|
||
|
||
$this->xmlhandler->extXMLResult = array();
|
||
}
|
||
}
|
||
}
|
||
gzclose($gz);
|
||
|
||
unset($this->xmlhandler->extXMLResult);
|
||
unset($this->xmlhandler->reviewStates);
|
||
|
||
unset($buffer);
|
||
unset($char);
|
||
unset($query1);
|
||
unset($query2);
|
||
unset($pos);
|
||
unset($q1str);
|
||
unset($q2str);
|
||
unset($qArr);
|
||
|
||
$content.= "Memory (After): " . $this->memory_get_usage() / 1024 . " KBytes <br/>\n";
|
||
|
||
$runTime = (microtime(true)-$tStart);
|
||
|
||
$content.= "Runtime: $runTime ms";
|
||
$content.= "<p>The extensions list has been updated and now contains $extC extension entries.</p>";
|
||
|
||
} else {
|
||
|
||
$content.= "<p>Function gzopen fails!</p>";
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
... | ... | |
} else return 'Wrong file format. No data recognized, '.$fetchData;
|
||
} else return 'No file uploaded! Probably the file was too large for PHPs internal limit for uploadable files.';
|
||
} else {
|
||
$this->xmlhandler->loadExtensionsXML();
|
||
|
||
$this->xmlhandler->extensionsXML = array();
|
||
|
||
// Make listing query, pass query to SQL database:
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_chlightem_extension','tx_chlightem_extension.extkey="'.$extKey.'"');
|
||
|
||
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['extkey']=$row['extkey'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['uid']=$row['uid'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['downloadcounter']=$row['downloadcounter'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['icon']=$row['icon'];
|
||
$this->xmlhandler->extensionsXML[$row['extkey']]['type']=$row['type'];
|
||
}
|
||
mysql_free_result($res);
|
||
|
||
foreach ($this->xmlhandler->extensionsXML as $k => $v) {
|
||
|
||
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*','tx_chlightem_extension','tx_chlightem_mm','tx_chlightem_version','AND tx_chlightem_extension.uid='.$v['uid']);
|
||
|
||
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['version']=$row['version'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['title']=$row['title'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['description']=$row['description'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['state']=$row['extstate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['reviewstate']=$row['reviewstate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['lastuploaddate']=$row['lastuploaddate'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['constraints']=unserialize($row['dependencies']);
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author']=$row['authorname'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author_email']=$row['authoremail'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['author_company']=$row['authorcompany'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['ownerusername']=$row['ownerusername'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['t3xfilemd5']=$row['t3xfilemd5'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['category']=$row['category'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['uploadcomment']=$row['uploadcomment'];
|
||
$this->xmlhandler->extensionsXML[$v['extkey']]['versions'][$row['version']]['EM_CONF']['downloadcounter']=$row['downloadcounter'];
|
||
}
|
||
}
|
||
mysql_free_result($res);
|
||
|
||
// Fetch extension from TER:
|
||
if(!strlen($version)) {
|
||
$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());
|
||
$version = ($version == '') ? end($versions) : $version;
|
||
};
|
||
|
||
$fetchData = $this->terConnection->fetchExtension($extKey, $version, $this->xmlhandler->extensionsXML[$extKey]['versions'][$version]['EM_CONF']['t3xfilemd5'], $this->getMirrorURL());
|
||
}
|
||
|
||
// At this point the extension data should be present; so we want to write it to disc:
|
||
... | ... | |
if (is_array($fetchData)) { // There was some data successfully transferred
|
||
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'] = $this->xmlhandler->extensionsXML[$extKey]['versions'][$version]['dependencies'];
|
||
if(!isset($fetchData[0]['EM_CONF']['constraints'])) $fetchData[0]['EM_CONF']['constraints'] = $this->xmlhandler->extensionsXML[$extKey]['versions'][$version]['EM_CONF']['dependencies'];
|
||
$EM_CONF = $this->fixEMCONF($fetchData[0]['EM_CONF']);
|
||
if (!$EM_CONF['lockType'] || !strcmp($EM_CONF['lockType'],$loc)) {
|
||
// check dependencies, act accordingly if ext is loaded
|
||
... | ... | |
$depStatus = $this->checkDependencies($extKey, $EM_CONF, $instExtInfo);
|
||
if(t3lib_extMgm::isLoaded($extKey) && !$depStatus['returnCode']) {
|
||
$this->content .= $depStatus['html'];
|
||
if ($uploadedTempFile) {
|
||
$this->content .= '<input type="hidden" name="CMD[alreadyUploaded]" value="'.$uploadedTempFile.'" />';
|
||
}
|
||
} else {
|
||
$res = $this->clearAndMakeExtensionDir($fetchData[0],$loc,$dontDelete);
|
||
if (is_array($res)) {
|
||
... | ... | |
if (!$content) {
|
||
$content='SUCCESS: '.$extDirPath.'<br />';
|
||
|
||
$uploadSucceed = true;
|
||
|
||
// Fix TYPO3_MOD_PATH for backend modules in extension:
|
||
$modules = t3lib_div::trimExplode(',',$EM_CONF['module'],1);
|
||
if (count($modules)) {
|
||
... | ... | |
|
||
$this->content.=$this->doc->section('Extension import results',$content,0,1);
|
||
|
||
if ($uploadSucceed && $uploadedTempFile) {
|
||
t3lib_div::unlink_tempfile($uploadedTempFile);
|
||
}
|
||
|
||
return false;
|
||
}
|
||
|
||
... | ... | |
return $content;
|
||
}
|
||
|
||
function extensionListRowHeaderLink($str,$sort) {
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
/***********************************
|
||
*
|
||
* Extension list rendering
|
||
*
|
||
**********************************/
|
||
$cmd = 'ter_connect='.t3lib_div::_GP('ter_connect').'&ter_search='.t3lib_div::_GP('ter_search').'&ter_sort='.$sort.'&ter_pointer='.t3lib_div::_GP('ter_pointer').'&t9r_backup='.t3lib_div::_GP('t9r_backup');
|
||
if (t3lib_div::_GP('ter_order')) {
|
||
$cmd .= '&ter_order='.t3lib_div::_GP('ter_order');
|
||
} else {
|
||
$cmd .= '&ter_order=DESC';
|
||
}
|
||
return '<a href="index.php?'.$cmd.'">'.$str.'</a>';
|
||
}
|
||
|
||
/**
|
||
* Prints the header row for the various listings
|
||
... | ... | |
*/
|
||
function extensionListRowHeader($trAttrib,$cells,$import=0) {
|
||
$cells[] = '<td></td>';
|
||
$cells[] = '<td>Title:</td>';
|
||
|
||
if (!$this->MOD_SETTINGS['display_details']) {
|
||
$cells[] = '<td>'.$this->extensionListRowHeaderLink('Title:','title').'</td>';
|
||
$cells[] = '<td>Description:</td>';
|
||
$cells[] = '<td>Author:</td>';
|
||
$cells[] = '<td>'.$this->extensionListRowHeaderLink('Author:','ownerusername').'</td>';
|
||
} elseif ($this->MOD_SETTINGS['display_details']==2) {
|
||
$cells[] = '<td>Title:</td>';
|
||
$cells[] = '<td>Priority:</td>';
|
||
$cells[] = '<td>Mod.Tables:</td>';
|
||
$cells[] = '<td>Modules:</td>';
|
||
... | ... | |
$cells[] = '<td>Internal?</td>';
|
||
$cells[] = '<td>Shy?</td>';
|
||
} elseif ($this->MOD_SETTINGS['display_details']==3) {
|
||
$cells[] = '<td>Title:</td>';
|
||
$cells[] = '<td>Tables/Fields:</td>';
|
||
$cells[] = '<td>TS-files:</td>';
|
||
$cells[] = '<td>Affects:</td>';
|
||
... | ... | |
$cells[] = '<td>Config?</td>';
|
||
$cells[] = '<td>Code warnings:</td>';
|
||
} elseif ($this->MOD_SETTINGS['display_details']==4) {
|
||
$cells[] = '<td>Title:</td>';
|
||
$cells[] = '<td>locallang:</td>';
|
||
$cells[] = '<td>Classes:</td>';
|
||
$cells[] = '<td>Code warnings:</td>';
|
||
$cells[] = '<td>Nameing annoyances:</td>';
|
||
} elseif ($this->MOD_SETTINGS['display_details']==5) {
|
||
$cells[] = '<td>Title:</td>';
|
||
$cells[] = '<td>Changed files:</td>';
|
||
} elseif ($this->MOD_SETTINGS['display_details']==1 && t3lib_div::inList('2',$this->MOD_SETTINGS['function'])) {
|
||
|
||
$cells[] = '<td>'.$this->extensionListRowHeaderLink('Title:','title').'</td>';
|
||
$cells[] = '<td>'.$this->extensionListRowHeaderLink('Extension key:','extkey').'</td>';
|
||
$cells[] = '<td>'.$this->extensionListRowHeaderLink('Version:','version').'</td>';
|
||
$cells[] = '<td class="bgColor6"'.$this->labelInfo('Current version of the extension on this server. If colored red there is a newer version in repository! Then you should upgrade.').'>'.$this->extensionListRowHeaderLink('Cur. Ver:','curver').'</td>';
|
||
$cells[] = '<td class="bgColor6"'.$this->labelInfo('Current type of installation of the extension on this server.').'>'.$this->extensionListRowHeaderLink('Cur. Type:','curtype').'</td>';
|
||
$cells[] = '<td'.$this->labelInfo('Number of downloads, all versions/this version').'>'.$this->extensionListRowHeaderLink('DL:','downloadcounter').'</td>';
|
||
$cells[] = '<td>'.$this->extensionListRowHeaderLink('State:','extstate').'</td>';
|
||
if (t3lib_div::inList('2',$this->MOD_SETTINGS['function'])) $cells[] = '<td>'.$this->extensionListRowHeaderLink('Lastuploaddate:','lastuploaddate').'</td>';
|
||
|
||
} else {
|
||
|
||
$cells[] = '<td>Title:</td>';
|
||
$cells[] = '<td>Extension key:</td>';
|
||
$cells[] = '<td>Version:</td>';
|
||
if (!$import) {
|
||
... | ... | |
|
||
// Icon:
|
||
$imgInfo = @getImageSize($this->getExtPath($extKey,$extInfo['type']).'/ext_icon.gif');
|
||
|
||
if (is_array($imgInfo)) {
|
||
$cells[] = '<td><img src="'.$GLOBALS['BACK_PATH'].$this->typeRelPaths[$extInfo['type']].$extKey.'/ext_icon.gif'.'" '.$imgInfo[3].' alt="" /></td>';
|
||
} elseif ($extInfo['_ICON']) {
|
||
... | ... | |
}
|
||
|
||
// Extension title:
|
||
$cells[] = '<td nowrap="nowrap"><a href="'.htmlspecialchars($altLinkUrl?$altLinkUrl:'index.php?CMD[showExt]='.$extKey.'&SET[singleDetails]=info').'" title="'.$extKey.'"'/*.($extInfo['EM_CONF']['shy'] ? ' style="color:#666;" ' : '')*/.'>'.t3lib_div::fixed_lgd($extInfo['EM_CONF']['title']?$extInfo['EM_CONF']['title']:'<em>'.$extKey.'</em>',40).'</a></td>';
|
||
$cells[] = '<td nowrap="nowrap"><a href="'.htmlspecialchars($altLinkUrl?$altLinkUrl:'index.php?CMD[showExt]='.$extKey.'&SET[singleDetails]=info').'" title="'.$extKey.'">'.t3lib_div::fixed_lgd($extInfo['EM_CONF']['title']?$extInfo['EM_CONF']['title']:'<em>'.$extKey.'</em>',40).'</a></td>';
|
||
|
||
// Based on which display mode you will see more or less details:
|
||
if (!$this->MOD_SETTINGS['display_details']) {
|
||
$cells[] = '<td>'.htmlspecialchars(t3lib_div::fixed_lgd($extInfo['EM_CONF']['description'],400)).'<br /><img src="clear.gif" width="300" height="1" alt="" /></td>';
|
||
|
||
$cells[] = '<td><a href="http://typo3.org/extensions/repository/search/'.$extKey.'/'.$extInfo['EM_CONF']['version'].'/info">'.htmlspecialchars(t3lib_div::fixed_lgd($extInfo['EM_CONF']['description'],400)).'</a><br /><img src="clear.gif" width="300" height="1" alt="" /></td>';
|
||
$cells[] = '<td nowrap="nowrap">'.($extInfo['EM_CONF']['author_email'] ? '<a href="mailto:'.htmlspecialchars($extInfo['EM_CONF']['author_email']).'">' : '').htmlspecialchars($extInfo['EM_CONF']['author']).($extInfo['EM_CONF']['author_email'] ? '</a>' : '').($extInfo['EM_CONF']['author_company'] ? '<br />'.htmlspecialchars($extInfo['EM_CONF']['author_company']) : '').'</td>';
|
||
|
||
} elseif ($this->MOD_SETTINGS['display_details']==2) {
|
||
$cells[] = '<td nowrap="nowrap">'.$extInfo['EM_CONF']['priority'].'</td>';
|
||
$cells[] = '<td nowrap="nowrap">'.implode('<br />',t3lib_div::trimExplode(',',$extInfo['EM_CONF']['modify_tables'],1)).'</td>';
|
||
... | ... | |
$cells[] = '<td nowrap="nowrap">'.($extInfo['EM_CONF']['clearCacheOnLoad'] ? 'Yes' : '').'</td>';
|
||
$cells[] = '<td nowrap="nowrap">'.($extInfo['EM_CONF']['internal'] ? 'Yes' : '').'</td>';
|
||
$cells[] = '<td nowrap="nowrap">'.($extInfo['EM_CONF']['shy'] ? 'Yes' : '').'</td>';
|
||
|
||
} elseif ($this->MOD_SETTINGS['display_details']==3) {
|
||
|
||
$techInfo = $this->makeDetailedExtensionAnalysis($extKey,$extInfo);
|
||
|
||
$cells[] = '<td>'.$this->extInformationArray_dbReq($techInfo).
|
||
'</td>';
|
||
$cells[] = '<td>'.$this->extInformationArray_dbReq($techInfo).'</td>';
|
||
$cells[] = '<td nowrap="nowrap">'.(is_array($techInfo['TSfiles']) ? implode('<br />',$techInfo['TSfiles']) : '').'</td>';
|
||
$cells[] = '<td nowrap="nowrap">'.(is_array($techInfo['flags']) ? implode('<br />',$techInfo['flags']) : '').'</td>';
|
||
$cells[] = '<td nowrap="nowrap">'.(is_array($techInfo['moduleNames']) ? implode('<br />',$techInfo['moduleNames']) : '').'</td>';
|
||
... | ... | |
$GLOBALS['TBE_TEMPLATE']->rfw((t3lib_extMgm::isLoaded($extKey)&&$techInfo['tables_error']?'<strong>Table error!</strong><br />Probably one or more required fields/tables are missing in the database!':'').
|
||
(t3lib_extMgm::isLoaded($extKey)&&$techInfo['static_error']?'<strong>Static table error!</strong><br />The static tables are missing or empty!':'')).
|
||
'</td>';
|
||
|
||
} elseif ($this->MOD_SETTINGS['display_details']==4) {
|
||
|
||
$techInfo=$this->makeDetailedExtensionAnalysis($extKey,$extInfo,1);
|
||
|
||
$cells[] = '<td>'.(is_array($techInfo['locallang']) ? implode('<br />',$techInfo['locallang']) : '').'</td>';
|
||
$cells[] = '<td>'.(is_array($techInfo['classes']) ? implode('<br />',$techInfo['classes']) : '').'</td>';
|
||
$cells[] = '<td>'.(is_array($techInfo['errors']) ? $GLOBALS['TBE_TEMPLATE']->rfw(implode('<hr />',$techInfo['errors'])) : '').'</td>';
|
||
$cells[] = '<td>'.(is_array($techInfo['NSerrors']) ? (!t3lib_div::inList($this->nameSpaceExceptions,$extKey) ? t3lib_div::view_array($techInfo['NSerrors']) : $GLOBALS['TBE_TEMPLATE']->dfw('[exception]')) :'').'</td>';
|
||
|
||
} elseif ($this->MOD_SETTINGS['display_details']==5) {
|
||
|
||
$currentMd5Array = $this->serverExtensionMD5Array($extKey,$extInfo);
|
||
$affectedFiles = '';
|
||
$msgLines = array();
|
||
... | ... | |
if (count($affectedFiles)) $msgLines[] = '<br /><strong>Modified files:</strong><br />'.$GLOBALS['TBE_TEMPLATE']->rfw(implode('<br />',$affectedFiles));
|
||
}
|
||
$cells[] = '<td>'.implode('<br />',$msgLines).'</td>';
|
||
|
||
} else {
|
||
// Default view:
|
||
$verDiff = $inst_list[$extKey] && $this->versionDifference($extInfo['EM_CONF']['version'],$inst_list[$extKey]['EM_CONF']['version'],$this->versionDiffFactor);
|
||
|
||
$cells[] = '<td nowrap="nowrap"><em>'.$extKey.'</em></td>';
|
||
$cells[] = '<td nowrap="nowrap"><em><a href="http://typo3.org/extensions/repository/search/'.$extKey.'/'.$extInfo['EM_CONF']['version'].'/info">'.$extKey.'</a></em></td>';
|
||
|
||
$cells[] = '<td nowrap="nowrap">'.($verDiff ? '<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw(htmlspecialchars($extInfo['EM_CONF']['version'])).'</strong>' : $extInfo['EM_CONF']['version']).'</td>';
|
||
|
||
if (!$import) { // Listing extenson on LOCAL server:
|
||
// Extension Download:
|
||
$cells[] = '<td nowrap="nowrap"><a href="'.htmlspecialchars('index.php?CMD[doBackup]=1&SET[singleDetails]=backup&CMD[showExt]='.$extKey).'"><img src="download.png" width="13" height="12" title="Download" alt="" /></a></td>';
|
||
... | ... | |
($this->typePaths[$extInfo['type']] && @is_file($fileP)?'<a href="'.htmlspecialchars(t3lib_div::resolveBackPath($this->doc->backPath.'../'.$this->typePaths[$extInfo['type']].$extKey.'/doc/manual.sxw')).'" target="_blank"><img src="oodoc.gif" width="13" height="16" title="Local Open Office Manual" alt="" /></a>':'').
|
||
'</td>';
|
||
$cells[] = '<td nowrap="nowrap">'.$this->typeLabels[$extInfo['type']].(strlen($extInfo['doubleInstall'])>1?'<strong> '.$GLOBALS['TBE_TEMPLATE']->rfw($extInfo['doubleInstall']).'</strong>':'').'</td>';
|
||
|
||
} else { // Listing extensions from REMOTE repository:
|
||
|
||
$inst_curVer = $inst_list[$extKey]['EM_CONF']['version'];
|
||
if (isset($inst_list[$extKey])) {
|
||
if ($verDiff) $inst_curVer = '<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw($inst_curVer).'</strong>';
|
||
... | ... | |
$cells[] = '<td nowrap="nowrap">'.($extInfo['downloadcounter_all']?$extInfo['downloadcounter_all']:' ').'/'.($extInfo['downloadcounter']?$extInfo['downloadcounter']:' ').'</td>';
|
||
}
|
||
$cells[] = '<td nowrap="nowrap" class="extstate" style="background-color:'.$this->stateColors[$extInfo['EM_CONF']['state']].';">'.$this->states[$extInfo['EM_CONF']['state']].'</td>';
|
||
|
||
if (t3lib_div::inList('2',$this->MOD_SETTINGS['function'])) $cells[] = '<td nowrap="nowrap">'.date('d.m.Y',$extInfo['EM_CONF']['lastuploaddate']).'</td>';
|
||
}
|
||
|
||
if($this->xmlhandler->getReviewState($extKey,$extInfo['EM_CONF']['version'])<1) {
|
||
if($this->xmlhandler->extensionsXML[$extKey]['versions'][$extInfo['EM_CONF']['version']]['EM_CONF']['reviewstate']<1) {
|
||
$bgclass = ' class="unsupported-ext"';
|
||
} else {
|
||
$bgclass = ' class="'.($bgColorClass?$bgColorClass:'bgColor4').'"';
|