Fixed bug #4666: Use TYPO3 settings when formatting dates
authorMichael Stucki <michael.stucki@typo3.org>
Tue, 6 Feb 2007 07:15:40 +0000 (07:15 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Tue, 6 Feb 2007 07:15:40 +0000 (07:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2000 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php
t3lib/class.t3lib_install.php
t3lib/class.t3lib_userauthgroup.php
t3lib/config_default.php
t3lib/jsfunc.evalfield.js
typo3/mod/tools/em/class.em_index.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/media/scripts/plaintextLib.inc
typo3/sysext/indexed_search/class.crawler.php
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php

index 59f7fe6..b91547e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-02-06  Michael Stucki  <michael@typo3.org>
 
        * Added feature #4592: Keep indexed_search tables consistent when deleting/hiding pages (Thanks to Michael Fritz)
+       * Fixed bug #4666: Use TYPO3 settings when formatting dates
 
 2007-02-05  Ingmar Schlecht  <ingmar@typo3.org>
 
index 2efb77b..5775986 100755 (executable)
@@ -4435,6 +4435,9 @@ class t3lib_div {
                        // TYPO3 logging enabled?
                if (!$TYPO3_CONF_VARS['SYS']['systemLog'])      return;
 
+               $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
+               $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
+
                        // use all configured logging options
                foreach (explode(';',$TYPO3_CONF_VARS['SYS']['systemLog'],2) as $log)   {
                        list($type,$destination,$level) = explode(',',$log,4);
@@ -4449,7 +4452,7 @@ class t3lib_div {
                                $file = fopen($destination, 'a');
                                if ($file)     {
                                        flock($file, LOCK_EX);  // try locking, but ignore if not available (eg. on NFS and FAT)
-                                       fwrite($file, date('d/m/Y H:i').$msgLine.chr(10));
+                                       fwrite($file, date($dateFormat.' '.$timeFormat).$msgLine.chr(10));
                                        flock($file, LOCK_UN);    // release the lock
                                        fclose($file);
                                }
index b5f6296..ea1d374 100755 (executable)
@@ -200,13 +200,14 @@ class t3lib_install {
                        // Checking if "updated" line was set by this tool - if so remove old line.
                $updatedLine = array_pop($lines);
                $writeToLocalconf_dat['updatedText'] = '// Updated by '.$this->updateIdentity.' ';
+
                if (!strstr($updatedLine, $writeToLocalconf_dat['updatedText']))        {
                        array_push($lines,$updatedLine);
                }
 
                if (is_array($inlines)) {       // Setting a line and write:
                                // Setting configuration
-                       $updatedLine = $writeToLocalconf_dat['updatedText'].date('d-m-Y H:i:s');
+                       $updatedLine = $writeToLocalconf_dat['updatedText'].date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' H:i:s');
                        array_push($inlines,$updatedLine);
                        array_push($inlines,$writeToLocalconf_dat['endLine']);
 
index 5c3ea8c..28760e5 100755 (executable)
@@ -1685,13 +1685,13 @@ This is a dump of the failures:
 ';
                                while($testRows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))  {
                                        $theData = unserialize($testRows['log_data']);
-                                       $email_body.=date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' H:i',$testRows['tstamp']).':  '.@sprintf($testRows['details'],''.$theData[0],''.$theData[1],''.$theData[2]);
-                                       $email_body.=chr(10);
+                                       $email_body.= date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'],$testRows['tstamp']).':  '.@sprintf($testRows['details'],''.$theData[0],''.$theData[1],''.$theData[2]);
+                                       $email_body.= chr(10);
                                }
                                mail(   $email,
-                                               $subject,
-                                               $email_body,
-                                               'From: TYPO3 Login WARNING<>'
+                                       $subject,
+                                       $email_body,
+                                       'From: TYPO3 Login WARNING<>'
                                );
                                $this->writelog(255,4,0,3,'Failure warning (%s failures within %s seconds) sent by email to %s',Array($GLOBALS['TYPO3_DB']->sql_num_rows($res),$secondsBack,$email));   // Logout written to log
                        }
index 2cef98e..83c5c4f 100755 (executable)
@@ -60,7 +60,7 @@ $TYPO3_CONF_VARS = Array(
                'sqlDebug' => 0,                                        // Boolean. If set, then database queries that fails are outputted in browser. For development.
                'enable_DLOG' => FALSE,                                 // Whether the developer log is enabled. See constant "TYPO3_DLOG"
                'ddmmyy' => 'd-m-y',                                    // Format of Date-Month-Year - see PHP-function date()
-               'hhmm' => 'H:i',                                                // Format of Hours-minutes - see PHP-function date()
+               'hhmm' => 'H:i',                                                // Format of Hours-Minutes - see PHP-function date()
                'USdateFormat' => 0,                            // Boolean. If true, dates entered in the TCEforms of the backend will be formatted mm-dd-yyyy
                'loginCopyrightWarrantyProvider' => '',         // String: If you provide warranty for TYPO3 to your customers insert you (company) name here. It will appear in the login-dialog as the warranty provider. (You must also set URL below).
                'loginCopyrightWarrantyURL' => '',              // String: Add the URL where you explain the extend of the warranty you provide. This URL is displayed in the login dialog as the place where people can learn more about the conditions of your warranty. Must be set (more than 10 chars) in addition with the 'loginCopyrightWarrantyProvider' message.
index c7e4dc3..2b55704 100755 (executable)
@@ -1,6 +1,6 @@
 /***************************************************************
 *
-*  Evaluation of Typo3 form field content
+*  Evaluation of TYPO3 form field content
 *
 * $Id$
 *
@@ -8,13 +8,13 @@
 *
 *  Copyright notice
 *
-*  (c) 1998-2003 Kasper Skaarhoj
+*  (c) 1998-2007 Kasper Skaarhoj
 *  All rights reserved
 *
 *  This script is part of the TYPO3 t3lib/ library provided by
 *  Kasper Skaarhoj <kasper@typo3.com> together with TYPO3
 *
-*  Released under GNU/GPL (see license file in tslib/)
+*  Released under GNU/GPL (see license file in typo3/sysext/cms/tslib/)
 *
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index b1f9205..ce7412a 100644 (file)
@@ -901,8 +901,10 @@ EXTENSION KEYS:
                                $onCLick = "window.location.href='index.php?CMD[fetchMetaData]=extensions';return false;";
                                $content.= 'Connect to the current mirror and retrieve the current list of available plugins from the TYPO3 Extension Repository.<br />
                                <input type="submit" value="Retrieve/Update" onclick="'.htmlspecialchars($onCLick).'" />';
-                               if(is_file(PATH_site.'typo3temp/extensions.bin')) {
-                                       $content .= ' (last update: '.date('Y-m-d H:i',filemtime(PATH_site.'typo3temp/extensions.xml.gz')).')';
+                               if (is_file(PATH_site.'typo3temp/extensions.bin'))      {
+                                       $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
+                                       $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
+                                       $content.= ' (last update: '.date($dateFormat.' '.$timeFormat,filemtime(PATH_site.'typo3temp/extensions.xml.gz')).')';
                                }
                        }
                        $content.= '<br /><br />'.$this->securityHint;
index d8f650e..959dde6 100755 (executable)
                                        $this->cacheExpires = $row['expires'];
 
                                        if ($this->TYPO3_CONF_VARS['FE']['debug'] || $this->config['config']['debug'])  {
-                                               $this->content.=chr(10).'<!-- Cached page generated '.Date('d/m Y H:i', $row['tstamp']).'. Expires '.Date('d/m Y H:i', $row['expires']).' -->';
+                                               $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
+                                               $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
+
+                                               $this->content.=chr(10).'<!-- Cached page generated '.date($dateFormat.' '.$timeFormat, $row['tstamp']).'. Expires '.Date($dateFormat.' '.$timeFormat, $row['expires']).' -->';
                                        }
 
                                }
index c7db13e..361c4df 100644 (file)
@@ -320,7 +320,9 @@ class user_plaintext {
                                $blanks = t3lib_div::intInRange($tConf['preLineBlanks'],0,1000);
                                if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
 
-                               if ($this->cObj->data['date'])          {$lines[] = $this->getString($hConf['datePrefix']).date($hConf['date']?$hConf['date']:'d-m-Y',$this->cObj->data['date']);}
+                               if ($this->cObj->data['date'])  {
+                                       $lines[] = $this->getString($hConf['datePrefix']).date($hConf['date']?$hConf['date']:$GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'],$this->cObj->data['date']);
+                               }
                                $prefix='';
                                $str=$this->getString($tConf['prefix']).$str;
                                if ($tConf['autonumber'])       $str=$this->cObj->parentRecordNumber.$str;
index 38da67c..7ae1c7f 100755 (executable)
@@ -758,15 +758,7 @@ class tx_indexedsearch_crawler {
                $nextTime = $lastSureOffset + $frequencyBlocksUntilNextTime*$frequencySeconds;
 
                return $nextTime;
-/*             echo print_r(array(
-                       $cfgRec['timer_offset'],
-                       $frequencySeconds,
-                       date('d-m-Y H:i:s',$currentTime),
-                       date('d-m-Y H:i:s',$aMidNight),
-                       date('d-m-Y H:i:s',$lastSureOffset),
-                       date('d-m-Y H:i:s',$nextTime)
-               ));
-*/     }
+       }
 
        /**
         * Checks if $url has any of the URls in the $url_deny "list" in it and if so, returns true.
index 1223677..bc855c5 100755 (executable)
@@ -2066,9 +2066,12 @@ class tx_indexedsearch extends tslib_pibase {
         * @return      array           Modified template array
         */
        function makeInfo($row,$tmplArray)      {
+               $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
+               $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
+
                $tmplArray['size'] = t3lib_div::formatSize($row['item_size']);
-               $tmplArray['created'] = date('d-m-y',$row['item_crdate']);
-               $tmplArray['modified'] = date('d-m-y H:i',$row['item_mtime']);
+               $tmplArray['created'] = date($dateFormat, $row['item_crdate']);
+               $tmplArray['modified'] = date($dateFormat.' '.$timeFormat, $row['item_mtime']);
 
                $pathId = $row['data_page_id']?$row['data_page_id']:$row['page_id'];
                $pathMP = $row['data_page_id']?$row['data_page_mp']:'';