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

* Created new function, t3lib_div::fixed_lgd_cs(), which should be used in the backend wherever a string is shortend for visual display. This function will truncate the string according to the backend charset (which should of course be set by forceCharset to a fixed value).


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@309 709f56b5-9817-0410-a4d7-c38de5d9e867
parent f00bffea
2004-05-18 Kasper Skårhøj,,, <kasper@typo3.com>
* Created new function, t3lib_div::fixed_lgd_cs(), which should be used in the backend wherever a string is shortend for visual display. This function will truncate the string according to the backend charset (which should of course be set by forceCharset to a fixed value). This new function has also been substituted numerous places in the source of course (hence all the script updates).
2004-05-17 Kasper Skårhøj,,, <kasper@typo3.com>
* Moved "install" extension to be a sys extension in sysext/
......@@ -40,7 +44,7 @@
2004-04-26 Kasper Skårhøj,,, <kasper@typo3.com>
* Added prefix to relative file reference in @import style sheet
* Added prefix to relative file reference in @import style sheet
2004-04-26 Kasper Skårhøj,,, <kasper@typo3.com>
......
......@@ -131,7 +131,7 @@ class t3lib_admin {
$PM = 'join';
$LN = ($a==$c)?'blank':'line';
$BTM = ($a==$c)?'bottom':'';
$this->genTree_HTML.= $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$PM.$BTM.'.gif','width="18" height="16"').' align="top" alt="" />'.t3lib_iconWorks::getIconImage('pages',$row,$this->backPath,'align="top"').htmlspecialchars($row['uid'].': '.t3lib_div::fixed_lgd(strip_tags($row['title']),50)).'</span></div>';
$this->genTree_HTML.= $depthData.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$PM.$BTM.'.gif','width="18" height="16"').' align="top" alt="" />'.t3lib_iconWorks::getIconImage('pages',$row,$this->backPath,'align="top"').htmlspecialchars($row['uid'].': '.t3lib_div::fixed_lgd_cs(strip_tags($row['title']),50)).'</span></div>';
}
if (isset($page_idlist[$newID])) {
......
......@@ -593,8 +593,8 @@ class t3lib_BEfunc {
);
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$uid = $row['pid'];
$output = '/'.t3lib_div::fixed_lgd(strip_tags($row['title']),$titleLimit).$output;
if ($fullTitleLimit) $fullOutput = '/'.t3lib_div::fixed_lgd(strip_tags($row['title']),$fullTitleLimit).$fullOutput;
$output = '/'.t3lib_div::fixed_lgd_cs(strip_tags($row['title']),$titleLimit).$output;
if ($fullTitleLimit) $fullOutput = '/'.t3lib_div::fixed_lgd_cs(strip_tags($row['title']),$fullTitleLimit).$fullOutput;
} else {
break;
}
......@@ -1644,7 +1644,7 @@ class t3lib_BEfunc {
if ($TCA[$table]['ctrl']['label_alt_force']) $t=implode(', ',$tA);
}
if ($prep) {
$t = htmlspecialchars(t3lib_div::fixed_lgd($t,$GLOBALS['BE_USER']->uc['titleLen']));
$t = htmlspecialchars(t3lib_div::fixed_lgd_cs($t,$GLOBALS['BE_USER']->uc['titleLen']));
if (!strcmp(trim($t),'')) $t='<em>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</em>';
}
return $t;
......@@ -1737,12 +1737,12 @@ class t3lib_BEfunc {
} elseif ($theColConf['MM']) {
$l='N/A';
} elseif ($value) {
$l=t3lib_div::fixed_lgd(strip_tags($value),200);
$l=t3lib_div::fixed_lgd_cs(strip_tags($value),200);
}
break;
}
if ($fixed_lgd_chars) {
return t3lib_div::fixed_lgd($l,$fixed_lgd_chars);
return t3lib_div::fixed_lgd_cs($l,$fixed_lgd_chars);
} else {
return $l;
}
......
......@@ -382,7 +382,7 @@ class t3lib_clipboard {
$lines[]='
<tr>
<td class="'.$bgColClass.'">'.$icon.'</td>
<td class="'.$bgColClass.'" nowrap="nowrap" width="95%">&nbsp;'.$this->linkItemText(htmlspecialchars(t3lib_div::fixed_lgd(basename($v),$GLOBALS['BE_USER']->uc['titleLen'])),$v).
<td class="'.$bgColClass.'" nowrap="nowrap" width="95%">&nbsp;'.$this->linkItemText(htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($v),$GLOBALS['BE_USER']->uc['titleLen'])),$v).
($pad=='normal'?(' <strong>('.($this->clipData['normal']['mode']=='copy'?$this->clLabel('copy','cm'):$this->clLabel('cut','cm')).')</strong>'):'').'&nbsp;'.($thumb?'<br />'.$thumb:'').'</td>
<td class="'.$bgColClass.'" align="center">'.
'<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$v.'\', \'\'); return false;').'"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom2.gif','width="12" height="12"').' hspace="2" border="0" title="'.$this->clLabel('info','cm').'" alt="" /></a>'.
......@@ -400,7 +400,7 @@ class t3lib_clipboard {
$lines[]='
<tr>
<td class="'.$bgColClass.'">'.$this->linkItemText(t3lib_iconWorks::getIconImage($table,$rec,$this->backPath,'hspace="20" title="'.htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($rec,$table)).'"'),$rec,$table).'</td>
<td class="'.$bgColClass.'" nowrap="nowrap" width="95%">&nbsp;'.$this->linkItemText(htmlspecialchars(t3lib_div::fixed_lgd(t3lib_BEfunc::getRecordTitle($table,$rec),$GLOBALS['BE_USER']->uc['titleLen'])),$rec,$table).
<td class="'.$bgColClass.'" nowrap="nowrap" width="95%">&nbsp;'.$this->linkItemText(htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table,$rec),$GLOBALS['BE_USER']->uc['titleLen'])),$rec,$table).
($pad=='normal'?(' <strong>('.($this->clipData['normal']['mode']=='copy'?$this->clLabel('copy','cm'):$this->clLabel('cut','cm')).')</strong>'):'').'&nbsp;</td>
<td class="'.$bgColClass.'" align="center">'.
'<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.intval($uid).'\'); return false;').'"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom2.gif','width="12" height="12"').' hspace="2" border="0" title="'.$this->clLabel('info','cm').'" alt="" /></a>'.
......@@ -701,8 +701,8 @@ class t3lib_clipboard {
// Message:
$conf='confirm('.$GLOBALS['LANG']->JScharCode(sprintf(
$msg,
t3lib_div::fixed_lgd($selRecTitle,30),
t3lib_div::fixed_lgd($thisRecTitle,30)
t3lib_div::fixed_lgd_cs($selRecTitle,30),
t3lib_div::fixed_lgd_cs($thisRecTitle,30)
)).')';
return $conf;
}
......
......@@ -186,7 +186,7 @@ class t3lib_diff {
*/
function addClearBuffer($clearBuffer,$last=0) {
if (strlen($clearBuffer)>200) {
$clearBuffer=($this->clearBufferIdx?t3lib_div::fixed_lgd($clearBuffer,70):'').'['.strlen($clearBuffer).']'.(!$last?t3lib_div::fixed_lgd_pre($clearBuffer,70):'');
$clearBuffer=($this->clearBufferIdx?t3lib_div::fixed_lgd_cs($clearBuffer,70):'').'['.strlen($clearBuffer).']'.(!$last?t3lib_div::fixed_lgd_cs($clearBuffer,-70):'');
}
$this->clearBufferIdx++;
return $clearBuffer;
......
......@@ -467,19 +467,23 @@ class t3lib_div {
* Truncate string
* Returns a new string of max. $chars length.
* If the string is longer, it will be truncated and appended with '...'.
* DEPRECIATED. Works ONLY for single-byte charsets! USE t3lib_div::fixed_lgd_cs() instead
*
* Usage: 119
*
* @param string $string string to truncate
* @param integer $chars must be an integer of at least 4
* @param integer $chars must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
* @param string String to append to the the output if it is truncated, default is '...'
* @return string new string
* @see fixed_lgd_pre()
*/
function fixed_lgd($string,$chars,$preStr='...') {
function fixed_lgd($string,$origChars,$preStr='...') {
$chars = abs($origChars);
if ($chars >= 4) {
if(strlen($string)>$chars) {
return trim(substr($string, 0, $chars-3)).$preStr;
return $origChars < 0 ?
$preStr.trim(substr($string, -($chars-3))) :
trim(substr($string, 0, $chars-3)).$preStr;
}
}
return $string;
......@@ -490,6 +494,7 @@ class t3lib_div {
* Returns a new string of max. $chars length.
* If the string is longer, it will be truncated and prepended with '...'.
* This works like fixed_lgd, but is truncated in the start of the string instead of the end
* DEPRECIATED. Use either fixed_lgd() or fixed_lgd_cs() (with negative input value for $chars)
*
* Usage: 19
*
......@@ -502,6 +507,23 @@ class t3lib_div {
return strrev(t3lib_div::fixed_lgd(strrev($string),$chars));
}
/**
* Truncates a string with appended/prepended "..." and takes backend character set into consideration
* Use only from backend!
*
* @param string $string string to truncate
* @param integer $chars must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
* @return string New string
* @see fixed_lgd()
*/
function fixed_lgd_cs($string,$chars) {
if (is_object($GLOBALS['LANG'])) {
return $GLOBALS['LANG']->csConvObj->crop($this->charSet,$string,$chars,'...');
} else {
return t3lib_div::fixed_lgd($string, $chars);
}
}
/**
* Breaks up the text for emails
*
......@@ -732,7 +754,7 @@ class t3lib_div {
*/
function uniqueList() {
$listArray = array();
$arg_list = func_get_args();
foreach ($arg_list as $in_list) {
if (!is_array($in_list)) {
......@@ -844,8 +866,8 @@ class t3lib_div {
/**
* strtoupper which converts danish (and other characters) characters as well
* (Depreciated, use PHP function with locale settings instead or for HTML output, wrap your content in <span class="uppercase">...</span>)
* Usage: 4
* (DEPRECIATED, use t3lib_cs::conv_case() instead or for HTML output, wrap your content in <span class="uppercase">...</span>)
* Usage: 0
*
* @param string String to process
* @return string
......
......@@ -342,7 +342,7 @@ class t3lib_loadDBGroup {
foreach($this->itemArray as $key => $val) {
$theRow = $this->results[$val['table']][$val['id']];
if ($theRow && is_array($TCA[$val['table']])) {
$label = t3lib_div::fixed_lgd(strip_tags($theRow[$TCA[$val['table']]['ctrl']['label']]),$titleLen);
$label = t3lib_div::fixed_lgd_cs(strip_tags($theRow[$TCA[$val['table']]['ctrl']['label']]),$titleLen);
$label = ($label)?$label:'[...]';
$output[]=str_replace(',','',$val['table'].'_'.$val['id'].'|'.rawurlencode($label));
}
......
......@@ -498,7 +498,7 @@ class t3lib_pageSelect {
$path = '';
for ($a=0;$a<$c;$a++) {
if ($rl[$a]['uid']) {
$path.='/'.t3lib_div::fixed_lgd(strip_tags($rl[$a]['title']),$len);
$path.='/'.t3lib_div::fixed_lgd_cs(strip_tags($rl[$a]['title']),$len);
}
}
return $path;
......
......@@ -204,7 +204,7 @@ class t3lib_positionMap {
// The line with the icon and title:
$t_code='<span class="nobr">'.
$dat['HTML'].
$this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd($dat['row']['title'],$BE_USER->uc['titleLen'])),$dat,$id),$dat['row']).
$this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd_cs($dat['row']['title'],$BE_USER->uc['titleLen'])),$dat,$id),$dat['row']).
'</span><br />';
$code.=$t_code;
}
......
......@@ -1624,7 +1624,7 @@ class t3lib_TCEforms {
$rowCells=array();
// Icon:
$rowCells['title'] = '<img src="clear.gif" width="'.($level*16).'" height="1" alt="" /><strong>'.htmlspecialchars(t3lib_div::fixed_lgd($this->sL($value['tx_templavoila']['title']),30)).'</strong>';;
$rowCells['title'] = '<img src="clear.gif" width="'.($level*16).'" height="1" alt="" /><strong>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->sL($value['tx_templavoila']['title']),30)).'</strong>';;
$rowCells['formEl']='';
if ($value['type']=='array') {
......@@ -2063,7 +2063,7 @@ class t3lib_TCEforms {
while(list(,$pp)=each($itemArray)) {
$pRec = t3lib_BEfunc::getRecord($pp['table'],$pp['id']);
if (is_array($pRec)) {
$pTitle = t3lib_div::fixed_lgd($this->noTitle($pRec[$GLOBALS['TCA'][$pp['table']]['ctrl']['label']]),$this->titleLen);
$pTitle = t3lib_div::fixed_lgd_cs($this->noTitle($pRec[$GLOBALS['TCA'][$pp['table']]['ctrl']['label']]),$this->titleLen);
$pUid = $pp['table'].'_'.$pp['id'];
$uidList[]=$pUid;
$opt[]='<option value="'.htmlspecialchars($pUid).'">'.htmlspecialchars($pTitle).'</option>';
......@@ -2841,7 +2841,7 @@ class t3lib_TCEforms {
} else $icon='';
// Add the item:
$items[] = array(
t3lib_div::fixed_lgd($lPrefix.strip_tags(t3lib_BEfunc::getRecordTitle($f_table,$row)),$this->titleLen),
t3lib_div::fixed_lgd_cs($lPrefix.strip_tags(t3lib_BEfunc::getRecordTitle($f_table,$row)),$this->titleLen),
$uidPre.$row['uid'],
$icon
);
......@@ -3032,7 +3032,7 @@ class t3lib_TCEforms {
reset($arr);
while(list($k,$v)=each($arr)) {
$arr[$k]=str_replace('###ID_NEW_INDICATOR###',(strstr($rec['uid'],'NEW')?' <font color="red"><b>'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.new',1).'</b></font>':' ['.$rec['uid'].']'),$arr[$k]);
$rLabel = trim(t3lib_div::fixed_lgd(t3lib_BEfunc::getRecordTitle($table,$rec),40));
$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]);
......
......@@ -244,10 +244,10 @@ class t3lib_transferData {
/**
* This function performs processing on the input $row array and stores internally a corresponding array which contains processed values, ready to pass on to the TCEforms rendering in the frontend!
* The objective with this function is to prepare the content for handling in TCEforms.
* In opposite to renderRecord() this function do not prepare things like fetching TSconfig and others.
* The objective with this function is to prepare the content for handling in TCEforms.
* In opposite to renderRecord() this function do not prepare things like fetching TSconfig and others.
* The resulting, processed row will be returned.
*
*
* @param string The table name
* @param string The uid value of the record (integer). Can also be a string (NEW-something) if the record is a NEW record.
* @param integer The pid integer. For existing records this is of course the row's "pid" field. For new records it can be either a page id (positive) or a pointer to another record from the SAME table (negative) after which the record should be inserted (or on same page)
......@@ -298,9 +298,9 @@ class t3lib_transferData {
// Finally, store the result:
reset($totalRecordContent);
return $totalRecordContent;
}
/**
......@@ -791,11 +791,11 @@ class t3lib_transferData {
if (isset($recordList[$theId])) {
$lPrefix = $this->sL($fieldConfig['config'][($theId>0?'':'neg_').'foreign_table_prefix']);
if ($fieldConfig['config']['MM']) {
$dataAcc[]=rawurlencode($theId).'|'.rawurlencode(t3lib_div::fixed_lgd($lPrefix.strip_tags($recordList[$theId]),$GLOBALS['BE_USER']->uc['titleLen']));
$dataAcc[]=rawurlencode($theId).'|'.rawurlencode(t3lib_div::fixed_lgd_cs($lPrefix.strip_tags($recordList[$theId]),$GLOBALS['BE_USER']->uc['titleLen']));
} else {
foreach($elements as $eKey => $value) {
if (!strcmp($theId,$value)) {
$dataAcc[$eKey]=rawurlencode($theId).'|'.rawurlencode(t3lib_div::fixed_lgd($lPrefix.strip_tags($recordList[$theId]),$GLOBALS['BE_USER']->uc['titleLen']));
$dataAcc[$eKey]=rawurlencode($theId).'|'.rawurlencode(t3lib_div::fixed_lgd_cs($lPrefix.strip_tags($recordList[$theId]),$GLOBALS['BE_USER']->uc['titleLen']));
}
}
}
......
......@@ -324,7 +324,7 @@ class t3lib_treeView {
$this->recs = array();
$this->ids = array();
$this->ids_hierarchy = array();
// setting this to false disables the use of array-trees by default
$this->data = false;
$this->dataLookup = false;
......@@ -664,7 +664,7 @@ class t3lib_treeView {
* @return string The title.
*/
function getTitleStr($row,$titleLen=30) {
$title = (!strcmp(trim($row['title']),'')) ? '<em>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</em>' : htmlspecialchars(t3lib_div::fixed_lgd($row['title'],$titleLen));
$title = (!strcmp(trim($row['title']),'')) ? '<em>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</em>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],$titleLen));
return $title;
}
......@@ -1064,7 +1064,7 @@ class t3lib_TCEforms_SelectTreeView extends t3lib_treeview {
var $TCEforms_itemFormElName='';
var $TCEforms_nonSelectableItemsArray=array();
function wrapTitle($title,$v) {
if($v['uid']>0) {
if (in_array($v['uid'],$this->TCEforms_nonSelectableItemsArray)) {
......@@ -1078,9 +1078,9 @@ class t3lib_TCEforms_SelectTreeView extends t3lib_treeview {
}
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_treeview.php']) {
......
......@@ -573,7 +573,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
$A_B="";
$A_E="";
}
$HTML.=($first?'':'<IMG src="'.$GLOBALS["BACK_PATH"].'t3lib/gfx/ol/'.$PM.$BTM.'.gif" width="18" height="16" align="top" border=0>').'<IMG src="'.$GLOBALS["BACK_PATH"].$icon.'" width="18" height="16" align="top" title="'.$alttext.'">'.$A_B.t3lib_div::fixed_lgd($row['title'],$GLOBALS["BE_USER"]->uc["titleLen"]).$A_E."&nbsp;&nbsp;";
$HTML.=($first?'':'<IMG src="'.$GLOBALS["BACK_PATH"].'t3lib/gfx/ol/'.$PM.$BTM.'.gif" width="18" height="16" align="top" border=0>').'<IMG src="'.$GLOBALS["BACK_PATH"].$icon.'" width="18" height="16" align="top" title="'.$alttext.'">'.$A_B.t3lib_div::fixed_lgd_cs($row['title'],$GLOBALS["BE_USER"]->uc["titleLen"]).$A_E."&nbsp;&nbsp;";
$RL = $this->ext_getRootlineNumber($row['pid']);
$keyArray[] = '<tr>
<td nowrap>'.$HTML.'</td>
......@@ -1104,7 +1104,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
}
if (strlen($head)>35) {
if (!$body) {$body=$head;}
$head=t3lib_div::fixed_lgd($head,35);
$head=t3lib_div::fixed_lgd_cs($head,35);
}
$typeDat=$this->ext_getTypeData($params["type"]);
$checked="";
......
......@@ -272,7 +272,7 @@ class clickMenu {
$selItem = $this->clipObj->getSelectedRecord();
$elInfo=array(
$selItem['_RECORD_TITLE'],
($root?$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']:t3lib_div::fixed_lgd(t3lib_BEfunc::getRecordTitle($table,$this->rec),$BE_USER->uc['titleLen'])),
($root?$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']:t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table,$this->rec),$BE_USER->uc['titleLen'])),
$this->clipObj->currentMode()
);
if ($table=='pages' && ($lCP & 8)) {
......@@ -284,7 +284,7 @@ class clickMenu {
}
// Delete:
$elInfo=array(t3lib_div::fixed_lgd(t3lib_BEfunc::getRecordTitle($table,$this->rec),$BE_USER->uc['titleLen']));
$elInfo=array(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table,$this->rec),$BE_USER->uc['titleLen']));
if(!in_array('delete',$this->disabledItems) && !$root && $BE_USER->isPSet($lCP,$table,'delete')) {
$menuItems[]='spacer';
$menuItems['delete']=$this->DB_delete($table,$uid,$elInfo);
......
......@@ -287,7 +287,7 @@ class SC_alt_shortcut {
$this->lines[]='<td class="'.$bgColorClass.'"><a href="#" onclick="'.htmlspecialchars($onC).'"><img src="'.$this->getIcon($row['module_name']).'" title="'.htmlspecialchars($titleA).'" alt="" /></a></td>';
if (trim($row['description'])) {
$kkey = strtolower(substr($row['description'],0,20)).'_'.$row['uid'];
$this->selOpt[$kkey]='<option value="'.htmlspecialchars($jumpSC).'">'.htmlspecialchars(t3lib_div::fixed_lgd($row['description'],50)).'</option>';
$this->selOpt[$kkey]='<option value="'.htmlspecialchars($jumpSC).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['description'],50)).'</option>';
}
$formerGr=$row['sc_group'];
}
......
......@@ -206,7 +206,7 @@ class TBE_browser_recordList extends localRecordList {
if (!$code) {
$code = '<i>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</i>';
} else {
$code = htmlspecialchars(t3lib_div::fixed_lgd($code,$this->fixedL));
$code = htmlspecialchars(t3lib_div::fixed_lgd_cs($code,$this->fixedL));
}
$titleCol = $TCA[$table]['ctrl']['label'];
......@@ -543,7 +543,7 @@ class localFolderTree extends t3lib_folderTree {
// Put table row with folder together:
$out.='
<tr class="'.$bgColorClass.'">
<td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd($v['row']['title'],$titleLen),$v['row']).'</td>
<td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd_cs($v['row']['title'],$titleLen),$v['row']).'</td>
'.$arrCol.'
<td>'.$cEbullet.'</td>
</tr>';
......@@ -1492,7 +1492,7 @@ class SC_browse_links {
$titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']);
$mainPageRec = t3lib_BEfunc::getRecord('pages',$expPageId);
$picon = t3lib_iconWorks::getIconImage('pages',$mainPageRec,'','');
$picon.= htmlspecialchars(t3lib_div::fixed_lgd($mainPageRec['title'],$titleLen));
$picon.= htmlspecialchars(t3lib_div::fixed_lgd_cs($mainPageRec['title'],$titleLen));
$out.= $picon.'<br />';
// Look up tt_content elements from the expanded page:
......@@ -1520,7 +1520,7 @@ class SC_browse_links {
$arrCol.
'<a href="#" onclick="return link_typo3Page(\''.$expPageId.'\',\'#'.$row['uid'].'\');">'.
$icon.
htmlspecialchars(t3lib_div::fixed_lgd($row['header'],$titleLen)).
htmlspecialchars(t3lib_div::fixed_lgd_cs($row['header'],$titleLen)).
'</a><br />';
// Finding internal anchor points:
......@@ -1582,7 +1582,7 @@ class SC_browse_links {
}
$picon=t3lib_iconWorks::getIconImage('pages',$mainPageRec,'','');
$pBicon=$ATag2?'<img'.t3lib_iconWorks::skinImg('','gfx/plusbullet2.gif','width="18" height="16"').' alt="" />':'';
$pText=htmlspecialchars(t3lib_div::fixed_lgd($mainPageRec['title'],$titleLen));
$pText=htmlspecialchars(t3lib_div::fixed_lgd_cs($mainPageRec['title'],$titleLen));
$out.=$picon.$ATag2.$pBicon.$ATag_e.$ATag.$pText.$ATag_e.'<br />';
// Initialize the record listing:
......@@ -1662,7 +1662,7 @@ class SC_browse_links {
// Create header element; The folder from which files are listed.
$titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
$picon='<img'.t3lib_iconWorks::skinImg('','gfx/i/_icon_webfolders.gif','width="18" height="16"').' alt="" />';
$picon.=htmlspecialchars(t3lib_div::fixed_lgd(basename($expandFolder),$titleLen));
$picon.=htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($expandFolder),$titleLen));
$picon='<a href="#" onclick="return link_folder(\''.t3lib_div::rawUrlEncodeFP(substr($expandFolder,strlen(PATH_site))).'\');">'.$picon.'</a>';
$out.=$picon.'<br />';
......@@ -1695,7 +1695,7 @@ class SC_browse_links {
$arrCol.
'<a href="#" onclick="return link_folder(\''.t3lib_div::rawUrlEncodeFP(substr($filepath,strlen(PATH_site))).'\');">'.
$icon.
htmlspecialchars(t3lib_div::fixed_lgd(basename($filepath),$titleLen)).
htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($filepath),$titleLen)).
'</a><br />';
}
}
......@@ -1728,7 +1728,7 @@ class SC_browse_links {
// Create the header of current folder:
$titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
$picon='<img'.t3lib_iconWorks::skinImg('','gfx/i/_icon_webfolders.gif','width="18" height="16"').' alt="" />';
$picon.=htmlspecialchars(t3lib_div::fixed_lgd(basename($expandFolder),$titleLen));
$picon.=htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($expandFolder),$titleLen));
$out.=$picon.'<br />';
// Init graphic object for reading file dimensions:
......@@ -1773,7 +1773,7 @@ class SC_browse_links {
$ATag2_e='</a>';
// Combine the stuff:
$filenameAndIcon=$ATag_alt.$icon.htmlspecialchars(t3lib_div::fixed_lgd(basename($filepath),$titleLen)).$ATag_e;
$filenameAndIcon=$ATag_alt.$icon.htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($filepath),$titleLen)).$ATag_e;
// Show element:
if ($pDim) { // Image...
......@@ -1843,7 +1843,7 @@ class SC_browse_links {
$titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
$picon='<img'.t3lib_iconWorks::skinImg('','gfx/i/_icon_webfolders.gif','width="18" height="16"').' alt="" />';
$picon.=htmlspecialchars(t3lib_div::fixed_lgd(basename($expandFolder),$titleLen));
$picon.=htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($expandFolder),$titleLen));
$out.=$picon.'<br />';
// Init row-array:
......@@ -1870,7 +1870,7 @@ class SC_browse_links {
$ficon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
$size=' ('.t3lib_div::formatSize(filesize($filepath)).'bytes'.($pDim?', '.$pDim:'').')';
$icon = '<img'.t3lib_iconWorks::skinImg('','gfx/fileicons/'.$ficon,'width="18" height="16"').' class="absmiddle" title="'.htmlspecialchars($fI['basename'].$size).'" alt="" />';
$filenameAndIcon=$icon.htmlspecialchars(t3lib_div::fixed_lgd(basename($filepath),$titleLen));
$filenameAndIcon=$icon.htmlspecialchars(t3lib_div::fixed_lgd_cs(basename($filepath),$titleLen));
if (t3lib_div::_GP('noLimit')) {
$maxW=10000;
......@@ -2071,7 +2071,7 @@ class SC_browse_links {
$pageRow = t3lib_BEfunc::getRecord('pages',$id);
$titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
$info['value']=$GLOBALS['LANG']->getLL('page',1)." '".htmlspecialchars(t3lib_div::fixed_lgd($pageRow['title'],$titleLen))."' (ID:".$id.($uP['fragment']?', #'.$uP['fragment']:'').')';
$info['value']=$GLOBALS['LANG']->getLL('page',1)." '".htmlspecialchars(t3lib_div::fixed_lgd_cs($pageRow['title'],$titleLen))."' (ID:".$id.($uP['fragment']?', #'.$uP['fragment']:'').')';
$info['pageid']=$id;
$info['cElement']=$uP['fragment'];
$info['act']='page';
......
......@@ -511,7 +511,7 @@ class recordList extends t3lib_recordList {
if (!strcmp($code,'')) {
$code = '<i>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</i> - '.htmlspecialchars(t3lib_BEfunc::getRecordTitle($table,$row));
} else {
$code = htmlspecialchars(t3lib_div::fixed_lgd($code,$this->fixedL));
$code = htmlspecialchars(t3lib_div::fixed_lgd_cs($code,$this->fixedL));
}
switch((string)$this->clickTitleMode) {
......
......@@ -236,7 +236,7 @@ class localRecordList extends recordList {
if ($this->id) { // If there IS a real page...:
// Setting title of page + the "Go up" link:
$theData[$titleCol].='<br /><span title="'.htmlspecialchars($row['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($row['_thePath'],$this->fixedL)).'</span>';
$theData[$titleCol].='<br /><span title="'.htmlspecialchars($row['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['_thePath'],-$this->fixedL)).'</span>';
$theData['up'][]='<a href="'.htmlspecialchars($this->listURL($row['pid'])).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/pages_up.gif','width="18" height="16"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />'.
'</a>';
......@@ -246,7 +246,7 @@ class localRecordList extends recordList {
} else { // On root-level of page tree:
// Setting title of root (sitename):
$theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_pre($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],$this->fixedL));
$theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_cs($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],-$this->fixedL));
// Make Icon:
$theIcon='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/_icon_website.gif','width="18" height="16"').' alt="" />';
......
......@@ -170,12 +170,12 @@ class fileList extends t3lib_recordList {
$theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$path);
$theData[$titleCol].='<br />'.t3lib_div::fixed_lgd_pre($title,$this->fixedL+20); // No HTML specialchars here - HTML like <b> </b> is allowed
$theData[$titleCol].='<br />'.t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)); // No HTML specialchars here - HTML like <b> </b> is allowed
$theData['up'].=$this->linkWrapDir('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/folder_up.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />',$theFile['path']);
} else {
// root:0
$theIcon='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/_icon_ftp.gif','width="18" height="16"').' alt="" />';
$theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_pre($title,$this->fixedL+20));
$theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)));
}
// Adding top element
......
......@@ -120,7 +120,7 @@ class SC_mod_web_func_index extends t3lib_SCbase {
$headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.
'<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)).'</span>';
'<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50)).'</span>';
// Draw the header.
$this->content.=$this->doc->startPage($LANG->getLL('title'));
......
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