Commit c8892cbb authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

*** empty log message ***


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@421 709f56b5-9817-0410-a4d7-c38de5d9e867
parent b22bcf97
2004-08-03 Kasper Skårhøj,,, <kasper@typo3.com>
* Added and Changed features around page languages. More to come including a document guiding people about charsets and localization.
2004-07-24 Jan-Erik Revsbech <jer@moccompany.com>
* Added support for other transfer encodings in the dmailer class. Will start to move the t3lib_directmailer class out of the core and into the direct_mail extension.
......
......@@ -1032,7 +1032,7 @@ class t3lib_stdGraphic {
} else {
// Blurring of the mask
$times = ceil($blurRate/10); // How many blur-commands that is executed. Min = 1;
$newBlurRate = $blurRate*4; // Her booster vi blur-rate, s�at den allerede ved 25 er p�100. Resten op til 99 g� p�iterationer af blur-kommandoen
$newBlurRate = $blurRate*4; // Here I boost the blur-rate so that it is 100 already at 25. The rest is done by up to 99 iterations of the blur-command.
$newBlurRate = t3lib_div::intInRange($newBlurRate,1,99);
for ($a=0;$a<$times;$a++) { // Building blur-command
$command.=' -blur '.$blurRate;
......
......@@ -765,7 +765,7 @@ class t3lib_TCEforms {
*/
function getSingleField_SW($table,$field,$row,&$PA) {
$PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type'];
switch($PA['fieldConf']['config']['form_type']) {
case 'input':
$item = $this->getSingleField_typeInput($table,$field,$row,$PA);
......@@ -1457,7 +1457,7 @@ class t3lib_TCEforms {
$cols = $config['cols']?$config['cols']:($config['size']?$config['size']:$this->maxInputWidth);
if ($this->docLarge) $cols = round($cols*$this->form_largeComp);
$width = ceil($cols*$this->form_rowsToStylewidth);
// overflow:auto crashes mozilla here. Title tag is usefull when text is longer than the div box (overflow:hidden).
$item = '
<div style="'.htmlspecialchars($divStyle.' overflow:hidden; width:'.$width.'px;').'" class="'.htmlspecialchars($this->formElClass('none')).'" title="'.$itemValue.'">'.
......@@ -3099,10 +3099,25 @@ class t3lib_TCEforms {
global $TCA;
reset($arr);
while(list($k,$v)=each($arr)) {
$arr[$k]=str_replace('###ID_NEW_INDICATOR###',(strstr($rec['uid'],'NEW')?' <span class="typo3-TCEforms-newToken">'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.new',1).'</span>':' <span class="typo3-TCEforms-recUid">['.$rec['uid'].']</span>'),$arr[$k]);
$rLabel = trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table,$rec),40));
$arr[$k]=str_replace('###RECORD_LABEL###',htmlspecialchars($rLabel),$arr[$k]);
$arr[$k]=str_replace('###TABLE_TITLE###',htmlspecialchars($this->sL($TCA[$table]['ctrl']['title'])),$arr[$k]);
// Make "new"-label
if (strstr($rec['uid'],'NEW')) {
$newLabel = ' <span class="typo3-TCEforms-newToken">'.
$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.new',1).
'</span>';
$truePid = t3lib_BEfunc::getTSconfig_pidValue($table,$rec['uid'],$rec['pid']);
$prec = t3lib_BEfunc::getRecord('pages',$truePid,'title');
$rLabel = '<em>[PID: '.$truePid.'] '.htmlspecialchars(trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('pages',$prec),40))).'</em>';
} else {
$newLabel = ' <span class="typo3-TCEforms-recUid">['.$rec['uid'].']</span>';
$rLabel = htmlspecialchars(trim(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table,$rec),40)));
}
// Make substitutions:
$arr[$k] = str_replace('###ID_NEW_INDICATOR###', $newLabel, $arr[$k]);
$arr[$k] = str_replace('###RECORD_LABEL###',$rLabel,$arr[$k]);
$arr[$k] = str_replace('###TABLE_TITLE###',htmlspecialchars($this->sL($TCA[$table]['ctrl']['title'])),$arr[$k]);
$titleA=t3lib_BEfunc::titleAltAttrib($this->getRecordPath($table,$rec));
$arr[$k]=str_replace('###RECORD_ICON###',t3lib_iconWorks::getIconImage($table,$rec,$this->backPath,'class="absmiddle"'.$titleA),$arr[$k]);
......
......@@ -424,6 +424,11 @@ class tx_cms_layout extends recordList {
$onClick = "document.location='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
$theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent'));
$content[$key].= '<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
// Copy for language:
# $onClick = "alert(123);";
# $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent_copyForLang'));
# $content[$key].= '<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
}
// Traverse any selected elements and render their display code:
......@@ -641,7 +646,11 @@ class tx_cms_layout extends recordList {
// Add the big buttons to page:
if ($this->option_showBigButtons) {
$bArray=array();
$bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages]['.$id."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageTitle'));
if (!$GLOBALS['SOBE']->current_sys_language) {
$bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages]['.$id."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageTitle'));
} else {
$bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages_language_overlay]['.$GLOBALS['SOBE']->current_sys_language."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageTitle_curLang'));
}
$bArray[1]=$GLOBALS['SOBE']->doc->t3Button("document.location='".$this->backPath."move_el.php?table=pages&uid=".$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('move_page'));
$bArray[2]=$GLOBALS['SOBE']->doc->t3Button("document.location='".$this->backPath."db_new.php?id=".$id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('newPage2'));
if ($this->ext_function==1) $bArray[3]=$GLOBALS['SOBE']->doc->t3Button("document.location='db_new_content_el.php?id=".$id.'&sys_language_uid='.$GLOBALS['SOBE']->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('newPageContent2'));
......
......@@ -348,6 +348,11 @@ class SC_db_layout {
unset($this->MOD_MENU['function'][0]);
}
// Setting alternative default label:
if ($this->modTSconfig['properties']['defaultLanguageLabel'] && isset($this->MOD_MENU['language'][0])) {
$this->MOD_MENU['language'][0] = $this->modTSconfig['properties']['defaultLanguageLabel'];
}
// Clean up settings
$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
}
......
......@@ -26,8 +26,10 @@
<label index="deleteWarning">Are you sure you want to delete this record?</label>
<label index="editColumn">Edit this column</label>
<label index="editPageTitle">Edit page header</label>
<label index="editPageTitle_curLang">Edit translation header</label>
<label index="editInRTE">Edit in Rich Text Editor</label>
<label index="newPageContent">Create page content</label>
<label index="newPageContent_copyForLang">Copy default content elements</label>
<label index="newPageContent2">New content</label>
<label index="newInColumn">Create new record in top of this column</label>
<label index="records">records</label>
......
......@@ -75,6 +75,8 @@ This will show statistics only for pages that has a Template Record (with Root-f
&lt;b&gt;Hits in main sections&lt;/b&gt;
Will show the total number of page hits/sessions within main sections of a website. A &quot;main section&quot; is all subpages to a page on the first level of a website (defined by a Template Record with the Root flag set).</label>
<label index="_func_hits.image">EXT:cms/cshimages/pagetree_overview_2.png</label>
<label index="lang.alttitle">Localization overview</label>
<label index="lang.description">Gives an overview of which pages in the page tree are translated to the system languages installed.</label>
</languageKey>
<languageKey index="dk">EXT:csh_dk/cms/dk.locallang_csh_webinfo.xml</languageKey>
<languageKey index="de" type="array">
......
......@@ -1987,7 +1987,7 @@ class tslib_cObj {
$this->enableFields('pages');
if ($conf['languageField.'][$search->fTable]) {
$endClause.= ' AND '.$search->fTable.'.'. $conf['languageField.'][$search->fTable].' = '.intval($GLOBALS['TSFE']->sys_language_uid);
$endClause.= ' AND '.$search->fTable.'.'. $conf['languageField.'][$search->fTable].' = '.intval($GLOBALS['TSFE']->sys_language_content);
}
// build query
......@@ -6242,7 +6242,7 @@ class tslib_cObj {
$query.=' AND '.$where;
}
if ($conf['languageField']) {
$query.=' AND '.$conf['languageField'].'='.intval($GLOBALS['TSFE']->sys_language_uid);
$query.=' AND '.$conf['languageField'].'='.intval($GLOBALS['TSFE']->sys_language_content);
}
$andWhere = trim($this->stdWrap($conf['andWhere'],$conf['andWhere.']));
......
......@@ -270,7 +270,9 @@
var $excludeCHashVars=''; // A string set with a comma list of additional GET vars which should NOT be included in the cHash calculation. These vars should otherwise be detected and involved in caching, eg. through a condition in TypoScript.
var $displayEditIcons=''; // If set, edit icons are rendered aside content records. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.
var $displayFieldEditIcons=''; // If set, edit icons are rendered aside individual fields of content. Must be set only if the ->beUserLogin flag is set and set_no_cache() must be called as well.
var $sys_language_uid=0; // Site language, 0 (zero) is default, int+ is uid pointing to a sys_language record.
var $sys_language_uid=0; // Site language, 0 (zero) is default, int+ is uid pointing to a sys_language record. Should reflect which language it DOES actually display!
var $sys_language_mode=''; // Site language mode
var $sys_language_content=0; // Site language selection uid
var $sys_language_isocode = ''; // Is set to the iso code of the sys_language if that is properly defined by the sys_language record representing the sys_language_uid. (Requires the extension "static_info_tables")
// RENDERING data
......@@ -1494,16 +1496,54 @@
* @access private
*/
function settingLanguage() {
$this->sys_language_uid = intval($this->config['config']['sys_language_uid']);
$olRec = $this->sys_page->getPageOverlay($this->id,$this->sys_language_uid);
// Get values from TypoScript:
$this->sys_language_uid = $this->sys_language_content = intval($this->config['config']['sys_language_uid']);
list($this->sys_language_mode,$sys_language_content) = t3lib_div::trimExplode(';', $this->config['config']['sys_language_mode']);
// Request the overlay record for the sys_language_uid:
$olRec = $this->sys_page->getPageOverlay($this->id, $this->sys_language_uid);
// Setting sys_language if an overlay record was found (which it is only if a language is used)
if (!count($olRec)) {
$this->sys_language_uid=0;
// If no OL record exists and a foreign language is asked for...
if ($this->sys_language_uid) {
// If requested translation is not available:
if ($this->page['l18n_cfg']&2) {
$this->pageNotFoundAndExit('Page is not available in the requested language.');
} else {
switch((string)$this->sys_language_mode) {
case 'strict':
$this->pageNotFoundAndExit('Page is not available in the requested language (strict).');
break;
case 'content_fallback':
$fallBackOrder = t3lib_div::trimExplode(',', $sys_language_content,1);
foreach($fallBackOrder as $orderValue) {
if (!strcmp($orderValue,'0') || count($this->sys_page->getPageOverlay($this->id, $orderValue))) {
$this->sys_language_content = $orderValue; // Setting content uid (but leaving the sys_language_uid)
break;
}
}
break;
default:
// Default is that everything defaults to the default language...
$this->sys_language_uid = $this->sys_language_content = 0;
break;
}
}
}
} else {
$this->page = $this->sys_page->getPageOverlay($this->page,$this->sys_language_uid);
$this->page = $this->sys_page->getPageOverlay($this->page, $this->sys_language_uid);
}
$this->sys_page->sys_language_uid = $this->sys_language_uid;
// If default translation is not available:
if (!$this->sys_language_uid && $this->page['l18n_cfg']&1) {
$this->pageNotFoundAndExit('Page is not available in default language.');
}
// Updating content of the two rootLines IF the language key is set!
if ($this->sys_language_uid && is_array($this->tmpl->rootLine)) {
reset($this->tmpl->rootLine);
......
......@@ -724,18 +724,15 @@ class tslib_menu {
// Fill in the menuArr with elements that should go into the menu:
$this->menuArr = Array();
foreach($temp as $data) {
$uid=$data['uid'];
$spacer = (t3lib_div::inList($this->spacerIDList,$data['doktype'])?1:0); // if item is a spacer, $spacer is set
if ($this->mconf['SPC'] || !$spacer) { // If the spacer-function is not enabled, spacers will not enter the $menuArr
if (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype']) && !$data['nav_hide'] && !t3lib_div::inArray($banUidArray,$uid)) { // Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
$c_b++;
if ($begin<=$c_b) { // If the beginning item has been reached.
$this->menuArr[$c]=$data;
$this->menuArr[$c]['isSpacer']=$spacer;
$c++;
if ($maxItems && $c>=$maxItems) {
break;
}
$spacer = t3lib_div::inList($this->spacerIDList,$data['doktype']) ? 1 : 0; // if item is a spacer, $spacer is set
if ($this->filterMenuPages($data, $banUidArray, $spacer)) {
$c_b++;
if ($begin<=$c_b) { // If the beginning item has been reached.
$this->menuArr[$c] = $data;
$this->menuArr[$c]['isSpacer'] = $spacer;
$c++;
if ($maxItems && $c>=$maxItems) {
break;
}
}
}
......@@ -788,6 +785,42 @@ class tslib_menu {
return is_array($menuItemsArray) ? $menuItemsArray : array();
}
/**
* Checks if a page is OK to include in the final menu item array. Pages can be excluded if the doktype is wrong, if they are hidden in navigation, have a uid in the list of banned uids etc.
*
* @param array Array of menu items
* @param array Array of page uids which are to be excluded
* @param boolean If set, then the page is a spacer.
* @return boolean Returns true if the page can be safely included.
*/
function filterMenuPages($data,$banUidArray,$spacer) {
$uid = $data['uid'];
if ($this->mconf['SPC'] || !$spacer) { // If the spacer-function is not enabled, spacers will not enter the $menuArr
if (!t3lib_div::inList($this->doktypeExcludeList,$data['doktype'])) { // Page may not be 'not_in_menu' or 'Backend User Section'
if (!$data['nav_hide']) { // Not hidden in navigation
if (!t3lib_div::inArray($banUidArray,$uid)) { // not in banned uid's
if (!(!$GLOBALS['TSFE']->sys_language_uid && $data['l18n_cfg']&1)) { // Checks if the default language version can be shown:
// Checking if a page should be shown in the menu depending on whether a translation exists:
$tok = TRUE;
if ($GLOBALS['TSFE']->sys_language_uid && $data['l18n_cfg']&2) { // There is an alternative language active AND the current page requires a translation:
$olRec = $GLOBALS['TSFE']->sys_page->getPageOverlay($data['uid'], $GLOBALS['TSFE']->sys_language_uid);
if (!count($olRec)) {
$tok = FALSE;
}
}
// Continue if token is true:
if ($tok) {
return TRUE;
}
}
}
}
}
}
}
/**
* Generating the per-menu-item configuration arrays based on the settings for item states (NO, RO, ACT, CUR etc) set in ->mconf (config for the current menu object)
* Basically it will produce an individual array for each menu item based on the item states. BUT in addition the "optionSplit" syntax for the values is ALSO evaluated here so that all property-values are "option-splitted" and the output will thus be resolved.
......
......@@ -73,7 +73,6 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
return array (
'depth' => array(
0 => $LANG->getLL('depth_0'),
1 => $LANG->getLL('depth_1'),
2 => $LANG->getLL('depth_2'),
3 => $LANG->getLL('depth_3')
......@@ -84,7 +83,7 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
/**
* MAIN function for page information display (including hit statistics)
*
* @return string Output HTML f or the module.
* @return string Output HTML for the module.
*/
function main() {
global $BACK_PATH,$LANG,$SOBE;
......@@ -96,6 +95,9 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
$h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php');
$theOutput.= $h_func;
// Add CSH:
$theOutput.= t3lib_BEfunc::cshItem('_MOD_web_info','lang',$GLOBALS['BACK_PATH'],'|<br/>');
// Showing the tree:
// Initialize starting point of page tree:
$treeStartingPoint = intval($this->pObj->id);
......@@ -120,6 +122,9 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
// Add CSS needed:
$css_content = '
TABLE#langTable {
margin-top: 10px;
}
TABLE#langTable TR TD {
padding-left : 2px;
padding-right : 2px;
......@@ -134,15 +139,21 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
$marker = '/*###POSTCSSMARKER###*/';
$this->pObj->content = str_replace($marker,$css_content.chr(10).$marker,$this->pObj->content);
// Render information table:
$theOutput = $this->renderL10nTable($tree);
$theOutput.= $this->renderL10nTable($tree);
}
return $theOutput;
}
/**
* Rendering the localization information table.
*
* @param array The Page tree data
* @return string HTML for the localization information table.
*/
function renderL10nTable(&$tree) {
global $LANG;
// System languages retrieved:
$languages = $this->getSystemLanguages();
......@@ -153,17 +164,23 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
// Put together the TREE:
$output = '';
$newOL_js = array();
$langRecUids = array();
foreach($tree->tree as $data) {
$tCells = array();
$langRecUids[0][] = $data['row']['uid'];
// Page icons / titles etc.
$tCells[] = '<td>'.$data['HTML'].htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'],$titleLen)).'</td>';
$tCells[] = '<td>'.
$data['HTML'].
htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'],$titleLen)).
(strcmp($data['row']['nav_title'],'') ? ' [Nav: <em>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['nav_title'],$titleLen)).'</em>]' : '').
'</td>';
// DEFAULT language:
// "View page" link is created:
$viewPageLink= '<a href="#" onclick="'.
htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'],$GLOBALS['BACK_PATH'],'','','','&L=###LANG_UID###')).'">'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/zoom.gif','width="12" height="12"').' title="View page" border="0" alt="" />'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->getLL('lang_renderl10n_viewPage','1').'" border="0" alt="" />'.
'</a>';
$status = $data['row']['l18n_cfg']&1 ? 'c-blocked' : 'c-ok';
......@@ -172,22 +189,28 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
$editUid = $data['row']['uid'];
$params = '&edit[pages]['.$editUid.']=edit';
$info.= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="Edit default language page header" border="0" alt="" />'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editDefaultLanguagePage','1').'" border="0" alt="" />'.
'</a>';
$info.= '<a href="#" onclick="'.htmlspecialchars('top.loadEditId('.intval($data['row']['uid']).',"&SET[language]=0"); return false;').'">'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit_page.gif','width="12" height="12"').' title="Edit page" border="0" alt="" />'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit_page.gif','width="12" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editPage','1').'" border="0" alt="" />'.
'</a>';
$info.=str_replace('###LANG_UID###','0',$viewPageLink);
$info.= str_replace('###LANG_UID###','0',$viewPageLink);
$info.= '&nbsp;';
$info.= $data['row']['l18n_cfg']&1 ? '<span title="'.$LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.1','1').'">D</span>' : '&nbsp;';
$info.= $data['row']['l18n_cfg']&2 ? '<span title="'.$LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.2','1').'">N</span>' : '&nbsp;';
// Put into cell:
$tCells[] = '<td class="'.$status.' c-leftLine">'.$info.'</td>';
// Traverse system languages:
foreach($languages as $langRow) {
$row = $this->getLangStatus($data['row']['uid'], $langRow['uid']);
$info = '';
if (is_array($row)) {
$status = $row['hidden'] ? 'c-fallback' : 'c-ok';
$langRecUids[$langRow['uid']][] = $row['uid'];
$status = $row['_HIDDEN'] ? ($data['row']['l18n_cfg']&2 || $data['row']['l18n_cfg']&1 ? 'c-blocked' : 'c-fallback') : 'c-ok';
$icon = t3lib_iconWorks::getIconImage(
'pages_language_overlay',
$row,
......@@ -195,8 +218,10 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
'align="top" class="c-recIcon"'
);
$info = $icon.htmlspecialchars($row['title']).
($row['_COUNT']>1 ? '<div>BAD THING, there are TWO or more records for this language!!!</div>':'');
$info = $icon.
htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],$titleLen)).
(strcmp($row['nav_title'],'') ? ' [Nav: <em>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['nav_title'],$titleLen)).'</em>]' : '').
($row['_COUNT']>1 ? '<div>'.$LANG->getLL('lang_renderl10n_badThingThereAre','1').'</div>':'');
$tCells[] = '<td class="'.$status.' c-leftLine">'.$info.'</td>';
// Edit whole record:
......@@ -204,11 +229,11 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
$editUid = $row['uid'];
$params = '&edit[pages_language_overlay]['.$editUid.']=edit';
$info.= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="Edit language overlay record" border="0" alt="" />'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editLanguageOverlayRecord','1').'" border="0" alt="" />'.
'</a>';
$info.= '<a href="#" onclick="'.htmlspecialchars('top.loadEditId('.intval($data['row']['uid']).',"&SET[language]='.$langRow['uid'].'"); return false;').'">'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit_page.gif','width="12" height="12"').' title="Edit page" border="0" alt="" />'.
'<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit_page.gif','width="12" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editPageLang','1').'" border="0" alt="" />'.
'</a>';
$info.= str_replace('###LANG_UID###',$langRow['uid'],$viewPageLink);
......@@ -237,14 +262,37 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
// Put together HEADER:
$tCells = array();
$tCells[] = '<td>Page:</td>';
$tCells[] = '<td class="c-leftLine">Default:</td>';
$tCells[] = '<td>'.$LANG->getLL('lang_renderl10n_page','1').':</td>';
if (is_array($langRecUids[0])) {
$params = '&edit[pages]['.implode(',',$langRecUids[0]).']=edit&columnsOnly=title,nav_title,l18n_cfg,hidden';
$editIco = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">
<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editPageHeaders','1').'" border="0" alt="" />
</a>';
} else $editIco = '';
$tCells[] = '<td class="c-leftLine">'.
$LANG->getLL('lang_renderl10n_default','1').':'.
$editIco.
'</td>';
foreach($languages as $langRow) {
$params = "'".$newOL_js[$langRow['uid']]."+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=".$langRow['uid'];
// Title:
$tCells[] = '<td class="c-leftLine">'.htmlspecialchars($langRow['title']).'</td>';
$tCells[] = '<td><img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="Edit default language page header" border="0" alt="" /></td>';
// Edit language overlay records:
if (is_array($langRecUids[$langRow['uid']])) {
$params = '&edit[pages_language_overlay]['.implode(',',$langRecUids[$langRow['uid']]).']=edit&columnsOnly=title,nav_title,hidden';
$tCells[] = '<td><a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">
<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_renderl10n_editLangOverlays','1').'" border="0" alt="" />
</a></td>';
} else {
$tCells[] = '<td>&nbsp;</td>';
}
// Create new overlay records:
$params = "'".$newOL_js[$langRow['uid']]."+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=".$langRow['uid'];
$tCells[] = '<td><a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])).'">
<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/new_el.gif','width="11" height="12"').' title="Create new translation headers" border="0" alt="" />
<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/new_el.gif','width="11" height="12"').' title="'.$LANG->getLL('lang_getlangsta_createNewTranslationHeaders','1').'" border="0" alt="" />
</a></td>';
}
......@@ -254,11 +302,19 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
',$tCells).'
</tr>'.$output;
$output = '<table border="0" cellspacing="0" cellpadding="0" id="langTable">'.$output.'</table>';
$output = '
<table border="0" cellspacing="0" cellpadding="0" id="langTable">'.$output.'
</table>';
return $output;
}
/**
* Selects all system languages (from sys_language)
*
* @return array System language records in an array.
*/
function getSystemLanguages() {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
......@@ -274,6 +330,11 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
return $outputArray;
}
/**
* Get an alternative language record for a specific page / language
*
* @return array pages_languages_overlay record
*/
function getLangStatus($pageId, $langId) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
......@@ -286,6 +347,9 @@ class tx_cms_webinfo_lang extends t3lib_extobjbase {
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
if (is_array($row)) {
$row['_COUNT'] = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
$row['_HIDDEN'] = $row['hidden'] ||
(intval($row['endtime']) > 0 && intval($row['endtime']) < time()) ||
(time() < intval($row['starttime']));
}
return $row;
......
......@@ -24,6 +24,19 @@
<label index="pI_lastChange">Last change</label>
<label index="pI_lastChangeContent">Last change, content</label>
<label index="hits_title">Hit Statistics</label>
<label index="lang_renderl10n_viewPage">View page</label>
<label index="lang_renderl10n_editDefaultLanguagePage">Edit default language page header</label>
<label index="lang_renderl10n_editLangOverlays">Edit all language overlay records</label>
<label index="lang_renderl10n_editPageHeaders">Edit all page headers</label>
<label index="lang_renderl10n_editPage">Edit page</label>
<label index="lang_renderl10n_editPageLang">Edit page translation</label>
<label index="lang_renderl10n_hideDefaultTranslationOf">Hide default translation of page</label>
<label index="lang_renderl10n_hidePageIfNo">Hide page if no translation for current language exists</label>
<label index="lang_renderl10n_badThingThereAre">BAD THING, there are TWO or more records for this language!!!</label>
<label index="lang_renderl10n_editLanguageOverlayRecord">Edit language overlay record</label>
<label index="lang_renderl10n_page">Page</label>
<label index="lang_renderl10n_default">Default</label>
<label index="lang_getlangsta_createNewTranslationHeaders">Create new translation headers</label>
</languageKey>
<languageKey index="dk" type="array">
<label index="page_title">Overblik over sidetræ</label>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment