Project

General

Profile

Bug #15871 » browse_links-2.diff

Administrator Admin, 2006-03-29 08:31

View differences:

typo3/browse_links.php 29 Mar 2006 06:26:46 -0000
* @see main()
*/
var $mode;
/**
* holds Instance of main browse_links class
* needed fo intercommunication between various classes that need access to variables via $GLOBALS['SOBE']
* Not the most nice solution but introduced since we don't have another general way to return class-instances or registry for now
*
* @var browse_links
*/
var $browser;
/**
......
// if type was not rendered use default rendering functions
if(!$browserRendered) {
$browser = t3lib_div::makeInstance('browse_links');
$browser->init();
$this->browser = t3lib_div::makeInstance('browse_links');
$this->browser->init();
$modData = $BE_USER->getModuleData('browse_links.php','ses');
list($modData, $store) = $browser->processSessionData($modData);
list($modData, $store) = $this->browser->processSessionData($modData);
$BE_USER->pushModuleData('browse_links.php',$modData);
// Output the correct content according to $this->mode
switch((string)$this->mode) {
case 'rte':
$this->content = $browser->main_rte();
$this->content = $this->browser->main_rte();
break;
case 'db':
$this->content = $browser->main_db();
$this->content = $this->browser->main_db();
break;
case 'file':
case 'filedrag':
$this->content = $browser->main_file();
$this->content = $this->browser->main_file();
break;
case 'wizard':
$this->content = $browser->main_rte(1);
$this->content = $this->browser->main_rte(1);
break;
}
}
typo3/class.browse_links.php 29 Mar 2006 06:26:51 -0000
* @return string
*/
function ext_addP() {
$str = '&act='.$GLOBALS['SOBE']->act.
'&mode='.$GLOBALS['SOBE']->mode.
'&expandPage='.$GLOBALS['SOBE']->expandPage.
'&bparams='.rawurlencode($GLOBALS['SOBE']->bparams);
$str = '&act='.$GLOBALS['SOBE']->browser->act.
'&mode='.$GLOBALS['SOBE']->browser->mode.
'&expandPage='.$GLOBALS['SOBE']->browser->expandPage.
'&bparams='.rawurlencode($GLOBALS['SOBE']->browser->bparams);
return $str;
}
......
foreach($treeArr as $k => $v) {
$c++;
$bgColorClass = ($c+1)%2 ? 'bgColor' : 'bgColor-10';
if ($GLOBALS['SOBE']->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->curUrlInfo['pageid']) {
if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']) {
$arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
$bgColorClass='bgColor4';
} else {
$arrCol='<td></td>';
}
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['row']['uid'].'\');';
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['row']['uid'].'\');';
$cEbullet = $this->ext_isLinkable($v['row']['doktype'],$v['row']['uid']) ?
'<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' :
'';
......
$ficon=t3lib_iconWorks::getIcon('pages',$v);
$onClick = "return insertElement('pages', '".$v['uid']."', 'db', ".t3lib_div::quoteJSvalue($v['title']).", '', '', '".$ficon."','',1);";
} else {
$onClick = htmlspecialchars('return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['uid'].'\');');
$onClick = htmlspecialchars('return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['uid'].'\');');
}
return '<a href="#" onclick="'.$onClick.'">'.$title.'</a>';
}
......
*/
function wrapTitle($title,$v) {
if ($this->ext_isLinkable($v)) {
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
} else {
return '<span class="typo3-dimmed">'.$title.'</span>';
......
$c=0;
// Preparing the current-path string (if found in the listing we will see a red blinking arrow).
if (!$GLOBALS['SOBE']->curUrlInfo['value']) {
if (!$GLOBALS['SOBE']->browser->curUrlInfo['value']) {
$cmpPath='';
} else if (substr(trim($GLOBALS['SOBE']->curUrlInfo['info']),-1)!='/') {
$cmpPath=PATH_site.dirname($GLOBALS['SOBE']->curUrlInfo['info']).'/';
} else if (substr(trim($GLOBALS['SOBE']->browser->curUrlInfo['info']),-1)!='/') {
$cmpPath=PATH_site.dirname($GLOBALS['SOBE']->browser->curUrlInfo['info']).'/';
} else {
$cmpPath=PATH_site.$GLOBALS['SOBE']->curUrlInfo['info'];
$cmpPath=PATH_site.$GLOBALS['SOBE']->browser->curUrlInfo['info'];
}
// Traverse rows for the tree and print them into table rows:
......
$bgColorClass=($c+1)%2 ? 'bgColor' : 'bgColor-10';
// Creating blinking arrow, if applicable:
if ($GLOBALS['SOBE']->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path']) {
if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path']) {
$arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
$bgColorClass='bgColor4';
} else {
$arrCol='<td></td>';
}
// Create arrow-bullet for file listing (if folder path is linkable):
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
$cEbullet = $this->ext_isLinkable($v['row']) ? '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' : '';
// Put table row with folder together:
......
*/
function wrapTitle($title,$v) {
if ($this->ext_isLinkable($v)) {
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
} else {
return '<span class="typo3-dimmed">'.$title.'</span>';
(3-3/3)