Bug #23640 ยป 15845-sys_language_sorting.patch
typo3/sysext/cms/layout/db_layout.php (working copy) | ||
---|---|---|
* @param integer Page id: If zero, the query will select all sys_language records from root level which are NOT hidden. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user)
|
||
* @return string Return query string.
|
||
*/
|
||
function exec_languageQuery($id) {
|
||
if ($id) {
|
||
function exec_languageQuery($id) {
|
||
$sortBy = (isset($GLOBALS['TCA']['sys_language']['ctrl']['sortby'])) ? $GLOBALS['TCA']['sys_language']['ctrl']['sortby'] : 'title';
|
||
if ($id) {
|
||
$exQ = t3lib_BEfunc::deleteClause('pages_language_overlay') . ($GLOBALS['BE_USER']->isAdmin()?'':' AND sys_language.hidden=0');
|
||
return $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||
'sys_language.*',
|
||
'pages_language_overlay,sys_language',
|
||
'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid='.intval($id).$exQ,
|
||
'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.static_lang_isocode,sys_language.flag',
|
||
'sys_language.title'
|
||
'sys_language.' . $sortBy
|
||
);
|
||
} else {
|
||
return $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||
... | ... | |
'sys_language',
|
||
'sys_language.hidden=0',
|
||
'',
|
||
'sys_language.title'
|
||
'sys_language.' . $sortBy
|
||
);
|
||
}
|
||
}
|