Project

General

Profile

Bug #24675 » rtehtmlarea_bugfix_17157_follow_up_trunk.patch

Administrator Admin, 2011-01-20 20:08

View differences:

typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (copie de travail)
// Configuration of supported browsers
var $conf_supported_browser = array (
'msie' => array (
1 => array (
array (
'version' => 6.0,
'system' => 'winNT'
'system' => array(
'allowed' => array(
'winNT',
'win98',
'win95',
),
),
),
2 => array (
'version' => 6.0,
'system' => 'win98'
),
3 => array (
'version' => 6.0,
'system' => 'win95'
)
),
'gecko' => array (
1 => array (
'version' => 1.8
)
array (
'version' => 1.8,
),
),
'webkit' => array (
1 => array (
array (
'version' => 523,
'system' => 'mac'
'system' => array(
'disallowed' => array(
'iOS',
),
),
),
2 => array (
'version' => 523,
'system' => 'winNT'
),
3 => array (
'version' => 523,
'system' => 'linux'
),
4 => array (
'version' => 523,
'system' => 'win98'
),
5 => array (
'version' => 523,
'system' => 'win95'
)
),
'opera' => array (
1 => array (
'version' => 9.62
)
array (
'version' => 9.62,
),
)
);
......
*
* @return boolean TRUE if this RTE object offers an RTE in the current browser environment
*/
function isAvailable() {
global $TYPO3_CONF_VARS;
$this->client = $this->clientInfo();
$this->errorLog = array();
if (!$this->debugMode) { // If debug-mode, let any browser through
$rteIsAvailable = 0;
$rteIsAvailable = FALSE;
$rteConfBrowser = $this->conf_supported_browser;
if (is_array($rteConfBrowser)) {
foreach ($rteConfBrowser as $browser => $browserConf) {
if ($browser == $this->client['browser']) {
// Config for Browser found, check it:
if (is_array($browserConf)) {
foreach ($browserConf as $browserConfNr => $browserConfSub) {
foreach ($browserConf as $browserConfSub) {
if ($browserConfSub['version'] <= $this->client['version'] || empty($browserConfSub['version'])) {
// Version is correct
if ($browserConfSub['system'] == $this->client['system'] || empty($browserConfSub['system'])) {
// System is correctly
$rteIsAvailable = 1;
// Version is supported
if (is_array($browserConfSub['system'])) {
// Check against allowed systems
if (is_array($browserConfSub['system']['allowed'])) {
foreach ($browserConfSub['system']['allowed'] as $system) {
if (in_array($system, $this->client['all_systems'])) {
$rteIsAvailable = TRUE;
break;
}
}
} else {
// All allowed
$rteIsAvailable = TRUE;
}
// Check against disallowed systems
if (is_array($browserConfSub['system']['disallowed'])) {
foreach ($browserConfSub['system']['disallowed'] as $system) {
if (in_array($system, $this->client['all_systems'])) {
$rteIsAvailable = FALSE;
break;
}
}
}
} else {
// No system config: system is supported
$rteIsAvailable = TRUE;
break;
}// End of System
}// End of Version
}// End of foreach-BrowserSubpart
} else {
// no config for this browser found, so all versions or system with this browsers are allow
$rteIsAvailable = 1;
$rteIsAvailable = TRUE;
break;
}
} // End of Browser Check
} // foreach: Browser Check
......
// no Browser config for this RTE-Editor, so all Clients are allow
}
if (!$rteIsAvailable) {
$this->errorLog[] = 'rte: Browser not supported. Only msie Version 5 or higher and Mozilla based client 1. and higher.';
$this->errorLog[] = 'RTE: Browser not supported.';
}
if (t3lib_div::int_from_ver(TYPO3_version) < 4000000) {
$rteIsAvailable = 0;
$rteIsAvailable = FALSE;
$this->errorLog[] = 'rte: This version of htmlArea RTE cannot run under this version of TYPO3.';
}
}
if ($rteIsAvailable) return true;
return $rteIsAvailable;
}
/**
......
}
}
}
if ($browserInfo['system'] == 'mac') {
if (strstr($userAgent,'iPad')) {
$browserInfo['system'] = 'iPad';
} elseif (strstr($userAgent,'iPhone')) {
$browserInfo['system'] = 'iPhone';
} elseif (strstr($userAgent,'iPod')) {
$browserInfo['system'] = 'iPod';
}
}
return $browserInfo;
}
/***************************
(1-1/2)