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
89 89
	 * @see main()
90 90
	 */
91 91
	var $mode;
92
	
93
	/**
94
	 * holds Instance of main browse_links class
95
	 * needed fo intercommunication between various classes that need access to variables via $GLOBALS['SOBE'] 
96
	 * Not the most nice solution but introduced since we don't have another general way to return class-instances or registry for now
97
	 *
98
	 * @var browse_links
99
	 */
100
	
101
	var $browser;
92 102

  
93 103

  
94 104
	/**
......
140 150
			// if type was not rendered use default rendering functions
141 151
		if(!$browserRendered) {
142 152

  
143
			$browser = t3lib_div::makeInstance('browse_links');
144
			$browser->init();
153
			$this->browser = t3lib_div::makeInstance('browse_links');
154
			$this->browser->init();
145 155

  
146 156
			$modData = $BE_USER->getModuleData('browse_links.php','ses');
147
			list($modData, $store) = $browser->processSessionData($modData);
157
			list($modData, $store) = $this->browser->processSessionData($modData);
148 158
			$BE_USER->pushModuleData('browse_links.php',$modData);
149 159

  
150 160
				// Output the correct content according to $this->mode
151 161
			switch((string)$this->mode)	{
152 162
				case 'rte':
153
					$this->content = $browser->main_rte();
163
					$this->content = $this->browser->main_rte();
154 164
				break;
155 165
				case 'db':
156
					$this->content = $browser->main_db();
166
					$this->content = $this->browser->main_db();
157 167
				break;
158 168
				case 'file':
159 169
				case 'filedrag':
160
					$this->content = $browser->main_file();
170
					$this->content = $this->browser->main_file();
161 171
				break;
162 172
				case 'wizard':
163
					$this->content = $browser->main_rte(1);
173
					$this->content = $this->browser->main_rte(1);
164 174
				break;
165 175
			}
166 176
		}
typo3/class.browse_links.php 29 Mar 2006 06:26:51 -0000
192 192
	 * @return	string
193 193
	 */
194 194
	function ext_addP()	{
195
		$str = '&act='.$GLOBALS['SOBE']->act.
196
				'&mode='.$GLOBALS['SOBE']->mode.
197
				'&expandPage='.$GLOBALS['SOBE']->expandPage.
198
				'&bparams='.rawurlencode($GLOBALS['SOBE']->bparams);
195
		$str = '&act='.$GLOBALS['SOBE']->browser->act.
196
				'&mode='.$GLOBALS['SOBE']->browser->mode.
197
				'&expandPage='.$GLOBALS['SOBE']->browser->expandPage.
198
				'&bparams='.rawurlencode($GLOBALS['SOBE']->browser->bparams);
199 199
		return $str;
200 200
	}
201 201

  
......
307 307
		foreach($treeArr as $k => $v)	{
308 308
			$c++;
309 309
			$bgColorClass = ($c+1)%2 ? 'bgColor' : 'bgColor-10';
310
			if ($GLOBALS['SOBE']->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->curUrlInfo['pageid'])	{
310
			if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'])	{
311 311
				$arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
312 312
				$bgColorClass='bgColor4';
313 313
			} else {
314 314
				$arrCol='<td></td>';
315 315
			}
316 316

  
317
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['row']['uid'].'\');';
317
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['row']['uid'].'\');';
318 318
			$cEbullet = $this->ext_isLinkable($v['row']['doktype'],$v['row']['uid']) ?
319 319
						'<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' :
320 320
						'';
......
440 440
			$ficon=t3lib_iconWorks::getIcon('pages',$v);
441 441
			$onClick = "return insertElement('pages', '".$v['uid']."', 'db', ".t3lib_div::quoteJSvalue($v['title']).", '', '', '".$ficon."','',1);";
442 442
		} else {
443
			$onClick = htmlspecialchars('return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['uid'].'\');');
443
			$onClick = htmlspecialchars('return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['uid'].'\');');
444 444
		}
445 445
		return '<a href="#" onclick="'.$onClick.'">'.$title.'</a>';
446 446
	}
......
484 484
	 */
485 485
	function wrapTitle($title,$v)	{
486 486
		if ($this->ext_isLinkable($v))	{
487
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
487
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
488 488
			return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
489 489
		} else {
490 490
			return '<span class="typo3-dimmed">'.$title.'</span>';
......
539 539
		$c=0;
540 540

  
541 541
			// Preparing the current-path string (if found in the listing we will see a red blinking arrow).
542
		if (!$GLOBALS['SOBE']->curUrlInfo['value'])	{
542
		if (!$GLOBALS['SOBE']->browser->curUrlInfo['value'])	{
543 543
			$cmpPath='';
544
		} else if (substr(trim($GLOBALS['SOBE']->curUrlInfo['info']),-1)!='/')	{
545
			$cmpPath=PATH_site.dirname($GLOBALS['SOBE']->curUrlInfo['info']).'/';
544
		} else if (substr(trim($GLOBALS['SOBE']->browser->curUrlInfo['info']),-1)!='/')	{
545
			$cmpPath=PATH_site.dirname($GLOBALS['SOBE']->browser->curUrlInfo['info']).'/';
546 546
		} else {
547
			$cmpPath=PATH_site.$GLOBALS['SOBE']->curUrlInfo['info'];
547
			$cmpPath=PATH_site.$GLOBALS['SOBE']->browser->curUrlInfo['info'];
548 548
		}
549 549

  
550 550
			// Traverse rows for the tree and print them into table rows:
......
553 553
			$bgColorClass=($c+1)%2 ? 'bgColor' : 'bgColor-10';
554 554

  
555 555
				// Creating blinking arrow, if applicable:
556
			if ($GLOBALS['SOBE']->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path'])	{
556
			if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path'])	{
557 557
				$arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
558 558
				$bgColorClass='bgColor4';
559 559
			} else {
560 560
				$arrCol='<td></td>';
561 561
			}
562 562
				// Create arrow-bullet for file listing (if folder path is linkable):
563
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
563
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
564 564
			$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>' : '';
565 565

  
566 566
				// Put table row with folder together:
......
636 636
	 */
637 637
	function wrapTitle($title,$v)	{
638 638
		if ($this->ext_isLinkable($v))	{
639
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
639
			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
640 640
			return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
641 641
		} else {
642 642
			return '<span class="typo3-dimmed">'.$title.'</span>';
(3-3/3)