2005-10-02 Bernhard Kraft <kraftb@kraftb.at>
authorBernhard Kraft <kraftb@think-open.at>
Sat, 1 Oct 2005 23:30:25 +0000 (23:30 +0000)
committerBernhard Kraft <kraftb@think-open.at>
Sat, 1 Oct 2005 23:30:25 +0000 (23:30 +0000)
 * Integrated content-slide extension into core (http://wiki.typo3.org/index.php/Extensions_for_the_core)
 * Implemented "requestUpdate" feature of TCEforms for Flexform fields

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

ChangeLog
t3lib/class.t3lib_tceforms.php
typo3/sysext/cms/tslib/class.tslib_content.php

index 64eba35..22d46c2 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-02 Bernhard Kraft  <kraftb@kraftb.at>
+
+       * Integrated content-slide extension into core
+       (http://wiki.typo3.org/index.php/Extensions_for_the_core)
+       * Implemented "requestUpdate" feature of TCEforms for Flexform fields
+
 2005-09-19 Martin Kutschker <martin.t.kutschker@blackbox.net>
 
        *  Fixed bug #1287: Detect Opera as Netscape3 (making image roll-overs work)
index 8d8b4f8..273291f 100755 (executable)
@@ -2152,7 +2152,16 @@ class t3lib_TCEforms     {
                                                                'defaultExtras' => $value['TCEforms']['defaultExtras'],
                                                                'displayCond' => $value['TCEforms']['displayCond'],     // Haven't tested this...
                                                        );
+                                                       if (
+                                                                       (($GLOBALS['TCA'][$table]['ctrl']['type'] && !strcmp($key,$GLOBALS['TCA'][$table]['ctrl']['type'])) ||
+                                                                       ($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'] && t3lib_div::inList($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'],$key)))
+                                                                       && !$GLOBALS['BE_USER']->uc['noOnChangeAlertInTypeFields'])     {
+                                                               $alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
+                                                       } else {$alertMsgOnChange='';}
                                                        $fakePA['fieldChangeFunc']=$PA['fieldChangeFunc'];
+                                                       if (strlen($alertMsgOnChange))  {
+                                                               $fakePA['fieldChangeFunc']['alert']=$alertMsgOnChange;
+                                                       }
                                                        $fakePA['onFocus']=$PA['onFocus'];
                                                        $fakePA['label']==$PA['label'];
 
index a9a5b9a..744d755 100755 (executable)
@@ -1136,39 +1136,64 @@ class tslib_cObj {
                        $renderObjKey = $conf['renderObj'] ? 'renderObj' : '';
                        $renderObjConf = $conf['renderObj.'];
 
-                       $res = $this->exec_getQuery($conf['table'],$conf['select.']);
-                       if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
-                               $GLOBALS['TT']->setTSlogMessage($error,3);
-                       } else {
-                               $this->currentRecordTotal = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
-                               $GLOBALS['TT']->setTSlogMessage('NUMROWS: '.$GLOBALS['TYPO3_DB']->sql_num_rows($res));
-                               $cObj =t3lib_div::makeInstance('tslib_cObj');
-                               $cObj->setParent($this->data,$this->currentRecord);
-                               $this->currentRecordNumber=0;
-                               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
-
-                                               // Versioning preview:
-                                       $GLOBALS['TSFE']->sys_page->versionOL($conf['table'],$row);
+                       $slide = intval($conf['slide'])?intval($conf['slide']):0;
+                       $slideCollect = intval($conf['slide.']['collect'])?intval($conf['slide.']['collect']):0;
+                       $slideCollectReverse = intval($conf['slide.']['collectReverse'])?true:false;
+                       $slideCollectFuzzy = $slideCollect?(intval($conf['slide.']['collectFuzzy'])?true:false):true;
+                       $again = false;
+
+                       do      {
+                               $res = $this->exec_getQuery($conf['table'],$conf['select.']);
+                               if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
+                                       $GLOBALS['TT']->setTSlogMessage($error,3);
+                               } else {
+                                       $this->currentRecordTotal = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
+                                       $GLOBALS['TT']->setTSlogMessage('NUMROWS: '.$GLOBALS['TYPO3_DB']->sql_num_rows($res));
+                                       $cObj =t3lib_div::makeInstance('tslib_cObj');
+                                       $cObj->setParent($this->data,$this->currentRecord);
+                                       $this->currentRecordNumber=0;
+                                       $cobjValue = '';
+                                       while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
+
+                                                       // Versioning preview:
+                                               $GLOBALS['TSFE']->sys_page->versionOL($conf['table'],$row);
+
+                                                       // Language Overlay:
+                                               if ($GLOBALS['TSFE']->sys_language_contentOL)   {
+                                                       $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($conf['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
+                                               }
 
-                                               // Language Overlay:
-                                       if ($GLOBALS['TSFE']->sys_language_contentOL)   {
-                                               $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($conf['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
+                                               if (is_array($row))     {       // Might be unset in the sys_language_contentOL
+                                                       if (!$GLOBALS['TSFE']->recordRegister[$conf['table'].':'.$row['uid']])  {
+                                                               $this->currentRecordNumber++;
+                                                               $cObj->parentRecordNumber = $this->currentRecordNumber;
+                                                               $GLOBALS['TSFE']->currentRecord = $conf['table'].':'.$row['uid'];
+                                                               $this->lastChanged($row['tstamp']);
+                                                               $cObj->start($row,$conf['table']);
+                                                               if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      { $cobjValue.='<!--DMAILER_SECTION_BOUNDARY_'.intval($row['module_sys_dmail_category']).'-->'; }
+                                                               $tmpValue = $cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey);
+                                                               $cobjValue .= $tmpValue;
+                                                       }# else debug($GLOBALS['TSFE']->recordRegister,'CONTENT');
+                                               }
                                        }
-
-                                       if (is_array($row))     {       // Might be unset in the sys_language_contentOL
-                                               if (!$GLOBALS['TSFE']->recordRegister[$conf['table'].':'.$row['uid']])  {
-                                                       $this->currentRecordNumber++;
-                                                       $cObj->parentRecordNumber = $this->currentRecordNumber;
-                                                       $GLOBALS['TSFE']->currentRecord = $conf['table'].':'.$row['uid'];
-                                                       $this->lastChanged($row['tstamp']);
-                                                       $cObj->start($row,$conf['table']);
-                                                       if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      { $theValue.='<!--DMAILER_SECTION_BOUNDARY_'.intval($row['module_sys_dmail_category']).'-->'; }
-                                                       $theValue.= $cObj->cObjGetSingle($renderObjName, $renderObjConf, $renderObjKey);
-                                               }# else debug($GLOBALS['TSFE']->recordRegister,'CONTENT');
+                                       if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      { $cobjValue.='<!--DMAILER_SECTION_BOUNDARY_END-->'; }
+                               }
+                               if ($slideCollectReverse)       {
+                                       $theValue = $cobjValue.$theValue;
+                               } else  {
+                                       $theValue .= $cobjValue;
+                               }
+                               if ($slideCollect>0)    {
+                                       $slideCollect--;
+                               }
+                               if ($slide)     {
+                                       if ($slide>0)   {
+                                               $slide--;
                                        }
+                                       $conf['select.']['pidInList'] = $this->getSlidePids($conf['select.']['pidInList'], $conf['select.']['pidInList.']);
+                                       $again = strlen($conf['select.']['pidInList'])?true:false;
                                }
-                               if ($GLOBALS['TSFE']->config['config']['insertDmailerBoundaries'])      { $theValue.='<!--DMAILER_SECTION_BOUNDARY_END-->'; }
-                       }
+                       } while ($again&&(($slide&&!strlen($tmpValue)&&$slideCollectFuzzy)||($slide&&$slideCollect)));
                }
 
                $theValue = $this->wrap($theValue,$conf['wrap']);
@@ -2418,6 +2443,36 @@ class tslib_cObj {
         ************************************/
 
        /**
+        * Returns all parents of the given PID (Page UID) list
+        *
+        * @param       string          A list of page Content-Element PIDs (Page UIDs) / stdWrap
+        * @param       array           stdWrap array for the list
+        * @return      string          A list of PIDs
+        * @access private
+        */
+       function getSlidePids($pidList, $pidConf)       {
+               $pidList = trim($this->stdWrap($pidList,$pidConf));
+               if (!strcmp($pidList,''))       {
+                       $pidList = 'this';
+               }
+               if (trim($pidList))     {
+                       $listArr = t3lib_div::intExplode(',',str_replace('this',$GLOBALS['TSFE']->contentPid,$pidList));
+                       $listArr = $this->checkPidArray($listArr);
+               }
+               $pidList = array();
+               if (is_array($listArr)&&count($listArr))        {
+                       foreach ($listArr as $uid)      {
+                               $page = $GLOBALS['TSFE']->sys_page->getPage($uid);
+                               if (!$page['is_siteroot'])      {
+                                       $pidList[] = $page['pid'];
+                               }
+                       }
+               }
+               return implode(',', $pidList);
+       }
+
+
+       /**
         * Creates a link to a netprint application on another website (where the "netprint" extension is running")
         * Related to the extension "netprint"
         *