Solutions Open Source

Référence de la classe t3lib_treeView

Graphe d'héritage de t3lib_treeView:

Inheritance graph
[légende]

Liste de tous les membres

Fonctions membres publiques

 init ($clause='', $orderByFields='')
 setTreeName ($treeName='')
 addField ($field, $noCheck=0)
 reset ()
 getBrowsableTree ()
 printTree ($treeArr='')
 PMicon ($row, $a, $c, $nextCount, $exp)
 PM_ATagWrap ($icon, $cmd, $bMark='')
 wrapTitle ($title, $row, $bank=0)
 wrapIcon ($icon, $row)
 addTagAttributes ($icon, $attr)
 wrapStop ($str, $row)
 expandNext ($id)
 initializePositionSaving ()
 savePosition ()
 getRootIcon ($rec)
 getIcon ($row)
 getTitleStr ($row, $titleLen=30)
 getTitleAttrib ($row)
 getId ($row)
 getJumpToParam ($row)
 getTree ($uid, $depth=999, $depthData='', $blankLineCode='', $subCSSclass='')
 getCount ($uid)
 getRootRecord ($uid)
 getRecord ($uid)
 getDataInit ($parentId, $subCSSclass='')
 getDataCount (&$res)
 getDataNext (&$res, $subCSSclass='')
 getDataFree (&$res)
 setDataFromArray (&$dataArr, $traverse=FALSE, $pid=0)
 setDataFromTreeArray (&$treeArr, &$treeLookupArr)

Attributs publics

 $expandFirst = 0
 $expandAll = 0
 $thisScript = ''
 $titleAttrib = 'title'
 $ext_IconMode = false
 $addSelfId = 0
 $title = 'no title'
 $showDefaultTitleAttribute = FALSE
 $highlightPagesWithVersions = TRUE
 $BE_USER = ''
 $MOUNTS = ''
 $table = ''
 $parentField = 'pid'
 $clause = ''
 $orderByFields = ''
 $fieldArray = Array('uid','title')
 $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id'
 $treeName = ''
 $domIdPrefix = 'row'
 $backPath
 $iconPath = ''
 $iconName = 'default.gif'
 $makeHTML = 1
 $setRecs = 0
 $subLevelID = '_SUB_LEVEL'
 $ids = Array()
 $ids_hierarchy = array()
 $orig_ids_hierarchy = array()
 $buffer_idH = array()
 $specUIDmap = array()
 $data = false
 $dataLookup = false
 $tree = Array()
 $stored = array()
 $bank = 0
 $recs = array()


Documentation des fonctions membres

t3lib_treeView::init ( clause = '',
orderByFields = '' 
)

Initialize the tree class. Needs to be overwritten Will set ->fieldsArray, ->backPath and ->clause

Paramètres:
string record WHERE clause
string record ORDER BY field
Renvoie:
void

t3lib_treeView::setTreeName ( treeName = ''  ) 

Sets the tree name which is used to identify the tree Used for JavaScript and other things

Paramètres:
string Default is the table name. Underscores are stripped.
Renvoie:
void

t3lib_treeView::addField ( field,
noCheck = 0 
)

Adds a fieldname to the internal array ->fieldArray

Paramètres:
string Field name to
boolean If set, the fieldname will be set no matter what. Otherwise the field name must either be found as key in $TCA[$table]['columns'] or in the list ->defaultList
Renvoie:
void

t3lib_treeView::reset (  ) 

Resets the tree, recs, ids, ids_hierarchy and orig_ids_hierarchy internal variables. Use it if you need it.

Renvoie:
void

t3lib_treeView::getBrowsableTree (  ) 

Will create and return the HTML code for a browsable tree Is based on the mounts found in the internal array ->MOUNTS (set in the constructor)

Renvoie:
string HTML code for the browsable tree

Réimplémentée dans t3lib_folderTree, filelistFolderTree, et webPageTree.

t3lib_treeView::printTree ( treeArr = ''  ) 

Compiles the HTML code for displaying the structure found inside the ->tree array

Paramètres:
array "tree-array" - if blank string, the internal ->tree array is used.
Renvoie:
string The HTML code for the tree

Réimplémentée dans localPageTree, localFolderTree, filelistFolderTree, webPageTree, tx_rtehtmlarea_pageTree, tx_rtehtmlarea_folderTree, et tx_rtehtmlarea_image_folderTree.

t3lib_treeView::PMicon ( row,
a,
c,
nextCount,
exp 
)

Generate the plus/minus icon for the browsable tree.

Paramètres:
array record for the entry
integer The current entry number
integer The total number of entries. If equal to $a, a "bottom" element is returned.
integer The number of sub-elements to the current element.
boolean The element was expanded to render subelements if this flag is set.
Renvoie:
string Image tag with the plus/minus icon. private
Voir également:
t3lib_pageTree::PMicon()

Réimplémentée dans t3lib_pageTree, filelistFolderTree, et webPageTree.

t3lib_treeView::PM_ATagWrap ( icon,
cmd,
bMark = '' 
)

Wrap the plus/minus icon in a link

Paramètres:
string HTML string to wrap, probably an image tag.
string Command for 'PM' get var
boolean If set, the link will have a anchor point (=$bMark) and a name attribute (=$bMark)
Renvoie:
string Link-wrapped input string private

Réimplémentée dans localPageTree, localFolderTree, localPageTree, printAllPageTree, localFolderTree, printAllFolderTree, localPageTree, et tx_rtehtmlarea_image_folderTree.

t3lib_treeView::wrapTitle ( title,
row,
bank = 0 
)

Wrapping $title in a-tags.

Paramètres:
string Title string
string Item record
integer Bank pointer (which mount point number)
Renvoie:
string private

Réimplémentée dans t3lib_folderTree, localPageTree, TBE_PageTree, filelistFolderTree, et webPageTree.

t3lib_treeView::wrapIcon ( icon,
row 
)

Wrapping the image tag, $icon, for the row, $row (except for mount points)

Paramètres:
string The image tag for the icon
array The row for the current element
Renvoie:
string The processed icon input value. private

Réimplémentée dans t3lib_browseTree, t3lib_folderTree, localPageTree, localPageTree, localPageTree, localPageTree, printAllPageTree, localFolderTree, et localPageTree.

t3lib_treeView::addTagAttributes ( icon,
attr 
)

Adds attributes to image tag.

Paramètres:
string Icon image tag
string Attributes to add, eg. ' border="0"'
Renvoie:
string Image tag, modified with $attr attributes added.

t3lib_treeView::wrapStop ( str,
row 
)

Adds a red "+" to the input string, $str, if the field "php_tree_stop" in the $row (pages) is set

Paramètres:
string Input string, like a page title for the tree
array record row with "php_tree_stop" field
Renvoie:
string Modified string private

Réimplémentée dans webPageTree.

t3lib_treeView::expandNext ( id  ) 

Returns true/false if the next level for $id should be expanded - based on data in $this->stored[][] and ->expandAll flag. Extending parent function

Paramètres:
integer record id/key
Renvoie:
boolean private
Voir également:
t3lib_pageTree::expandNext()

Réimplémentée dans t3lib_pageTree, et localPageTree.

t3lib_treeView::initializePositionSaving (  ) 

Get stored tree structure AND updating it if needed according to incoming PM GET var.

Renvoie:
void private

Réimplémentée dans t3lib_folderTree, t3lib_pageTree, localPageTree, et localFolderTree.

t3lib_treeView::savePosition (  ) 

Saves the content of ->stored (keeps track of expanded positions in the tree) $this->treeName will be used as key for BE_USER->uc[] to store it in

Renvoie:
void private

t3lib_treeView::getRootIcon ( rec  ) 

Returns the root icon for a tree/mountpoint (defaults to the globe)

Paramètres:
array Record for root.
Renvoie:
string Icon image tag.

t3lib_treeView::getIcon ( row  ) 

Get icon for the row. If $this->iconPath and $this->iconName is set, try to get icon based on those values.

Paramètres:
array Item row.
Renvoie:
string Image tag.

t3lib_treeView::getTitleStr ( row,
titleLen = 30 
)

Returns the title for the input record. If blank, a "no title" labele (localized) will be returned. Do NOT htmlspecialchar the string from this function - has already been done.

Paramètres:
array The input row array (where the key "title" is used for the title)
integer Title length (30)
Renvoie:
string The title.

Réimplémentée dans t3lib_browseTree, et t3lib_folderTree.

t3lib_treeView::getTitleAttrib ( row  ) 

Returns the value for the image "title" attribute

Paramètres:
array The input row array (where the key "title" is used for the title)
Renvoie:
string The attribute value (is htmlspecialchared() already)
Voir également:
wrapIcon()

Réimplémentée dans t3lib_browseTree.

t3lib_treeView::getId ( row  ) 

Returns the id from the record (typ. uid)

Paramètres:
array Record array
Renvoie:
integer The "uid" field value.

Réimplémentée dans t3lib_folderTree.

t3lib_treeView::getJumpToParam ( row  ) 

Returns jump-url parameter value.

Paramètres:
array The record array.
Renvoie:
string The jump-url parameter.

Réimplémentée dans t3lib_folderTree.

t3lib_treeView::getTree ( uid,
depth = 999,
depthData = '',
blankLineCode = '',
subCSSclass = '' 
)

Fetches the data for the tree

Paramètres:
integer item id for which to select subitems (parent id)
integer Max depth (recursivity limit)
string HTML-code prefix for recursive calls.
string ? (internal)
string CSS class to use for

sub-elements

Renvoie:
integer The count of items on the level

t3lib_treeView::getCount ( uid  ) 

Returns the number of records having the parent id, $uid

Paramètres:
integer id to count subitems for
Renvoie:
integer private

Réimplémentée dans t3lib_folderTree.

t3lib_treeView::getRootRecord ( uid  ) 

Returns root record for uid (<=0)

Paramètres:
integer uid, <= 0 (normally, this does not matter)
Renvoie:
array Array with title/uid keys with values of $this->title/0 (zero)

t3lib_treeView::getRecord ( uid  ) 

Returns the record for a uid. For tables: Looks up the record in the database. For arrays: Returns the fake record for uid id.

Paramètres:
integer UID to look up
Renvoie:
array The record

t3lib_treeView::getDataInit ( parentId,
subCSSclass = '' 
)

Getting the tree data: Selecting/Initializing data pointer to items for a certain parent id. For tables: This will make a database query to select all children to "parent" For arrays: This will return key to the ->dataLookup array

Paramètres:
integer parent item id
string Class for sub-elements.
Renvoie:
mixed data handle (Tables: An sql-resource, arrays: A parentId integer. -1 is returned if there were NO subLevel.) private

t3lib_treeView::getDataCount ( &$  res  ) 

Getting the tree data: Counting elements in resource

Paramètres:
mixed data handle
Renvoie:
integer number of items private
Voir également:
getDataInit()

t3lib_treeView::getDataNext ( &$  res,
subCSSclass = '' 
)

Getting the tree data: next entry

Paramètres:
mixed data handle
string CSS class for sub elements (workspace related)
Renvoie:
array item data array OR FALSE if end of elements. private
Voir également:
getDataInit()

t3lib_treeView::getDataFree ( &$  res  ) 

Getting the tree data: frees data handle

Paramètres:
mixed data handle
Renvoie:
void private

t3lib_treeView::setDataFromArray ( &$  dataArr,
traverse = FALSE,
pid = 0 
)

Used to initialize class with an array to browse. The array inputted will be traversed and an internal index for lookup is created. The keys of the input array are perceived as "uid"s of records which means that keys GLOBALLY must be unique like uids are. "uid" and "pid" "fakefields" are also set in each record. All other fields are optional.

Paramètres:
array The input array, see examples below in this script.
boolean Internal, for recursion.
integer Internal, for recursion.
Renvoie:
void

t3lib_treeView::setDataFromTreeArray ( &$  treeArr,
&$  treeLookupArr 
)

Sets the internal data arrays

Paramètres:
array Content for $this->data
array Content for $this->dataLookup
Renvoie:
void


Documentation des données membres

t3lib_treeView::$expandFirst = 0

Réimplémentée dans localPageTree, printAllPageTree, localFolderTree, et printAllFolderTree.

t3lib_treeView::$expandAll = 0

Réimplémentée dans localPageTree, printAllPageTree, localFolderTree, et printAllFolderTree.

t3lib_treeView::$thisScript = ''

t3lib_treeView::$titleAttrib = 'title'

t3lib_treeView::$ext_IconMode = false

Réimplémentée dans localFolderTree, filelistFolderTree, webPageTree, et tx_rtehtmlarea_image_folderTree.

t3lib_treeView::$addSelfId = 0

t3lib_treeView::$title = 'no title'

t3lib_treeView::$showDefaultTitleAttribute = FALSE

t3lib_treeView::$highlightPagesWithVersions = TRUE

t3lib_treeView::$BE_USER = ''

Needs to be initialized with $GLOBALS['BE_USER'] Done by default in init()

t3lib_treeView::$MOUNTS = ''

Needs to be initialized with e.g. $GLOBALS['WEBMOUNTS'] Default setting in init() is 0 => 0 The keys are mount-ids (can be anything basically) and the values are the ID of the root element (COULD be zero or anything else. For pages that would be the uid of the page, zero for the pagetree root.)

t3lib_treeView::$table = ''

Database table to get the tree data from. Leave blank if data comes from an array.

t3lib_treeView::$parentField = 'pid'

Defines the field of $table which is the parent id field (like pid for table pages).

t3lib_treeView::$clause = ''

WHERE clause used for selecting records for the tree. Is set by function init. Only makes sense when $this->table is set.

Voir également:
init()

t3lib_treeView::$orderByFields = ''

Field for ORDER BY. Is set by function init. Only makes sense when $this->table is set.

Voir également:
init()

t3lib_treeView::$fieldArray = Array('uid','title')

Default set of fields selected from the tree table. Make SURE that these fields names listed herein are actually possible to select from $this->table (if that variable is set to a TCA table name)

Voir également:
addField()

Réimplémentée dans t3lib_pageTree.

t3lib_treeView::$defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id'

List of other fields which are ALLOWED to set (here, based on the "pages" table!)

Voir également:
addField()

Réimplémentée dans t3lib_pageTree.

t3lib_treeView::$treeName = ''

Unique name for the tree. Used as key for storing the tree into the BE users settings. Used as key to pass parameters in links. MUST NOT contain underscore chars. etc.

t3lib_treeView::$domIdPrefix = 'row'

A prefix for table cell id's which will be wrapped around an item. Can be used for highlighting by JavaScript. Needs to be unique if multiple trees are on one HTML page.

Voir également:
printTree()

t3lib_treeView::$backPath

Back path for icons

t3lib_treeView::$iconPath = ''

Icon file path.

t3lib_treeView::$iconName = 'default.gif'

Icon file name for item icons.

t3lib_treeView::$makeHTML = 1

If true, HTML code is also accumulated in ->tree array during rendering of the tree. If 2, then also the icon prefix code (depthData) is stored

t3lib_treeView::$setRecs = 0

If true, records as selected will be stored internally in the ->recs array

Réimplémentée dans t3lib_pageTree.

t3lib_treeView::$subLevelID = '_SUB_LEVEL'

Sets the associative array key which identifies a new sublevel if arrays are used for trees. This value has formerly been "subLevel" and "--sublevel--"

t3lib_treeView::$ids = Array()

t3lib_treeView::$ids_hierarchy = array()

t3lib_treeView::$orig_ids_hierarchy = array()

t3lib_treeView::$buffer_idH = array()

t3lib_treeView::$specUIDmap = array()

t3lib_treeView::$data = false

t3lib_treeView::$dataLookup = false

t3lib_treeView::$tree = Array()

t3lib_treeView::$stored = array()

t3lib_treeView::$bank = 0

t3lib_treeView::$recs = array()


La documentation de cette classe a été générée à partir du fichier suivant :
Généré le Fri Aug 31 11:42:57 2007 pour OBLADY - Typo3 API v4.1.2 par  doxygen 1.5.3