[ Index ]
 

Code source de Typo3 4.1.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/t3lib/ -> class.t3lib_clipboard.php (sommaire)

Contains class for TYPO3 clipboard for records and files $Id: class.t3lib_clipboard.php 1965 2007-02-02 20:38:13Z masi $ Revised for TYPO3 3.6 July/2003 by Kasper Skaarhoj XHTML compliant

Author: Kasper Skaarhoj <kasperYYYY@typo3.com>
Poids: 1015 lignes (35 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

t3lib_clipboard:: (31 méthodes):
  initializeClipboard()
  lockToNormal()
  setCmd()
  setCurrentPad()
  endClipboard()
  cleanUpCBC()
  printClipboard()
  printContentFromTab()
  padTitleWrap()
  linkItemText()
  selUrlDB()
  selUrlFile()
  pasteUrl()
  deleteUrl()
  editUrl()
  removeUrl()
  confirmMsg()
  clLabel()
  exportClipElementParameters()
  removeElement()
  saveClipboard()
  currentMode()
  cleanCurrent()
  elFromTable()
  isSelected()
  getSelectedRecord()
  isElements()
  makePasteCmdArray()
  makeDeleteCmdArray()
  makePasteCmdArray_file()
  makeDeleteCmdArray_file()


Classe: t3lib_clipboard  - X-Ref

TYPO3 clipboard for records and files

initializeClipboard()   X-Ref
Initialize the clipboard from the be_user session

return: void

lockToNormal()   X-Ref
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)

return: void

setCmd($cmd)   X-Ref
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 / file_list.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.

param: array        Array of actions, see function description
return: void

setCurrentPad($padIdent)   X-Ref
Setting the current pad on clipboard

param: string        Key in the array $this->clipData
return: void

endClipboard()   X-Ref
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.

return: void

cleanUpCBC($CBarr,$table,$removeDeselected=0)   X-Ref
Cleans up an incoming element array $CBarr (Array selecting/deselecting elements)

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

printClipboard()   X-Ref
Prints the clipboard

return: string        HTML output

printContentFromTab($pad)   X-Ref
Print the content on a pad. Called from ->printClipboard()

param: string        Pad reference
return: array        Array with table rows for the clipboard.

padTitleWrap($str,$pad)   X-Ref
Wraps title of pad in bold-tags and maybe the number of elements if any.

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

linkItemText($str,$rec,$table='')   X-Ref
Wraps the title of the items listed in link-tags. The items will link to the page/folder where they originate from

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

selUrlDB($table,$uid,$copy=0,$deselect=0,$baseArray=array()   X-Ref
Returns the select-url for database elements

param: string        Table name
param: integer        Uid of record
param: boolean        If set, copymode will be enabled
param: boolean        If set, the link will deselect, otherwise select.
param: array        The base array of GET vars to be sent in addition. Notice that current GET vars WILL automatically be included.
return: string        URL linking to the current script but with the CB array set to select the element with table/uid

selUrlFile($path,$copy=0,$deselect=0,$baseArray=array()   X-Ref
Returns the select-url for files

param: string        Filepath
param: boolean        If set, copymode will be enabled
param: boolean        If set, the link will deselect, otherwise select.
param: array        The base array of GET vars to be sent in addition. Notice that current GET vars WILL automatically be included.
return: string        URL linking to the current script but with the CB array set to select the path

pasteUrl($table,$uid,$setRedirect=1)   X-Ref
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

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

deleteUrl($setRedirect=1,$file=0)   X-Ref
deleteUrl for current pad

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

editUrl()   X-Ref
editUrl of all current elements
ONLY database
Links to alt_doc.php

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

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

param: string        Tablename
param: string        uid integer/shortmd5 hash
return: string        URL

confirmMsg($table,$rec,$type,$clElements)   X-Ref
Returns confirm JavaScript message

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

clLabel($key,$Akey='labels')   X-Ref
Clipboard label - getting from "EXT:lang/locallang_core.php:"

param: string        Label Key
param: string        Alternative key to "labels"
return: string

exportClipElementParameters()   X-Ref
Creates GET parameters for linking to the export module.

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

removeElement($el)   X-Ref
Removes element on clipboard

param: string        Key of element in ->clipData array
return: void

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

return: void

currentMode()   X-Ref
Returns the current mode, 'copy' or 'cut'

return: string        "copy" or "cut"

cleanCurrent()   X-Ref
This traverses the elements on the current clipboard pane
and unsets elements which does not exist anymore or are disabled.

return: void

elFromTable($matchTable='',$pad='')   X-Ref
Counts the number of elements from the table $matchTable. If $matchTable is blank, all tables (except '_FILE' of course) is counted.

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

isSelected($table,$uid)   X-Ref
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...

param: string        Table name, (_FILE for files...)
param: integer        Element uid (path for files)
return: string

getSelectedRecord($table='',$uid='')   X-Ref
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!

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

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

return: boolean        True if elements exist.

makePasteCmdArray($ref,$CMD)   X-Ref
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.

param: string        [tablename]:[paste-uid], see description
param: array        Command-array
return: array        Modified Command-array

makeDeleteCmdArray($CMD)   X-Ref
Delete record entries in CMD array

param: array        Command-array
return: array        Modified Command-array

makePasteCmdArray_file($ref,$FILE)   X-Ref
Applies the proper paste configuration in the $file array send to tce_file.php.
The current pad is pasted

param: string        Reference to element (splitted by "|")
param: array        Command-array
return: array        Modified Command-array

makeDeleteCmdArray_file($FILE)   X-Ref
Delete files in CMD array

param: array        Command-array
return: array        Modified Command-array



Généré le : Sun Nov 25 17:13:16 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics