2005-11-30 Sebastian Kurfuerst <sebastian@garbage-group.de>
authorSebastian Kurfürst <sebastian.kurfuerst@typo3.org>
Wed, 30 Nov 2005 20:26:19 +0000 (20:26 +0000)
committerSebastian Kurfürst <sebastian.kurfuerst@typo3.org>
Wed, 30 Nov 2005 20:26:19 +0000 (20:26 +0000)
* Fixed bug #0874: XHTML compliance of GMENU with onmouseover
images
* Fixed bug #1657: make default number of file upload forms in
the file upload tool configurable
* Fixed bug #1703: Date fields: default is tomorrow instead of
today.
* Fixed bug #1889: EM appends trailing spaces when updating
ext_emconf.php
* changed shortcut checking behavior in t3lib_page::getMenu
(Related to #1066)

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@893 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_page.php
t3lib/class.t3lib_tceforms.php
typo3/file_upload.php
typo3/mod/tools/em/index.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/wizard_crpages/class.tx_wizardcrpages_webfunc_2.php
typo3/sysext/wizard_sortpages/class.tx_wizardsortpages_webfunc_2.php

index 6f45911..e5edf6e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-11-30  Sebastian Kurfuerst  <sebastian@garbage-group.de>
+
+       * Fixed bug #0874: XHTML compliance of GMENU with onmouseover images
+       * Fixed bug #1657: make default number of file upload forms in the file upload tool configurable
+       * Fixed bug #1703: Date fields: default is tomorrow instead of today.
+       * Fixed bug #1889: EM appends trailing spaces when updating ext_emconf.php
+       * changed shortcut checking behavior in t3lib_page::getMenu (Related to #1066)
+
 2005-11-30  Michael Stucki  <michael@typo3.org>
 
        * Fixed a little bug in t3lib_div::debug() (missing <tr> after first row)
 2005-11-09  Sebastian Kurfuerst  <sebastian@garbage-group.de>
 
        * New feature #1577: display clickmenus with XMLHTTP / ajax
-       * Fixed bug 1066: Shortcut to a invisible page leads to a frontend error
+       * Fixed bug #1066: Shortcut to a invisible page leads to a frontend error
 
 2005-11-09  Ingmar Schlecht  <ingmar@typo3.org>
 
index 1af1da1..f82f82e 100755 (executable)
@@ -404,10 +404,11 @@ class t3lib_pageSelect {
         * @param       string          List of fields to select. Default is "*" = all
         * @param       string          The field to sort by. Default is "sorting"
         * @param       string          Optional additional where clauses. Like "AND title like '%blabla%'" for instance.
+        * @param       boolean         check if shortcuts exist, checks by default
         * @return      array           Array with key/value pairs; keys are page-uid numbers. values are the corresponding page records (with overlayed localized fields, if any)
         * @see tslib_fe::getPageShortcut(), tslib_menu::makeMenu(), tx_wizardcrpages_webfunc_2, tx_wizardsortpages_webfunc_2
         */
-       function getMenu($uid,$fields='*',$sortField='sorting',$addWhere='')    {
+       function getMenu($uid,$fields='*',$sortField='sorting',$addWhere='',$checkShortcuts=1)  {
 
                $output = Array();
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, 'pages', 'pid='.intval($uid).$this->where_hid_del.$this->where_groupAccess.' '.$addWhere, '', $sortField);
@@ -427,7 +428,7 @@ class t3lib_pageSelect {
                                }
 
                                        // if shortcut, look up if the target exists and is currently visible
-                               if ($row['doktype'] == 4 && ($row['shortcut'] || $row['shortcut_mode']))        {
+                               if ($row['doktype'] == 4 && ($row['shortcut'] || $row['shortcut_mode']) && $checkShortcuts)     {
                                        if ($row['shortcut_mode'] == 0) {
                                                $searchField = 'uid';
                                                $searchUid = intval($row['shortcut']);
@@ -441,7 +442,7 @@ class t3lib_pageSelect {
                                                unset($row);
                                        }
                                        $GLOBALS['TYPO3_DB']->sql_free_result($res2);
-                               } elseif ($row['doktype'] == 4) {
+                               } elseif ($row['doktype'] == 4 && $checkShortcuts)      {
                                                // Neither shortcut target nor mode is set. Remove the page from the menu.
                                        unset($row);
                                }
index b434efe..ab8cf0f 100755 (executable)
@@ -919,8 +919,8 @@ class t3lib_TCEforms        {
                $paramsList = "'".$PA['itemFormElName']."','".implode(',',$evalList)."','".trim($config['is_in'])."',".(isset($config['checkbox'])?1:0).",'".$config['checkbox']."'";
                if (isset($config['checkbox'])) {
                                // Setting default "click-checkbox" values for eval types "date" and "datetime":
-                       $nextMidNight = mktime(0,0,0)+1*3600*24;
-                       $checkSetValue = in_array('date',$evalList) ? $nextMidNight : '';
+                       $thisMidnight = mktime(0,0,0);
+                       $checkSetValue = in_array('date',$evalList) ? $thisMidnight : '';
                        $checkSetValue = in_array('datetime',$evalList) ? time() : $checkSetValue;
 
                        $cOnClick = 'typo3FormFieldGet('.$paramsList.',1,\''.$checkSetValue.'\');'.implode('',$PA['fieldChangeFunc']);
index d2a243f..35acae2 100755 (executable)
@@ -108,6 +108,9 @@ class SC_file_upload {
                $this->target = t3lib_div::_GP('target');
                $this->returnUrl = t3lib_div::_GP('returnUrl');
 
+               if (empty($this->number) && $GLOBALS['BE_USER']->getTSConfig('options.defaultFileUploads'))     {
+                       $this->number = t3lib_div::intInRange($GLOBALS['BE_USER']->getTSConfig('options.defaultFileUploads'),1,$this->uploadNumber);
+               }
                        // Init basic-file-functions object:
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
                $this->basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);
index ab2c6b4..a3772e2 100755 (executable)
@@ -3162,18 +3162,18 @@ EXTENSION KEYS:
                $EM_CONF['version']=$vDat['version'];
 
                $lines=array();
-               $lines[]='<?php';
-               $lines[]='';
-               $lines[]='########################################################################';
-               $lines[]='# Extension Manager/Repository config file for ext: "'.$extKey.'"';
-               $lines[]='# ';
-               $lines[]='# Auto generated '.date('d-m-Y H:i');
-               $lines[]='# ';
-               $lines[]='# Manual updates:';
-               $lines[]='# Only the data in the array - anything else is removed by next write';
-               $lines[]='########################################################################';
-               $lines[]='';
-               $lines[]='$EM_CONF[$_EXTKEY] = Array (';
+               $lines[]='<?php
+
+########################################################################
+# Extension Manager/Repository config file for ext: "'.$extKey.'"
+#
+# Auto generated '.date('d-m-Y H:i').'
+#
+# Manual updates:
+# Only the data in the array - anything else is removed by next write
+########################################################################
+
+$EM_CONF[$_EXTKEY] = Array (';
 
                foreach($EM_CONF as $k => $v)   {
                        $lines[] = chr(9)."'".$k."' => ".(
@@ -3182,9 +3182,9 @@ EXTENSION KEYS:
                                "'".t3lib_div::slashJS(trim($v),1)."'"
                        ).','.$fMsg[$k];
                }
-               $lines[]=');';
-               $lines[]='';
-               $lines[]='?>';
+               $lines[]=');
+
+?>';
 
                return implode(chr(10),$lines);
        }
index 69a8872..a21a67f 100755 (executable)
@@ -3500,11 +3500,13 @@ if (version == "n3") {
 '              // JS function for mouse-over
        function over(name,imgObj)      {       //
                if (version == "n3" && document[name]) {document[name].src = eval(name+"_h.src");}
+               else if (typeof(document.getElementById)=="function" && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_h.src");}
                else if (imgObj)        {imgObj.src = eval(name+"_h.src");}
        }
                // JS function for mouse-out
        function out(name,imgObj)       {       //
                if (version == "n3" && document[name]) {document[name].src = eval(name+"_n.src");}
+               else if (typeof(document.getElementById)=="function" && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_n.src");}
                else if (imgObj)        {imgObj.src = eval(name+"_n.src");}
        }';
                                break;
index b2cae14..5b2f6fa 100755 (executable)
@@ -172,6 +172,7 @@ class tslib_menu {
        var $WMsubmenuObjSuffixes;
        var $WMextraScript;
        var $alternativeMenuTempArray='';               // Can be set to contain menu item arrays for sub-levels.
+       var $nameAttribute = 'name';                    // Will be 'id' in XHTML-mode
 
        /**
         * The initialization of the object. This just sets some internal variables.
@@ -193,6 +194,18 @@ class tslib_menu {
                $this->mconf = $conf[$this->menuNumber.$objSuffix.'.'];
                $this->debug=$GLOBALS['TSFE']->debug;
 
+                       // In XHTML there is no "name" attribute anymore
+               switch ($GLOBALS['TSFE']->config['config']['doctype'])  {
+                       case 'xhtml_strict':
+                       case 'xhtml_11':
+                       case 'xhtml_2':
+                               $this->nameAttribute = 'id';
+                               break;
+                       default:
+                               $this->nameAttribute = 'name';
+                               break;
+               }
+
                        // Sets the internal vars. $tmpl MUST be the template-object. $sys_page MUST be the sys_page object
                if ($this->conf[$this->menuNumber.$objSuffix] && is_object($tmpl) && is_object($sys_page))      {
                        $this->tmpl = &$tmpl;
@@ -1668,7 +1681,7 @@ class tslib_tmenu extends tslib_menu {
                                $imgROInfo[3] = t3lib_div::png_to_gif_by_imagemagick($imgROInfo[3]);
                                if ($imgROInfo) {
                                        $theName = $this->imgNamePrefix.$this->I['uid'].$this->I['INPfix'].$pref;
-                                       $name = ' name="'.$theName.'"';
+                                       $name = ' '.$this->nameAttribute.'="'.$theName.'"';
                                        $GLOBALS['TSFE']->JSImgCode.= chr(10).$theName.'_n=new Image(); '.$theName.'_n.src = "'.$GLOBALS['TSFE']->absRefPrefix.$imgInfo[3].'"; ';
                                        $GLOBALS['TSFE']->JSImgCode.= chr(10).$theName.'_h=new Image(); '.$theName.'_h.src = "'.$GLOBALS['TSFE']->absRefPrefix.$imgROInfo[3].'"; ';
                                }
@@ -2182,7 +2195,7 @@ class tslib_gmenu extends tslib_menu {
                                                // Set rollover
                                        if ($this->result['RO'][$key] && !$this->I['noLink'])   {
                                                $this->I['theName'] = $this->imgNamePrefix.$this->I['uid'].$this->I['INPfix'];
-                                               $this->I['name'] = ' name="'.$this->I["theName"].'"';
+                                               $this->I['name'] = ' '.$this->nameAttribute.'="'.$this->I["theName"].'"';
                                                $this->I['linkHREF']['onMouseover']=$this->WMfreezePrefix.'over(\''.$this->I['theName'].'\');';
                                                $this->I['linkHREF']['onMouseout']=$this->WMfreezePrefix.'out(\''.$this->I['theName'].'\');';
                                                $GLOBALS['TSFE']->JSImgCode.= chr(10).$this->I['theName'].'_n=new Image(); '.$this->I['theName'].'_n.src = "'.$GLOBALS['TSFE']->absRefPrefix.$this->I['val']['output_file'].'"; ';
index ff4204b..6c32c0e 100755 (executable)
@@ -100,7 +100,7 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
                $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(8);   // create new pages here?
                $pRec = t3lib_BEfunc::getRecord('pages',$this->pObj->id,'uid',' AND '.$m_perms_clause);
                $sys_pages = t3lib_div::makeInstance('t3lib_pageSelect');
-               $menuItems = $sys_pages->getMenu($this->pObj->id);
+               $menuItems = $sys_pages->getMenu($this->pObj->id,'*','sorting','',0);
                if (is_array($pRec))    {
                        $data = t3lib_div::_GP('data');
                        if (is_array($data['pages']))   {
@@ -140,7 +140,7 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
                                }
 
                                        // Display result:
-                               $menuItems = $sys_pages->getMenu($this->pObj->id);
+                               $menuItems = $sys_pages->getMenu($this->pObj->id,'*','sorting','',0);
                                reset($menuItems);
                                $lines=array();
                                while(list(,$rec)=each($menuItems))     {
index c595a76..e2bbbe5 100755 (executable)
@@ -98,9 +98,9 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
                        if ($sortByField)       {
                                $menuItems=array();
                                if (t3lib_div::inList('title,subtitle,crdate,tstamp',$sortByField))     {
-                                       $menuItems = $sys_pages->getMenu($this->pObj->id,'uid,pid,title',$sortByField);
+                                       $menuItems = $sys_pages->getMenu($this->pObj->id,'uid,pid,title',$sortByField,'',0);
                                } elseif ($sortByField=='REV') {
-                                       $menuItems = $sys_pages->getMenu($this->pObj->id,'uid,pid,title');
+                                       $menuItems = $sys_pages->getMenu($this->pObj->id,'uid,pid,title','sorting','',0);
                                        $menuItems = array_reverse($menuItems);
                                }
                                if (count($menuItems))  {
@@ -119,7 +119,7 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
                        }
 
                                //
-                       $menuItems = $sys_pages->getMenu($this->pObj->id);
+                       $menuItems = $sys_pages->getMenu($this->pObj->id,'*','sorting','',0);
                        reset($menuItems);
                        $lines=array();
                                $lines[]= '<tr>