[TYPO3] Cut and copy to 'Columns' view

tapio tapio.markula at dnainternet.net
Tue Jan 31 19:07:10 CET 2006


Hi

B. Kraft's 'kb_pm_paste' has nice 'Paste' to columns view
of the standard page module and I added that feature as a part
of 'tm_contentaccess' ( 'kb_pm_paste' and 'tm_contentaccess' conflicts
with each others and I must implement 'kb_pm_paste' as a part of my
plugin).


/**
              * adds paste link (B. Kraft) // this is now both in 
'kb_pm_paste' and 'tm_contentaccess'
              */

     function getPasteLink($row, $colPos = 0)    {
         $elFromTable = $this->clipObj->elFromTable('tt_content');
         if (count($elFromTable))    {
             return '&nbsp; <a 
href="'.htmlspecialchars($this->clipObj->pasteUrl('tt_content',$row['uid']?-$row['uid']:$this->id, 
1, $colPos)).'" onclick="'.htmlspecialchars('return 
'.$this->clipObj->confirmMsg('tt_content',$row,'after', 
$elFromTable)).'"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_pasteafter.gif','width="12" 
height="12"').' 
title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.php:clip_paste',1).'" 
alt="" /></a> &nbsp;';
             }
         return '';
         }


I tried add also 'cut' and 'paste' trying to understand B. Kraft's 
implementation

I tried to take them from 'class.db_list_extra.inc'
and modify


     function makeCopyAndClipLinks($row, $colPos = 0)    { /* modified 
on the base of function makeClip($table,$row) in 
'typo3/class.db_list_extra.inc' */
         global $TCA, $LANG;
         $table='tt_content';

                 // Show copy/cut icons:
         $isSel = (string)$this->clipObj->isSelected($table,$row['uid']);
         $cells[]='<a href="#" onclick="'.htmlspecialchars('return 
jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],1,($isSel=='copy'),array('returnUrl'=>'')).'\');').'">'.
 
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_copy'.($isSel=='copy'?'_h':'').'.gif','width="12" 
height="12"').' 
title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.copy',1).'" 
alt="" />'.
                 '</a>';
         $cells[]='<a href="#" onclick="'.htmlspecialchars('return 
jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],0,($isSel=='cut'),array('returnUrl'=>'')).'\');').'">'.
 
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_cut'.($isSel=='cut'?'_h':'').'.gif','width="12" 
height="12"').' 
title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.cut',1).'" alt="" 
/>'.
                 '</a>';


         return implode('',$cells);
     }

They simple didn't do anything - presumably don't get the JavaScript.
I didn'figure how to get them work and how to create a working function.

I could add them to my next version of plugin but
I didn't catch how to do them.



More information about the TYPO3-english mailing list