TYPO3 CMS  TYPO3_6-2
LogoView.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Backend\View;
3 
21 class LogoView {
22 
26  protected $logo = '';
27 
31  public function __construct() {
32  $this->logo = 'gfx/typo3-topbar@2x.png';
33  }
34 
40  public function render() {
41  $imgInfo = getimagesize(PATH_site . TYPO3_mainDir . $this->logo);
42  $imgUrl = $this->logo;
43 
44  // Overwrite with custom logo
45  if ($GLOBALS['TBE_STYLES']['logo']) {
46  $imgInfo = @getimagesize(\TYPO3\CMS\Core\Utility\GeneralUtility::resolveBackPath((PATH_typo3 . $GLOBALS['TBE_STYLES']['logo']), 3));
47  $imgUrl = $GLOBALS['TBE_STYLES']['logo'];
48  }
49 
50  // High-res?
51  $width = $imgInfo[0];
52  $height = $imgInfo[1];
53 
54  if (strpos($imgUrl, '@2x.')) {
55  $width = $width/2;
56  $height = $height/2;
57  }
58 
59  $logoTag = '<img src="' . $imgUrl . '" width="' . $width . '" height="' . $height . '" title="TYPO3 Content Management System" alt="" />';
60  return '<a href="' . TYPO3_URL_GENERAL . '" target="_blank">' . $logoTag . '</a>';
61  }
62 
69  public function setLogo($logo) {
70  if (!is_string($logo)) {
71  throw new \InvalidArgumentException('parameter $logo must be of type string', 1194041104);
72  }
73  $this->logo = $logo;
74  }
75 
76 }
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]