[TYPO3-dev] Problem with frontend clipboard

Tapio Markula tapio.markula at atwebteam.com
Thu Feb 8 09:13:41 CET 2007


Hi

I made for evaluation version of tm_contentaccess full-working
clipboard for moving content elements.
To edit panels added copy, cut, paste and clear functionalities.

That works ok with classic page module but there is a problem
with TemplaVoila.
Because functions in the page module of TemplaVoila are cross-linked
(class file for the paste functionality is linked to /mod1/index.php and 
sidebar api function).
it was impossible to use clipboard functions of TemplaVoila in
frontend. Extending original paste functionality for TemplaVoila
failed. I must use for paste a fake paste operation - move element.
The problem was that automatic clearing of clipboard doesn't work
after cut - (fake) paste operation. Clearing has own button.
The problem is that because paste is not a real paste but
flexform pointer operation, repeated pressing paste moves
element relative to the original movement (if moved from 2. right
to 2. fist content element, the movement continues with current
elements in the same positions).

function fe_clipboard()	{
...

		$this->t3libClipboardObj = 
t3lib_div::makeInstance('t3lib_clipboard');		// Start clipboard
		$this->t3libClipboardObj->initializeClipboard();	// Initialize - reads 
the clipboard content from the user session
		
if($myPOST['TSFE_EDIT']['cmd']=='paste'  || 
$myPOST['TSFE_EDIT']['cmd']=='up' || $myPOST['TSFE_EDIT']['cmd']=='down')
	$this->t3libClipboardObj->removeElement(key($this->t3libClipboardObj->clipData['normal']['el']));
}
that made just a fake operation - page without these params showed
paste buttons (they check, if clipboard has data) and in BE
paste buttons were visible.
Some way automatic clear clipboard after certain operation, would be
nice, but I don't figure how to do that correctly.
		
		




More information about the TYPO3-dev mailing list