t3lib_clipboard Class Reference

List of all members.

Public Member Functions

 initializeClipboard ()
 lockToNormal ()
 setCmd ($cmd)
 setCurrentPad ($padIdent)
 endClipboard ()
 cleanUpCBC ($CBarr, $table, $removeDeselected=0)
 printClipboard ()
 printContentFromTab ($pad)
 padTitleWrap ($str, $pad)
 linkItemText ($str, $rec, $table=')
 selUrlDB ($table, $uid, $copy=0, $deselect=0, $baseArray=array())
 selUrlFile ($path, $copy=0, $deselect=0, $baseArray=array())
 pasteUrl ($table, $uid, $setRedirect=1)
 deleteUrl ($setRedirect=1, $file=0)
 editUrl ()
 removeUrl ($table, $uid)
 confirmMsg ($table, $rec, $type, $clElements)
 clLabel ($key, $Akey=labels')
 exportClipElementParameters ()
 removeElement ($el)
 saveClipboard ()
 currentMode ()
 cleanCurrent ()
 elFromTable ($matchTable=', $pad=')
 isSelected ($table, $uid)
 getSelectedRecord ($table=', $uid=')
 isElements ()
 makePasteCmdArray ($ref, $CMD)
 makeDeleteCmdArray ($CMD)
 makePasteCmdArray_file ($ref, $FILE)
 makeDeleteCmdArray_file ($FILE)
 initializeClipboard ()
 lockToNormal ()
 setCmd ($cmd)
 setCurrentPad ($padIdent)
 endClipboard ()
 cleanUpCBC ($CBarr, $table, $removeDeselected=0)
 printClipboard ()
 printContentFromTab ($pad)
 padTitleWrap ($str, $pad)
 linkItemText ($str, $rec, $table=')
 selUrlDB ($table, $uid, $copy=0, $deselect=0, $baseArray=array())
 selUrlFile ($path, $copy=0, $deselect=0, $baseArray=array())
 pasteUrl ($table, $uid, $setRedirect=1)
 deleteUrl ($setRedirect=1, $file=0)
 editUrl ()
 removeUrl ($table, $uid)
 confirmMsg ($table, $rec, $type, $clElements)
 clLabel ($key, $Akey=labels')
 exportClipElementParameters ()
 removeElement ($el)
 saveClipboard ()
 currentMode ()
 cleanCurrent ()
 elFromTable ($matchTable=', $pad=')
 isSelected ($table, $uid)
 getSelectedRecord ($table=', $uid=')
 isElements ()
 makePasteCmdArray ($ref, $CMD)
 makeDeleteCmdArray ($CMD)
 makePasteCmdArray_file ($ref, $FILE)
 makeDeleteCmdArray_file ($FILE)

Public Attributes

 $numberTabs = 3
 $clipData = array()
 $changed = 0
 $current = ''
 $backPath = ''
 $lockToNormal = 0
 $fileMode = 0

Detailed Description

Definition at line 97 of file class.t3lib_clipboard.php.


Member Function Documentation

t3lib_clipboard::cleanCurrent  ) 
 

This traverses the elements on the current clipboard pane and unsets elements which does not exist anymore or are disabled.

Returns:
void

Definition at line 762 of file class.t3lib_clipboard.php.

References t3lib_BEfunc::getRecord(), and table.

t3lib_clipboard::cleanCurrent  ) 
 

This traverses the elements on the current clipboard pane and unsets elements which does not exist anymore or are disabled.

Returns:
void

Definition at line 762 of file class.t3lib_clipboard.php.

References t3lib_BEfunc::getRecord(), and table.

t3lib_clipboard::cleanUpCBC CBarr,
table,
removeDeselected = 0
 

Cleans up an incoming element array $CBarr (Array selecting/deselecting elements)

Parameters:
array Element array from outside ("key" => "selected/deselected")
string $table is the 'table which is allowed'. Must be set.
boolean $removeDeselected can be set in order to remove entries which are marked for deselection.
Returns:
array Processed input $CBarr

Definition at line 271 of file class.t3lib_clipboard.php.

References table.

t3lib_clipboard::cleanUpCBC CBarr,
table,
removeDeselected = 0
 

Cleans up an incoming element array $CBarr (Array selecting/deselecting elements)

Parameters:
array Element array from outside ("key" => "selected/deselected")
string $table is the 'table which is allowed'. Must be set.
boolean $removeDeselected can be set in order to remove entries which are marked for deselection.
Returns:
array Processed input $CBarr

Definition at line 271 of file class.t3lib_clipboard.php.

References table.

t3lib_clipboard::clLabel key,
Akey = labels'
 

Clipboard label - getting from "EXT:lang/locallang_core.php:"

Parameters:
string Label Key
string Alternative key to "labels"
Returns:
string

Definition at line 671 of file class.t3lib_clipboard.php.

t3lib_clipboard::clLabel key,
Akey = labels'
 

Clipboard label - getting from "EXT:lang/locallang_core.php:"

Parameters:
string Label Key
string Alternative key to "labels"
Returns:
string

Definition at line 671 of file class.t3lib_clipboard.php.

Referenced by padTitleWrap(), and printContentFromTab().

t3lib_clipboard::confirmMsg table,
rec,
type,
clElements
 

Returns confirm JavaScript message

Parameters:
string Table name
mixed For records its an array, for files its a string (path)
string Type-code
array Array of selected elements
Returns:
string JavaScript "confirm" message

Definition at line 627 of file class.t3lib_clipboard.php.

References $conf, $GLOBALS, $table, $type, t3lib_div::fixed_lgd_cs(), t3lib_BEfunc::getRecordTitle(), getSelectedRecord(), lang, pages, and table.

t3lib_clipboard::confirmMsg table,
rec,
type,
clElements
 

Returns confirm JavaScript message

Parameters:
string Table name
mixed For records its an array, for files its a string (path)
string Type-code
array Array of selected elements
Returns:
string JavaScript "confirm" message

Definition at line 627 of file class.t3lib_clipboard.php.

References $conf, $GLOBALS, $table, $type, t3lib_div::fixed_lgd_cs(), t3lib_BEfunc::getRecordTitle(), getSelectedRecord(), lang, pages, and table.

t3lib_clipboard::currentMode  ) 
 

Returns the current mode, 'copy' or 'cut'

Returns:
string "copy" or "cut"

Definition at line 752 of file class.t3lib_clipboard.php.

t3lib_clipboard::currentMode  ) 
 

Returns the current mode, 'copy' or 'cut'

Returns:
string "copy" or "cut"

Definition at line 752 of file class.t3lib_clipboard.php.

Referenced by isSelected(), makePasteCmdArray(), and makePasteCmdArray_file().

t3lib_clipboard::deleteUrl setRedirect = 1,
file = 0
 

deleteUrl for current pad

Parameters:
boolean If set, then the redirect URL will point back to the current script, but with CB reset.
boolean If set, then the URL will link to the tce_file.php script in the typo3/ dir.
Returns:
string

Definition at line 576 of file class.t3lib_clipboard.php.

References t3lib_div::linkThisScript().

t3lib_clipboard::deleteUrl setRedirect = 1,
file = 0
 

deleteUrl for current pad

Parameters:
boolean If set, then the redirect URL will point back to the current script, but with CB reset.
boolean If set, then the URL will link to the tce_file.php script in the typo3/ dir.
Returns:
string

Definition at line 576 of file class.t3lib_clipboard.php.

References t3lib_div::linkThisScript().

t3lib_clipboard::editUrl  ) 
 

editUrl of all current elements ONLY database Links to alt_doc.php

Returns:
string The URL to alt_doc.php with parameters.

Definition at line 593 of file class.t3lib_clipboard.php.

References elFromTable(), and table.

t3lib_clipboard::editUrl  ) 
 

editUrl of all current elements ONLY database Links to alt_doc.php

Returns:
string The URL to alt_doc.php with parameters.

Definition at line 593 of file class.t3lib_clipboard.php.

References elFromTable(), and table.

t3lib_clipboard::elFromTable matchTable = ',
pad = '
 

Counts the number of elements from the table $matchTable. If $matchTable is blank, all tables (except '_FILE' of course) is counted.

Parameters:
string Table to match/count for.
string $pad can optionally be used to set another pad than the current.
Returns:
array Array with keys from the CB.

Definition at line 789 of file class.t3lib_clipboard.php.

References $k, and table.

t3lib_clipboard::elFromTable matchTable = ',
pad = '
 

Counts the number of elements from the table $matchTable. If $matchTable is blank, all tables (except '_FILE' of course) is counted.

Parameters:
string Table to match/count for.
string $pad can optionally be used to set another pad than the current.
Returns:
array Array with keys from the CB.

Definition at line 789 of file class.t3lib_clipboard.php.

References $k, and table.

Referenced by editUrl(), getSelectedRecord(), makeDeleteCmdArray(), makeDeleteCmdArray_file(), makePasteCmdArray(), and makePasteCmdArray_file().

t3lib_clipboard::endClipboard  ) 
 

Call this after initialization and setCmd in order to save the clipboard to the user session. The function will check if the internal flag ->changed has been set and if so, save the clipboard. Else not.

Returns:
void

Definition at line 258 of file class.t3lib_clipboard.php.

References saveClipboard().

t3lib_clipboard::endClipboard  ) 
 

Call this after initialization and setCmd in order to save the clipboard to the user session. The function will check if the internal flag ->changed has been set and if so, save the clipboard. Else not.

Returns:
void

Definition at line 258 of file class.t3lib_clipboard.php.

References saveClipboard().

Referenced by makeDeleteCmdArray(), makeDeleteCmdArray_file(), makePasteCmdArray(), makePasteCmdArray_file(), and printContentFromTab().

t3lib_clipboard::exportClipElementParameters  ) 
 

Creates GET parameters for linking to the export module.

Returns:
string GET parameters for current clipboard content to be exported.

Definition at line 680 of file class.t3lib_clipboard.php.

References t3lib_BEfunc::getRecord(), t3lib_div::isAllowedAbsPath(), and table.

t3lib_clipboard::exportClipElementParameters  ) 
 

Creates GET parameters for linking to the export module.

Returns:
string GET parameters for current clipboard content to be exported.

Definition at line 680 of file class.t3lib_clipboard.php.

References t3lib_BEfunc::getRecord(), t3lib_div::isAllowedAbsPath(), and table.

t3lib_clipboard::getSelectedRecord table = ',
uid = '
 

Returns item record $table,$uid if selected on current clipboard If table and uid is blank, the first element is returned. Makes sense only for DB records - not files!

Parameters:
string Table name
integer Element uid
Returns:
array Element record with extra field _RECORD_TITLE set to the title of the record...

Definition at line 834 of file class.t3lib_clipboard.php.

References elFromTable(), t3lib_BEfunc::getRecord(), t3lib_BEfunc::getRecordTitle(), and table.

t3lib_clipboard::getSelectedRecord table = ',
uid = '
 

Returns item record $table,$uid if selected on current clipboard If table and uid is blank, the first element is returned. Makes sense only for DB records - not files!

Parameters:
string Table name
integer Element uid
Returns:
array Element record with extra field _RECORD_TITLE set to the title of the record...

Definition at line 834 of file class.t3lib_clipboard.php.

References elFromTable(), t3lib_BEfunc::getRecord(), t3lib_BEfunc::getRecordTitle(), and table.

Referenced by confirmMsg().

t3lib_clipboard::initializeClipboard  ) 
 

Initialize the clipboard from the be_user session

Returns:
void

Definition at line 150 of file class.t3lib_clipboard.php.

References $clipData, a, t3lib_div::intInRange(), and t3lib_div::testInt().

t3lib_clipboard::initializeClipboard  ) 
 

Initialize the clipboard from the be_user session

Returns:
void

Definition at line 150 of file class.t3lib_clipboard.php.

References $clipData, a, t3lib_div::intInRange(), and t3lib_div::testInt().

t3lib_clipboard::isElements  ) 
 

Reports if the current pad has elements (does not check file/DB type OR if file/DBrecord exists or not. Only counting array)

Returns:
boolean True if elements exist.

Definition at line 852 of file class.t3lib_clipboard.php.

t3lib_clipboard::isElements  ) 
 

Reports if the current pad has elements (does not check file/DB type OR if file/DBrecord exists or not. Only counting array)

Returns:
boolean True if elements exist.

Definition at line 852 of file class.t3lib_clipboard.php.

Referenced by setCmd().

t3lib_clipboard::isSelected table,
uid
 

Verifies if the item $table/$uid is on the current pad. If the pad is "normal", the mode value is returned if the element existed. Thus you'll know if the item was copy or cut moded...

Parameters:
string Table name, (_FILE for files...)
integer Element uid (path for files)
Returns:
string

Definition at line 820 of file class.t3lib_clipboard.php.

References $k, $table, and currentMode().

t3lib_clipboard::isSelected table,
uid
 

Verifies if the item $table/$uid is on the current pad. If the pad is "normal", the mode value is returned if the element existed. Thus you'll know if the item was copy or cut moded...

Parameters:
string Table name, (_FILE for files...)
integer Element uid (path for files)
Returns:
string

Definition at line 820 of file class.t3lib_clipboard.php.

References $k, $table, and currentMode().

t3lib_clipboard::linkItemText str,
rec,
table = '
 

Wraps the title of the items listed in link-tags. The items will link to the page/folder where they originate from

Parameters:
string Title of element - must be htmlspecialchar'ed on beforehand.
mixed If array, a record is expected. If string, its a path
string Table name
Returns:
string

Definition at line 499 of file class.t3lib_clipboard.php.

References $GLOBALS, a, and table.

t3lib_clipboard::linkItemText str,
rec,
table = '
 

Wraps the title of the items listed in link-tags. The items will link to the page/folder where they originate from

Parameters:
string Title of element - must be htmlspecialchar'ed on beforehand.
mixed If array, a record is expected. If string, its a path
string Table name
Returns:
string

Definition at line 499 of file class.t3lib_clipboard.php.

References $GLOBALS, a, and table.

t3lib_clipboard::lockToNormal  ) 
 

Call this method after initialization if you want to lock the clipboard to operate on the normal pad only. Trying to switch pad through ->setCmd will not work This is used by the clickmenu since it only allows operation on single elements at a time (that is the "normal" pad)

Returns:
void

Definition at line 179 of file class.t3lib_clipboard.php.

References lockToNormal().

t3lib_clipboard::lockToNormal  ) 
 

Call this method after initialization if you want to lock the clipboard to operate on the normal pad only. Trying to switch pad through ->setCmd will not work This is used by the clickmenu since it only allows operation on single elements at a time (that is the "normal" pad)

Returns:
void

Definition at line 179 of file class.t3lib_clipboard.php.

Referenced by lockToNormal().

t3lib_clipboard::makeDeleteCmdArray CMD  ) 
 

Delete record entries in CMD array

Parameters:
array Command-array
Returns:
array Modified Command-array

Definition at line 922 of file class.t3lib_clipboard.php.

References $table, elFromTable(), endClipboard(), removeElement(), and table.

t3lib_clipboard::makeDeleteCmdArray CMD  ) 
 

Delete record entries in CMD array

Parameters:
array Command-array
Returns:
array Modified Command-array

Definition at line 922 of file class.t3lib_clipboard.php.

References $table, elFromTable(), endClipboard(), removeElement(), and table.

t3lib_clipboard::makeDeleteCmdArray_file FILE  ) 
 

Delete files in CMD array

Parameters:
array Command-array
Returns:
array Modified Command-array

Definition at line 987 of file class.t3lib_clipboard.php.

References elFromTable(), endClipboard(), and removeElement().

t3lib_clipboard::makeDeleteCmdArray_file FILE  ) 
 

Delete files in CMD array

Parameters:
array Command-array
Returns:
array Modified Command-array

Definition at line 987 of file class.t3lib_clipboard.php.

References elFromTable(), endClipboard(), and removeElement().

t3lib_clipboard::makePasteCmdArray ref,
CMD
 

Applies the proper paste configuration in the $cmd array send to tce_db.php. $ref is the target, see description below. The current pad is pasted

$ref: [tablename]:[paste-uid]. tablename is the name of the table from which elements *on the current clipboard* is pasted with the 'pid' paste-uid. No tablename means that all items on the clipboard (non-files) are pasted. This requires paste-uid to be positive though. so 'tt_content:-3' means 'paste tt_content elements on the clipboard to AFTER tt_content:3 record 'tt_content:30' means 'paste tt_content elements on the clipboard into page with id 30 ':30' means 'paste ALL database elements on the clipboard into page with id 30 ':-30' not valid.

Parameters:
string [tablename]:[paste-uid], see description
array Command-array
Returns:
array Modified Command-array

Definition at line 893 of file class.t3lib_clipboard.php.

References $table, currentMode(), elFromTable(), endClipboard(), removeElement(), and table.

t3lib_clipboard::makePasteCmdArray ref,
CMD
 

Applies the proper paste configuration in the $cmd array send to tce_db.php. $ref is the target, see description below. The current pad is pasted

$ref: [tablename]:[paste-uid]. tablename is the name of the table from which elements *on the current clipboard* is pasted with the 'pid' paste-uid. No tablename means that all items on the clipboard (non-files) are pasted. This requires paste-uid to be positive though. so 'tt_content:-3' means 'paste tt_content elements on the clipboard to AFTER tt_content:3 record 'tt_content:30' means 'paste tt_content elements on the clipboard into page with id 30 ':30' means 'paste ALL database elements on the clipboard into page with id 30 ':-30' not valid.

Parameters:
string [tablename]:[paste-uid], see description
array Command-array
Returns:
array Modified Command-array

Definition at line 893 of file class.t3lib_clipboard.php.

References $table, currentMode(), elFromTable(), endClipboard(), removeElement(), and table.

t3lib_clipboard::makePasteCmdArray_file ref,
FILE
 

Applies the proper paste configuration in the $file array send to tce_file.php. The current pad is pasted

Parameters:
string Reference to element (splitted by "|")
array Command-array
Returns:
array Modified Command-array

Definition at line 965 of file class.t3lib_clipboard.php.

References currentMode(), elFromTable(), endClipboard(), and removeElement().

t3lib_clipboard::makePasteCmdArray_file ref,
FILE
 

Applies the proper paste configuration in the $file array send to tce_file.php. The current pad is pasted

Parameters:
string Reference to element (splitted by "|")
array Command-array
Returns:
array Modified Command-array

Definition at line 965 of file class.t3lib_clipboard.php.

References currentMode(), elFromTable(), endClipboard(), and removeElement().

t3lib_clipboard::padTitleWrap str,
pad
 

Wraps title of pad in bold-tags and maybe the number of elements if any.

Parameters:
string String (already htmlspecialchars()'ed)
string Pad reference
Returns:
string HTML output (htmlspecialchar'ed content inside of tags.)

Definition at line 482 of file class.t3lib_clipboard.php.

References $GLOBALS, and clLabel().

t3lib_clipboard::padTitleWrap str,
pad
 

Wraps title of pad in bold-tags and maybe the number of elements if any.

Parameters:
string String (already htmlspecialchars()'ed)
string Pad reference
Returns:
string HTML output (htmlspecialchar'ed content inside of tags.)

Definition at line 482 of file class.t3lib_clipboard.php.

References $GLOBALS, and clLabel().

Referenced by printClipboard().

t3lib_clipboard::pasteUrl table,
uid,
setRedirect = 1
 

pasteUrl of the element (database and file) For the meaning of $table and $uid, please read from ->makePasteCmdArray!!! The URL will point to tce_file or tce_db depending in $table

Parameters:
string Tablename (_FILE for files)
mixed "destination": can be positive or negative indicating how the paste is done (paste into / paste after)
boolean If set, then the redirect URL will point back to the current script, but with CB reset.
Returns:
string

Definition at line 559 of file class.t3lib_clipboard.php.

References t3lib_div::linkThisScript(), and table.

t3lib_clipboard::pasteUrl table,
uid,
setRedirect = 1
 

pasteUrl of the element (database and file) For the meaning of $table and $uid, please read from ->makePasteCmdArray!!! The URL will point to tce_file or tce_db depending in $table

Parameters:
string Tablename (_FILE for files)
mixed "destination": can be positive or negative indicating how the paste is done (paste into / paste after)
boolean If set, then the redirect URL will point back to the current script, but with CB reset.
Returns:
string

Definition at line 559 of file class.t3lib_clipboard.php.

References t3lib_div::linkThisScript(), and table.

t3lib_clipboard::printClipboard  ) 
 

Prints the clipboard

Returns:
string HTML output

Definition at line 306 of file class.t3lib_clipboard.php.

References $LANG, $TBE_TEMPLATE, a, colspan, height, img, t3lib_extMgm::isLoaded(), t3lib_div::linkThisScript(), nowrap, padTitleWrap(), select, selected, table, td, and value.

t3lib_clipboard::printClipboard  ) 
 

Prints the clipboard

Returns:
string HTML output

Definition at line 306 of file class.t3lib_clipboard.php.

References $LANG, $TBE_TEMPLATE, a, colspan, height, img, t3lib_extMgm::isLoaded(), t3lib_div::linkThisScript(), nowrap, padTitleWrap(), select, selected, table, td, and value.

t3lib_clipboard::printContentFromTab pad  ) 
 

Print the content on a pad. Called from ->printClipboard()

Parameters:
string Pad reference
Returns:
array Array with table rows for the clipboard. private

Definition at line 408 of file class.t3lib_clipboard.php.

References $lines, $size, $table, $TBE_TEMPLATE, a, clLabel(), colspan, endClipboard(), t3lib_div::fixed_lgd_cs(), t3lib_BEfunc::getFileIcon(), t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getRecord(), t3lib_BEfunc::getRecordTitle(), t3lib_BEfunc::getThumbNail(), height, img, t3lib_div::inList(), t3lib_div::isAllowedAbsPath(), nbsp, nowrap, onclick, table, and td.

t3lib_clipboard::printContentFromTab pad  ) 
 

Print the content on a pad. Called from ->printClipboard()

Parameters:
string Pad reference
Returns:
array Array with table rows for the clipboard. private

Definition at line 408 of file class.t3lib_clipboard.php.

References $lines, $size, $table, $TBE_TEMPLATE, a, clLabel(), colspan, endClipboard(), t3lib_div::fixed_lgd_cs(), t3lib_BEfunc::getFileIcon(), t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getRecord(), t3lib_BEfunc::getRecordTitle(), t3lib_BEfunc::getThumbNail(), height, img, t3lib_div::inList(), t3lib_div::isAllowedAbsPath(), nbsp, nowrap, onclick, table, and td.

t3lib_clipboard::removeElement el  ) 
 

Removes element on clipboard

Parameters:
string Key of element in ->clipData array
Returns:
void

Definition at line 730 of file class.t3lib_clipboard.php.

t3lib_clipboard::removeElement el  ) 
 

Removes element on clipboard

Parameters:
string Key of element in ->clipData array
Returns:
void

Definition at line 730 of file class.t3lib_clipboard.php.

Referenced by makeDeleteCmdArray(), makeDeleteCmdArray_file(), makePasteCmdArray(), makePasteCmdArray_file(), and setCmd().

t3lib_clipboard::removeUrl table,
uid
 

Returns the remove-url (file and db) for file $table='_FILE' and $uid = shortmd5 hash of path

Parameters:
string Tablename
string uid integer/shortmd5 hash
Returns:
string URL

Definition at line 614 of file class.t3lib_clipboard.php.

References t3lib_div::linkThisScript(), and table.

t3lib_clipboard::removeUrl table,
uid
 

Returns the remove-url (file and db) for file $table='_FILE' and $uid = shortmd5 hash of path

Parameters:
string Tablename
string uid integer/shortmd5 hash
Returns:
string URL

Definition at line 614 of file class.t3lib_clipboard.php.

References t3lib_div::linkThisScript(), and table.

t3lib_clipboard::saveClipboard  ) 
 

Saves the clipboard, no questions asked. Use ->endClipboard normally (as it checks if changes has been done so saving is necessary)

Returns:
void private

Definition at line 742 of file class.t3lib_clipboard.php.