Skip to content

Commit

Permalink
2005-10-02 Bernhard Kraft <kraftb@kraftb.at>
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
Bernhard Kraft committed Oct 1, 2005
1 parent 4f8cf35 commit dc716cc
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 29 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 9 additions & 0 deletions t3lib/class.t3lib_tceforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,16 @@ function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$fie
'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'];

Expand Down
113 changes: 84 additions & 29 deletions typo3/sysext/cms/tslib/class.tslib_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -1136,39 +1136,64 @@ function CONTENT($conf) {
$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']);
Expand Down Expand Up @@ -2417,6 +2442,36 @@ function MULTIMEDIA($conf) {
*
************************************/

/**
* 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"
Expand Down

0 comments on commit dc716cc

Please sign in to comment.