* Changed order of DOCTYPE and XML declaration for XHTML support (for standards compl...
authorKasper Skårhøj <kasper@typo3.org>
Mon, 15 Dec 2003 09:39:03 +0000 (09:39 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Mon, 15 Dec 2003 09:39:03 +0000 (09:39 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@61 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_div.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php
typo3/template.php

index ce9c45f..9fcda6d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,9 @@
-2003-10-24  Kasper Skårhøj
-
-       * Moved changelog.txt to ChangeLog ("cvs compliant")
-
-
+2003-12-16  Kasper Skårhøj
 
+       * Changed order of DOCTYPE and XML declaration for XHTML support (for standards compliance mode detection in MSIE)
 
+2003-10-24  Kasper Skårhøj
+       * Moved changelog.txt to ChangeLog ("cvs compliant")
 TYPO3 3.6.0-dev
 PHP:
 !!! $LANG->php3Lang + ->mainLang has been cancelled and replaced with a local-lang call: Search/replace regex: search for '->php3Lang\["([^]]*)"\]\["([^]]*)"\]', replace with '->sL("LLL:EXT:lang/locallang_core.php:\1.\2")'. Same for ->mainLang.
index f000b10..79f5a6f 100755 (executable)
@@ -1918,7 +1918,7 @@ class t3lib_BEfunc        {
         */
        function getFuncMenu($id,$elementName,$currentValue,$menuItems,$script='',$addparams='')        {
                if (is_array($menuItems))       {
-                       if (!$script) {$script=basename(PATH_thisScript);}
+                       if (!$script) { $script=basename(PATH_thisScript); }
                        $options='';
                        reset($menuItems);
                        while(list($value,$label)=each($menuItems))     {
index 8713c77..ac2abc1 100755 (executable)
@@ -858,19 +858,34 @@ class t3lib_div {
         * Usage: 54
         * 
         * @param       integer         Number of bytes to format.
+        * @param       string          Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)
         * @return      string          Formatted representation of the byte number, for output.
         */
-       function formatSize($sizeInBytes)       {
+       function formatSize($sizeInBytes,$labels='')    {
+       
+                       // Set labels:
+               if (strlen($labels) == 0) {
+                   $labels = ' | K| M| G';
+               } else { 
+                   $labels = str_replace('"','',$labels);
+               }
+               $labelArr = explode('|',$labels);
+               
+                       // Find size:
                if ($sizeInBytes>900)   {
-                       if ($sizeInBytes>900000)        {       // MB
+                       if ($sizeInBytes>900000000)     {       // GB
+                               $val = $sizeInBytes/(1024*1024*1024);
+                               return number_format($val, (($val<20)?1:0), '.', '').$labelArr[3];
+                       }
+                       elseif ($sizeInBytes>900000)    {       // MB
                                $val = $sizeInBytes/(1024*1024);
-                               return number_format($val, (($val<20)?1:0), '.', '').' M';
+                               return number_format($val, (($val<20)?1:0), '.', '').$labelArr[2];
                        } else {        // KB
                                $val = $sizeInBytes/(1024);
-                               return number_format($val, (($val<20)?1:0), '.', '').' K';
+                               return number_format($val, (($val<20)?1:0), '.', '').$labelArr[1];
                        }
                } else {        // Bytes
-                       return $sizeInBytes.'&nbsp;&nbsp;';
+                       return $sizeInBytes.$labelArr[0];
                }
        }
 
index 86eedf3..d1aea35 100755 (executable)
@@ -2837,7 +2837,7 @@ class tslib_cObj {
                                if ($conf['age']){$content=$this->calcAge(time()-$content,$conf['age']);}
                                
                                if ($conf['case']){$content=$this->HTMLcaseshift($content, $conf['case']);}
-                               if ($conf['bytes']){$content=$this->bytes($content);}
+                               if ($conf['bytes']){$content=$this->bytes($content,$conf['bytes.']['labels']);}
                                if ($conf['substring']){$content=$this->substring($content,$conf['substring']);}
                                if ($conf['crop']){$content=$this->crop($content, $conf['crop']);}
                                if ($conf['stripHtml']){$content=strip_tags($content);}
@@ -4972,16 +4972,16 @@ class tslib_cObj {
        }
 
        /**
-        * Formats a number to Mb or Kb or just bytes
+        * Formats a number to GB, Mb or Kb or just bytes
         * 
-        * @param       integer         Bytes to format
+        * @param       integer         Number of bytes to format.
+        * @param       string          Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)
         * @return      string          
         * @see t3lib_div::formatSize(), stdWrap()
         * @depreciated Use t3lib_div::formatSize() instead
-        * @see t3lib_div::formatSize()
         */
-       function bytes($sizeInBytes)    {
-               return t3lib_div::formatSize($sizeInBytes);
+       function bytes($sizeInBytes,$labels)    {
+               return t3lib_div::formatSize($sizeInBytes,$labels);
        }
 
        /**
@@ -6476,4 +6476,4 @@ class tslib_controlTable  {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_content.php'])  {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/class.tslib_content.php']);
 }
-?>
\ No newline at end of file
+?>
index f7f893f..c574875 100755 (executable)
@@ -321,10 +321,11 @@ function linkTo_UnCryptMailto(s)  {       //
                        // Setting document type:
                switch((string)$GLOBALS['TSFE']->config['config']['doctype'])   {
                        case 'xhtml_trans':
-                               $GLOBALS['TSFE']->content.='<?xml version="1.0" encoding="'.$theCharset.'"?>
-<!DOCTYPE html 
+                               $GLOBALS['TSFE']->content.='<!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?xml version="1.0" encoding="'.$theCharset.'"?>
+';
                        break;
                        default:
                                $GLOBALS['TSFE']->content.='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
index b8bce78..6b155a2 100755 (executable)
@@ -582,30 +582,36 @@ class template {
                        // Get META tag containing the currently selected charset for backend output. The function sets $this->charSet.
                $charSet = $this->initCharset();
                $generator = $this->generator();
-
+               
+                       // For debugging: If this outputs "QuirksMode"/"BackCompat" (IE) the browser runs in quirks-mode. Otherwise the value is "CSS1Compat"
+               $this->JScodeArray[]='alert(document.compatMode);';
+               
                        // Send HTTP header for selected charset. Added by Robert Lemke 23.10.2003
                header ('Content-Type:text/html;charset='.$this->charset);
 
                switch($this->docType)  {
                        case 'xhtml_strict':
-                               $headerStart= '<?xml version="1.0" encoding="'.$this->charset.'"?>
-<?xml-stylesheet href="#internalStyle" type="text/css"?>
-<!DOCTYPE html 
+                               $headerStart= '<!DOCTYPE html 
        PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
-       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<?xml version="1.0" encoding="'.$this->charset.'"?>
+<?xml-stylesheet href="#internalStyle" type="text/css"?>
+';
                        break;
                        case 'xhtml_trans':
-                               $headerStart= '<?xml version="1.0" encoding="'.$this->charset.'"?>
-<?xml-stylesheet href="#internalStyle" type="text/css"?>
-<!DOCTYPE html 
+                               $headerStart= '<!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?xml version="1.0" encoding="'.$this->charset.'"?>
+<?xml-stylesheet href="#internalStyle" type="text/css"?>
+';
                        break;
                        case 'xhtml_frames':
-                               $headerStart= '<?xml version="1.0" encoding="'.$this->charset.'"?>
-<!DOCTYPE html 
+                               $headerStart= '<!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">';
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<?xml version="1.0" encoding="'.$this->charset.'"?>
+';
                        break;
                        default:
                                $headerStart='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">';