Project

General

Profile

Bug #17819 ยป limittolang.diff

Administrator Admin, 2007-11-20 11:57

View differences:

typo3/sysext/cms/web_info/class.tx_cms_webinfo_lang.php (working copy)
* @return array System language records in an array.
*/
function getSystemLanguages() {
if (!$GLOBALS['BE_USER']->user['admin'] &&
strlen($GLOBALS['BE_USER']->dataLists['allowed_languages'])) {
$allowed_languages = array_flip(explode(',', $GLOBALS['BE_USER']->dataLists['allowed_languages']));
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
'sys_language',
......
$outputArray = array();
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$outputArray[] = $row;
if (is_array($allowed_languages) && count($allowed_languages)) {
if (isset($allowed_languages[$row['uid']])) {
$outputArray[] = $row;
}
}
else {
$outputArray[] = $row;
}
}
return $outputArray;
......
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/web_info/class.tx_cms_webinfo_lang.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/web_info/class.tx_cms_webinfo_lang.php']);
}
?>
?>
typo3/sysext/cms/layout/class.tx_cms_layout.php (working copy)
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
unset($langSelItems[$row['uid']]);
}
// Remove disallowed languages
if (count($langSelItems) > 1 &&
!$GLOBALS['BE_USER']->user['admin'] &&
strlen($GLOBALS['BE_USER']->dataLists['allowed_languages'])) {
$allowed_languages = array_flip(explode(',', $GLOBALS['BE_USER']->dataLists['allowed_languages']));
if (count($allowed_languages)) {
foreach($langSelItems as $key => $value) {
if (!isset($allowed_languages[$key]) && $key != 0) {
unset($langSelItems[$key]);
}
}
}
}
// If any languages are left, make selector:
if (count($langSelItems)>1) {
$onChangeContent = 'window.location.href=\''.$this->backPath.'alt_doc.php?&edit[pages_language_overlay]['.$id.']=new&overrideVals[pages_language_overlay][sys_language_uid]=\'+this.options[this.selectedIndex].value+\'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).'\'';
    (1-1/1)