TYPO3
7.6
|
Public Member Functions | |
__construct () | |
initializeClipboard () | |
lockToNormal () | |
setCmd ($cmd) | |
setCurrentPad ($padIdent) | |
endClipboard () | |
cleanUpCBC ($CBarr, $table, $removeDeselected=0) | |
printClipboard () | |
printContentFromTab ($pad) | |
hasElements () | |
getLocalizations ($table, $parentRec, $bgColClass, $pad) | |
padTitleWrap ($str, $pad, $active) | |
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=true, array $update=null) | |
deleteUrl ($setRedirect=1, $file=0) | |
editUrl () | |
removeUrl ($table, $uid) | |
confirmMsg ($table, $rec, $type, $clElements, $columnLabel= '') | |
clLabel ($key, $Akey= 'labels') | |
removeElement ($el) | |
saveClipboard () | |
currentMode () | |
cleanCurrent () | |
elFromTable ($matchTable= '', $pad= '') | |
isSelected ($table, $uid) | |
getSelectedRecord ($table= '', $uid= '') | |
isElements () | |
makePasteCmdArray ($ref, $CMD, array $update=null) | |
makeDeleteCmdArray ($CMD) | |
makePasteCmdArray_file ($ref, $FILE) | |
makeDeleteCmdArray_file ($FILE) | |
Public Attributes | |
$numberTabs = 3 | |
$clipData = array() | |
$changed = 0 | |
$current = '' | |
$lockToNormal = 0 | |
$fileMode = 0 | |
Protected Member Functions | |
exportClipElementParameters () | |
getLanguageService () | |
getBackendUser () | |
getDatabaseConnection () | |
Protected Attributes | |
$iconFactory | |
TYPO3 clipboard for records and files
Definition at line 30 of file Clipboard.php.
__construct | ( | ) |
cleanCurrent | ( | ) |
This traverses the elements on the current clipboard pane and unsets elements which does not exist anymore or are disabled.
Definition at line 824 of file Clipboard.php.
cleanUpCBC | ( | $CBarr, | |
$table, | |||
$removeDeselected = 0 |
|||
) |
Cleans up an incoming element array $CBarr (Array selecting/deselecting elements)
array | $CBarr | Element array from outside ("key" => "selected/deselected") |
string | $table | The 'table which is allowed'. Must be set. |
bool | int | $removeDeselected | Can be set in order to remove entries which are marked for deselection. |
Definition at line 227 of file Clipboard.php.
clLabel | ( | $key, | |
$Akey = 'labels' |
|||
) |
Clipboard label - getting from "EXT:lang/locallang_core.xlf:"
string | $key | Label Key |
string | $Akey | Alternative key to "labels |
Definition at line 740 of file Clipboard.php.
Referenced by Clipboard\printClipboard(), and Clipboard\printContentFromTab().
confirmMsg | ( | $table, | |
$rec, | |||
$type, | |||
$clElements, | |||
$columnLabel = '' |
|||
) |
Returns confirm JavaScript message
string | $table | Table name |
mixed | $rec | For records its an array, for files its a string (path) |
string | $type | Type-code |
array | $clElements | Array of selected elements |
string | $columnLabel | Name of the content column |
Definition at line 695 of file Clipboard.php.
currentMode | ( | ) |
Returns the current mode, 'copy' or 'cut'
Definition at line 813 of file Clipboard.php.
Referenced by Clipboard\printClipboard().
deleteUrl | ( | $setRedirect = 1 , |
|
$file = 0 |
|||
) |
deleteUrl for current pad
bool | int | $setRedirect | If set, then the redirect URL will point back to the current script, but with CB reset. |
bool | int | $file | If set, then the URL will link to the tce_file.php script in the typo3/ dir. |
Definition at line 638 of file Clipboard.php.
Referenced by Clipboard\printClipboard().
editUrl | ( | ) |
editUrl of all current elements ONLY database Links to FormEngine
Definition at line 660 of file Clipboard.php.
Referenced by Clipboard\printClipboard().
elFromTable | ( | $matchTable = '' , |
|
$pad = '' |
|||
) |
Counts the number of elements from the table $matchTable. If $matchTable is blank, all tables (except '_FILE' of course) is counted.
string | $matchTable | Table to match/count for. |
string | $pad | Can optionally be used to set another pad than the current. |
Definition at line 858 of file Clipboard.php.
Referenced by Clipboard\printClipboard().
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.
Definition at line 211 of file Clipboard.php.
References Clipboard\saveClipboard().
|
protected |
Creates GET parameters for linking to the export module.
Definition at line 750 of file Clipboard.php.
Referenced by Clipboard\printClipboard().
|
protected |
Returns the current BE user.
Definition at line 1071 of file Clipboard.php.
Referenced by Clipboard\initializeClipboard(), Clipboard\printClipboard(), and Clipboard\printContentFromTab().
|
protected |
|
protected |
Returns LanguageService
Definition at line 1061 of file Clipboard.php.
Referenced by Clipboard\printClipboard().
getLocalizations | ( | $table, | |
$parentRec, | |||
$bgColClass, | |||
$pad | |||
) |
Gets all localizations of the current record.
string | $table | The table |
array | $parentRec | The current record |
string | $bgColClass | Class for the background color of a column |
string | $pad | Pad reference |
Definition at line 479 of file Clipboard.php.
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!
string | $table | Table name |
int | string | $uid | Element uid |
Definition at line 904 of file Clipboard.php.
hasElements | ( | ) |
Returns true if the clipboard contains elements
Definition at line 459 of file Clipboard.php.
initializeClipboard | ( | ) |
Initialize the clipboard from the be_user session
Definition at line 105 of file Clipboard.php.
References Clipboard\$clipData, Clipboard\$numberTabs, MathUtility\canBeInterpretedAsInteger(), MathUtility\forceIntegerInRange(), and Clipboard\getBackendUser().
isElements | ( | ) |
Reports if the current pad has elements (does not check file/DB type OR if file/DBrecord exists or not. Only counting array)
Definition at line 924 of file Clipboard.php.
Referenced by Clipboard\setCmd(), and Clipboard\setCurrentPad().
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...
string | $table | Table name, (_FILE for files...) |
int | $uid | Element uid (path for files) |
Definition at line 889 of file Clipboard.php.
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
string | $str | Title of element - must be htmlspecialchar'ed on beforehand. |
mixed | $rec | If array, a record is expected. If string, its a path |
string | $table | Table name |
Definition at line 543 of file Clipboard.php.
Referenced by Clipboard\printContentFromTab().
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)
Definition at line 130 of file Clipboard.php.
Referenced by Clipboard\setCurrentPad().
makeDeleteCmdArray | ( | $CMD | ) |
Delete record entries in CMD array
array | $CMD | Command-array |
Definition at line 993 of file Clipboard.php.
makeDeleteCmdArray_file | ( | $FILE | ) |
Delete files in CMD array
array | $FILE | Command-array |
Definition at line 1044 of file Clipboard.php.
makePasteCmdArray | ( | $ref, | |
$CMD, | |||
array | $update = null |
||
) |
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.
string | $ref | [tablename]:[paste-uid], see description |
array | $CMD | Command-array |
NULL|array | If additional values should get set in the copied/moved record this will be an array containing key=>value pairs |
Definition at line 952 of file Clipboard.php.
makePasteCmdArray_file | ( | $ref, | |
$FILE | |||
) |
Applies the proper paste configuration in the $file array send to tce_file.php. The current pad is pasted
string | $ref | Reference to element (splitted by "|") |
array | $FILE | Command-array |
Definition at line 1022 of file Clipboard.php.
padTitleWrap | ( | $str, | |
$pad, | |||
$active | |||
) |
Wraps title of pad in bold-tag and maybe the number of elements if any. Only applies bold-tag if the item is active
string | $str | String (already htmlspecialchars()'ed) |
string | $pad | Pad reference |
bool | $active | is currently active |
Definition at line 522 of file Clipboard.php.
Referenced by Clipboard\printClipboard().
pasteUrl | ( | $table, | |
$uid, | |||
$setRedirect = true , |
|||
array | $update = null |
||
) |
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
string | $table | Tablename (_FILE for files) |
mixed | $uid | "destination": can be positive or negative indicating how the paste is done (paste into / paste after) |
bool | $setRedirect | If set, then the redirect URL will point back to the current script, but with CB reset. |
array | NULL | $update | Additional key/value pairs which should get set in the moved/copied record (via DataHandler) |
Definition at line 613 of file Clipboard.php.
printClipboard | ( | ) |
Prints the clipboard
Definition at line 250 of file Clipboard.php.
References Clipboard\$current, Clipboard\$numberTabs, $url, Clipboard\clLabel(), Clipboard\currentMode(), JsConfirmation\DELETE, Clipboard\deleteUrl(), Clipboard\editUrl(), Clipboard\elFromTable(), Clipboard\exportClipElementParameters(), Clipboard\getBackendUser(), Clipboard\getLanguageService(), ExtensionManagementUtility\isLoaded(), GeneralUtility\linkThisScript(), SvgIconProvider\MARKUP_IDENTIFIER_INLINE, Clipboard\padTitleWrap(), Clipboard\printContentFromTab(), GeneralUtility\quoteJSvalue(), and Icon\SIZE_SMALL.
printContentFromTab | ( | $pad | ) |
Print the content on a pad. Called from ->printClipboard()
private
string | $pad | Pad reference |
Definition at line 383 of file Clipboard.php.
References $GLOBALS, Clipboard\clLabel(), GeneralUtility\fixed_lgd_cs(), GeneralUtility\formatSize(), Clipboard\getBackendUser(), ResourceFactory\getInstance(), BackendUtility\getRecordTitle(), BackendUtility\getRecordWSOL(), GeneralUtility\inList(), Clipboard\linkItemText(), GeneralUtility\quoteJSvalue(), Clipboard\removeUrl(), and Icon\SIZE_SMALL.
Referenced by Clipboard\printClipboard().
removeElement | ( | $el | ) |
Removes element on clipboard
string | $el | Key of element in ->clipData array |
Definition at line 790 of file Clipboard.php.
Referenced by Clipboard\setCmd().
removeUrl | ( | $table, | |
$uid | |||
) |
Returns the remove-url (file and db) for file $table='_FILE' and $uid = shortmd5 hash of path
string | $table | Tablename |
string | $uid | Uid integer/shortmd5 hash |
Definition at line 680 of file Clipboard.php.
Referenced by Clipboard\printContentFromTab().
saveClipboard | ( | ) |
Saves the clipboard, no questions asked. Use ->endClipboard normally (as it checks if changes has been done so saving is necessary)
private
Definition at line 803 of file Clipboard.php.
Referenced by Clipboard\endClipboard().
selUrlDB | ( | $table, | |
$uid, | |||
$copy = 0 , |
|||
$deselect = 0 , |
|||
$baseArray = array() |
|||
) |
Returns the select-url for database elements
string | $table | Table name |
int | $uid | Uid of record |
bool | int | $copy | If set, copymode will be enabled |
bool | int | $deselect | If set, the link will deselect, otherwise select. |
array | $baseArray | The base array of GET vars to be sent in addition. Notice that current GET vars WILL automatically be included. |
Definition at line 573 of file Clipboard.php.
selUrlFile | ( | $path, | |
$copy = 0 , |
|||
$deselect = 0 , |
|||
$baseArray = array() |
|||
) |
Returns the select-url for files
string | $path | Filepath |
bool | int | $copy | If set, copymode will be enabled |
bool | int | $deselect | If set, the link will deselect, otherwise select. |
array | $baseArray | The base array of GET vars to be sent in addition. Notice that current GET vars WILL automatically be included. |
Definition at line 592 of file Clipboard.php.
setCmd | ( | $cmd | ) |
The array $cmd may hold various keys which notes some action to take. Normally perform only one action at a time. In scripts like db_list.php / filelist/mod1/index.php the GET-var CB is used to control the clipboard.
Selecting / Deselecting elements Array $cmd['el'] has keys = element-ident, value = element value (see description of clipData array in header) Selecting elements for 'copy' should be done by simultaneously setting setCopyMode.
array | $cmd | Array of actions, see function description |
Definition at line 148 of file Clipboard.php.
References Clipboard\$current, Clipboard\isElements(), Clipboard\removeElement(), and Clipboard\setCurrentPad().
setCurrentPad | ( | $padIdent | ) |
Setting the current pad on clipboard
string | $padIdent | Key in the array $this->clipData |
Definition at line 190 of file Clipboard.php.
References Clipboard\$current, Clipboard\isElements(), and Clipboard\lockToNormal().
Referenced by Clipboard\setCmd().
$changed = 0 |
Definition at line 63 of file Clipboard.php.
$clipData = array() |
Definition at line 58 of file Clipboard.php.
Referenced by Clipboard\initializeClipboard().
$current = '' |
Definition at line 68 of file Clipboard.php.
Referenced by Clipboard\printClipboard(), Clipboard\setCmd(), and Clipboard\setCurrentPad().
$fileMode = 0 |
Definition at line 80 of file Clipboard.php.
|
protected |
Definition at line 85 of file Clipboard.php.
$lockToNormal = 0 |
Definition at line 73 of file Clipboard.php.
$numberTabs = 3 |
Definition at line 35 of file Clipboard.php.
Referenced by Clipboard\initializeClipboard(), and Clipboard\printClipboard().