Project

General

Profile

Bug #17119 » 0005556_v3.patch

Administrator Admin, 2007-05-04 07:57

View differences:

t3lib/jsfunc.inline.js (Arbeitskopie)
},
createNewRecord: function(objectId,prevRecordUid) {
if (this.isBelowMax(objectId)) this.makeAjaxCall('createNewRecord', objectId+(prevRecordUid ? '['+prevRecordUid+']' : ''));
else alert('There are no more relations possible at this moment!');
if (this.isBelowMax(objectId)) {
this.makeAjaxCall('createNewRecord', this.getNumberOfRTE(), objectId+(prevRecordUid ? '['+prevRecordUid+']' : ''));
} else {
alert('There are no more relations possible at this moment!');
}
return false;
},
......
if (!this.data.unique || !this.data.unique[objectId]) {
selector.options[selector.selectedIndex].selected = false;
}
this.makeAjaxCall('createNewRecord', objectId, selectedValue);
this.makeAjaxCall('createNewRecord', this.getNumberOfRTE(), objectId, selectedValue);
}
return false;
},
......
importElement: function(objectId, table, uid, type) {
window.setTimeout(
function() {
inline.makeAjaxCall('createNewRecord', objectId, uid);
inline.makeAjaxCall('createNewRecord', this.getNumberOfRTE(), objectId, uid);
},
10
);
......
return $(objectId+'_div') && $(objectId+'_div').hasClassName('inlineIsNewRecord')
? true
: false;
},
getNumberOfRTE: function() {
var number = 0;
if (typeof RTEarea != 'undefined' && RTEarea.length > 0) {
number = RTEarea.length-1;
}
return number;
}
}
t3lib/class.t3lib_tceforms_inline.php (Arbeitskopie)
/**
* Initialize environment for AJAX calls
*
* @param string $method: Name of the method to be called
* @param array $arguments: Arguments to be delivered to the method
* @return void
*/
function initForAJAX($method, &$arguments) {
// Set t3lib_TCEforms::$RTEcounter to the given value:
if ($method == 'createNewRecord') {
$this->fObj->RTEcounter = intval(array_shift($arguments));
}
}
/**
* Handle AJAX calls to show a new inline-record of the given table.
* Normally this method is never called from inside TYPO3. Always from outside by AJAX.
*
typo3/alt_doc_ajax.php (Arbeitskopie)
$method = array_shift($this->ajax);
// Security check
if(!in_array($method, array('createNewRecord', 'setExpandedCollapsedState'))) return false;
if (!in_array($method, array('createNewRecord', 'setExpandedCollapsedState'))) {
return false;
}
// Perform the requested action:
$this->tceforms->inline->initForAJAX($method, $this->ajax);
$this->content = call_user_func_array(
array(&$this->tceforms->inline, $method),
$this->ajax
(2-2/5)