Bug #77467 » previewInfot_typo3_4.5.txt

Danilo Caccialanza, 2016-08-10 14:00

 
1
//TYPO3 4.5
2
//typo3/sysext/cms/tslib/class.tslib_fe.php
3
	function previewInfo()	{
4
		$content = '';
5
		if ($this->fePreview && (!isset($this->config['config']['disablePreviewNotification']) || intval($this->config['config']['disablePreviewNotification']) !== 1)) {
6
			if ($this->fePreview === 2) {
7
				$onclickForStoppingPreview = 'document.location="' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'index.php?ADMCMD_prev=LOGOUT&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . '";return false;';
8
				$text = 'Preview of workspace "' . $this->whichWorkspace(TRUE) . '" (' . $this->whichWorkspace() . ')';
9
				$html = $this->doWorkspacePreview() ? '<br/><input name="_" type="submit" value="Stop preview" onclick="' . htmlspecialchars($onclickForStoppingPreview) . '" />' : '';
10
			} else {
11
				$text = 'PREVIEW!';
12
				$html = '';
13
			}
14

    
15
			$stdMsg = '<div id="typo3-previewInfo" style="position: absolute; top: 20px; right: 20px; border: 2px solid #000; padding: 5px; background: #f00; font: 1em Verdana; color: #000; font-weight: bold; z-index: 10001">' . htmlspecialchars($text) . $html . '</div>';
16

    
17
			if ($this->fePreview === 2) {
18
				$content = $this->config['config']['message_preview_workspace'] ?
19
					@sprintf($this->config['config']['message_preview_workspace'], $this->whichWorkspace(TRUE),$this->whichWorkspace()) :
20
					$stdMsg;
21
			} else {
22
				$content = $this->config['config']['message_preview'] ? $this->config['config']['message_preview'] : $stdMsg;
23
			}
24
		}
25
		return $content;
26
	}
(2-2/3)