TYPO3
7.6
|
Public Member Functions | |
__construct () | |
init ($clause= '', $orderByFields= '') | |
addField ($field, $noCheck=false) | |
reset () | |
getBrowsableTree () | |
printTree ($treeArr= '') | |
PMicon ($row, $a, $c, $nextCount, $isOpen) | |
PM_ATagWrap ($icon, $cmd, $bMark= '', $isOpen=false) | |
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= '') | |
getCount ($uid) | |
getRootRecord () | |
getRecord ($uid) | |
getDataInit ($parentId) | |
getDataCount (&$res) | |
getDataNext (&$res) | |
getDataFree (&$res) | |
setDataFromArray (&$dataArr, $traverse=false, $pid=0) | |
setDataFromTreeArray (&$treeArr, &$treeLookupArr) | |
Public Attributes | |
$expandFirst = 0 | |
$expandAll = 0 | |
$thisScript = '' | |
$titleAttrib = 'title' | |
$ext_IconMode = false | |
$addSelfId = 0 | |
$title = 'no title' | |
$showDefaultTitleAttribute = false | |
$BE_USER = '' | |
$MOUNTS = null | |
$table = '' | |
$parentField = 'pid' | |
$clause = '' | |
$orderByFields = '' | |
$fieldArray = array('uid', 'pid', 'title') | |
$defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id' | |
$treeName = '' | |
$domIdPrefix = 'row' | |
$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() | |
Protected Member Functions | |
determineScriptUrl () | |
getThisScript () | |
getLanguageService () | |
getBackendUser () | |
getDatabaseConnection () | |
Base class for creating a browsable array/page/folder tree in HTML
Definition at line 30 of file AbstractTreeView.php.
__construct | ( | ) |
Constructor
Definition at line 273 of file AbstractTreeView.php.
References AbstractTreeView\determineScriptUrl().
addField | ( | $field, | |
$noCheck = false |
|||
) |
Adds a fieldname to the internal array ->fieldArray
string | $field | Field name to |
bool | $noCheck | If set, the fieldname will be set no matter what. Otherwise the field name must either be found as key in $GLOBALS['TCA'][$table]['columns'] or in the list ->defaultList |
Definition at line 339 of file AbstractTreeView.php.
References $GLOBALS, and GeneralUtility\inList().
addTagAttributes | ( | $icon, | |
$attr | |||
) |
Adds attributes to image tag.
string | $icon | Icon image tag |
string | $attr | Attributes to add, eg. ' border="0"' |
Definition at line 559 of file AbstractTreeView.php.
|
protected |
Sets the script url depending on being a module or script request
Definition at line 281 of file AbstractTreeView.php.
References GeneralUtility\_GP(), elseif, GeneralUtility\getIndpEnv(), and GeneralUtility\makeInstance().
Referenced by AbstractTreeView\__construct().
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
int | $id | Record id/key |
Definition at line 595 of file AbstractTreeView.php.
References AbstractTreeView\$bank.
Referenced by AbstractTreeView\getTree().
|
protected |
Definition at line 1009 of file AbstractTreeView.php.
References $GLOBALS.
Referenced by AbstractTreeView\getTree().
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)
Definition at line 371 of file AbstractTreeView.php.
References AbstractTreeView\$expandFirst, AbstractTreeView\$ids, AbstractTreeView\getIcon(), AbstractTreeView\getRecord(), AbstractTreeView\getRootIcon(), AbstractTreeView\getRootRecord(), AbstractTreeView\getTree(), AbstractTreeView\initializePositionSaving(), AbstractTreeView\PM_ATagWrap(), AbstractTreeView\printTree(), and AbstractTreeView\reset().
getCount | ( | $uid | ) |
Returns the number of records having the parent id, $uid
int | $uid | Id to count subitems for |
Definition at line 829 of file AbstractTreeView.php.
References AbstractTreeView\$clause, BackendUtility\deleteClause(), AbstractTreeView\getDatabaseConnection(), AbstractTreeView\getDataCount(), AbstractTreeView\getDataInit(), and BackendUtility\versioningPlaceholderClause().
Referenced by AbstractTreeView\getTree().
|
protected |
Definition at line 1017 of file AbstractTreeView.php.
References $GLOBALS.
Referenced by AbstractTreeView\getCount(), AbstractTreeView\getDataCount(), AbstractTreeView\getDataFree(), AbstractTreeView\getDataInit(), and AbstractTreeView\getDataNext().
getDataCount | ( | & | $res | ) |
Getting the tree data: Counting elements in resource
mixed | $res | Data handle |
Definition at line 902 of file AbstractTreeView.php.
References AbstractTreeView\getDatabaseConnection().
Referenced by AbstractTreeView\getCount(), and AbstractTreeView\getTree().
getDataFree | ( | & | $res | ) |
Getting the tree data: frees data handle
mixed | $res | Data handle |
Definition at line 947 of file AbstractTreeView.php.
References AbstractTreeView\getDatabaseConnection().
Referenced by AbstractTreeView\getTree().
getDataInit | ( | $parentId | ) |
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
int | $parentId | parent item id |
Definition at line 878 of file AbstractTreeView.php.
References AbstractTreeView\$clause, BackendUtility\deleteClause(), AbstractTreeView\getDatabaseConnection(), AbstractTreeView\reset(), and BackendUtility\versioningPlaceholderClause().
Referenced by AbstractTreeView\getCount(), and AbstractTreeView\getTree().
getDataNext | ( | & | $res | ) |
Getting the tree data: next entry
mixed | $res | Data handle |
Definition at line 920 of file AbstractTreeView.php.
References AbstractTreeView\getDatabaseConnection(), and BackendUtility\workspaceOL().
Referenced by AbstractTreeView\getTree().
getIcon | ( | $row | ) |
Get icon for the row.
array | int | $row | Item row or uid |
Definition at line 665 of file AbstractTreeView.php.
References AbstractTreeView\$title, BackendUtility\getRecord(), AbstractTreeView\getTitleAttrib(), GeneralUtility\makeInstance(), Icon\SIZE_SMALL, and AbstractTreeView\wrapIcon().
Referenced by PageTreeView\getBrowsableTree(), AbstractTreeView\getBrowsableTree(), and AbstractTreeView\getTree().
getId | ( | $row | ) |
Returns the id from the record (typ. uid)
array | $row | Record array |
Definition at line 709 of file AbstractTreeView.php.
Referenced by AbstractTreeView\getJumpToParam(), PageTreeView\printTree(), AbstractTreeView\printTree(), BrowseTreeView\wrapIcon(), PageTreeView\wrapTitle(), and AbstractTreeView\wrapTitle().
getJumpToParam | ( | $row | ) |
Returns jump-url parameter value.
array | $row | The record array. |
Definition at line 720 of file AbstractTreeView.php.
References AbstractTreeView\getId().
Referenced by BrowseTreeView\wrapIcon(), PageTreeView\wrapTitle(), and AbstractTreeView\wrapTitle().
|
protected |
Definition at line 1001 of file AbstractTreeView.php.
References $GLOBALS.
Referenced by AbstractTreeView\getTitleStr(), and ExportPageTreeView\wrapTitle().
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.
int | $uid | UID to look up |
Definition at line 859 of file AbstractTreeView.php.
References BackendUtility\getRecordWSOL().
Referenced by PageTreeView\getBrowsableTree(), and AbstractTreeView\getBrowsableTree().
getRootIcon | ( | $rec | ) |
Returns the root icon for a tree/mountpoint (defaults to the globe)
array | $rec | Record for root. |
Definition at line 653 of file AbstractTreeView.php.
References GeneralUtility\makeInstance(), Icon\SIZE_SMALL, and AbstractTreeView\wrapIcon().
Referenced by ExportPageTreeView\ext_tree(), PageTreeView\getBrowsableTree(), and AbstractTreeView\getBrowsableTree().
getRootRecord | ( | ) |
Returns root record for uid (<=0)
Definition at line 846 of file AbstractTreeView.php.
Referenced by PageTreeView\getBrowsableTree(), and AbstractTreeView\getBrowsableTree().
|
protected |
Definition at line 298 of file AbstractTreeView.php.
Referenced by PageTreeView\getBrowsableTree(), ElementBrowserFolderTreeView\PM_ATagWrap(), ElementBrowserPageTreeView\PM_ATagWrap(), AbstractTreeView\PM_ATagWrap(), ElementBrowserPageTreeView\printTree(), FolderTreeView\renderPMIconAndLink(), ElementBrowserPageTreeView\wrapTitle(), and ElementBrowserFolderTreeView\wrapTitle().
getTitleAttrib | ( | $row | ) |
Returns the value for the image "title" attribute
array | $row | The input row array (where the key "title" is used for the title) |
Definition at line 698 of file AbstractTreeView.php.
Referenced by AbstractTreeView\getIcon().
getTitleStr | ( | $row, | |
$titleLen = 30 |
|||
) |
Returns the title for the input record. If blank, a "no title" label (localized) will be returned. Do NOT htmlspecialchar the string from this function - has already been done.
array | $row | The input row array (where the key "title" is used for the title) |
int | $titleLen | Title length (30) |
Definition at line 684 of file AbstractTreeView.php.
References AbstractTreeView\$title, GeneralUtility\fixed_lgd_cs(), and AbstractTreeView\getLanguageService().
Referenced by AbstractTreeView\printTree().
getTree | ( | $uid, | |
$depth = 999 , |
|||
$depthData = '' |
|||
) |
Fetches the data for the tree
int | $uid | item id for which to select subitems (parent id) |
int | $depth | Max depth (recursivity limit) |
string | $depthData | HTML-code prefix for recursive calls. |
Definition at line 739 of file AbstractTreeView.php.
References AbstractTreeView\$buffer_idH, AbstractTreeView\expandNext(), AbstractTreeView\getBackendUser(), AbstractTreeView\getCount(), AbstractTreeView\getDataCount(), AbstractTreeView\getDataFree(), AbstractTreeView\getDataInit(), AbstractTreeView\getDataNext(), AbstractTreeView\getIcon(), AbstractTreeView\PMicon(), and AbstractTreeView\wrapStop().
Referenced by ExportPageTreeView\ext_tree(), PageTreeView\getBrowsableTree(), and AbstractTreeView\getBrowsableTree().
init | ( | $clause = '' , |
|
$orderByFields = '' |
|||
) |
Initialize the tree class. Needs to be overwritten
string | $clause | Record WHERE clause |
string | $orderByFields | Record ORDER BY field |
Definition at line 310 of file AbstractTreeView.php.
References AbstractTreeView\$clause, $GLOBALS, and AbstractTreeView\$orderByFields.
Referenced by FolderTreeView\__construct().
initializePositionSaving | ( | ) |
Get stored tree structure AND updating it if needed according to incoming PM GET var.
Definition at line 606 of file AbstractTreeView.php.
References GeneralUtility\_GP(), and AbstractTreeView\savePosition().
Referenced by PageTreeView\getBrowsableTree(), and AbstractTreeView\getBrowsableTree().
PM_ATagWrap | ( | $icon, | |
$cmd, | |||
$bMark = '' , |
|||
$isOpen = false |
|||
) |
Wrap the plus/minus icon in a link
string | $icon | HTML string to wrap, probably an image tag. |
string | $cmd | Command for 'PM' get var |
string | $bMark | If set, the link will have an anchor point (=$bMark) and a name attribute (=$bMark) |
bool | $isOpen |
Definition at line 512 of file AbstractTreeView.php.
References AbstractTreeView\getThisScript().
Referenced by AbstractTreeView\getBrowsableTree(), and AbstractTreeView\PMicon().
PMicon | ( | $row, | |
$a, | |||
$c, | |||
$nextCount, | |||
$isOpen | |||
) |
Generate the plus/minus icon for the browsable tree.
array | $row | Record for the entry |
int | $a | The current entry number |
int | $c | The total number of entries. If equal to $a, a "bottom" element is returned. |
int | $nextCount | The number of sub-elements to the current element. |
bool | $isOpen | The element was expanded to render subelements if this flag is set. |
Definition at line 491 of file AbstractTreeView.php.
References AbstractTreeView\PM_ATagWrap().
Referenced by AbstractTreeView\getTree().
printTree | ( | $treeArr = '' | ) |
Compiles the HTML code for displaying the structure found inside the ->tree array
array | string | $treeArr | "tree-array" - if blank string, the internal ->tree array is used. |
Definition at line 425 of file AbstractTreeView.php.
References AbstractTreeView\$tree, AbstractTreeView\getId(), AbstractTreeView\getTitleStr(), if, and AbstractTreeView\wrapTitle().
Referenced by FolderTreeView\getBrowsableTree(), and AbstractTreeView\getBrowsableTree().
reset | ( | ) |
Resets the tree, recs, ids, ids_hierarchy and orig_ids_hierarchy internal variables. Use it if you need it.
Definition at line 351 of file AbstractTreeView.php.
Referenced by ExportPageTreeView\ext_tree(), PageTreeView\getBrowsableTree(), AbstractTreeView\getBrowsableTree(), and AbstractTreeView\getDataInit().
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
Definition at line 636 of file AbstractTreeView.php.
References AbstractTreeView\$treeName.
Referenced by FolderTreeView\initializePositionSaving(), and AbstractTreeView\initializePositionSaving().
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.
array | $dataArr | The input array, see examples below in this script. |
bool | $traverse | Internal, for recursion. |
int | $pid | Internal, for recursion. |
Definition at line 966 of file AbstractTreeView.php.
References AbstractTreeView\$subLevelID.
setDataFromTreeArray | ( | & | $treeArr, |
& | $treeLookupArr | ||
) |
Sets the internal data arrays
array | $treeArr | Content for $this->data |
array | $treeLookupArr | Content for $this->dataLookup |
Definition at line 992 of file AbstractTreeView.php.
wrapIcon | ( | $icon, | |
$row | |||
) |
Wrapping the image tag, $icon, for the row, $row (except for mount points)
string | $icon | The image tag for the icon |
array | $row | The row for the current element |
Definition at line 547 of file AbstractTreeView.php.
Referenced by AbstractTreeView\getIcon(), and AbstractTreeView\getRootIcon().
wrapStop | ( | $str, | |
$row | |||
) |
Adds a red "+" to the input string, $str, if the field "php_tree_stop" in the $row (pages) is set
string | $str | Input string, like a page title for the tree |
array | $row | record row with "php_tree_stop" field |
Definition at line 572 of file AbstractTreeView.php.
References GeneralUtility\linkThisScript().
Referenced by AbstractTreeView\getTree().
wrapTitle | ( | $title, | |
$row, | |||
$bank = 0 |
|||
) |
Wrapping $title in a-tags.
string | $title | Title string |
string | $row | Item record |
int | $bank | Bank pointer (which mount point number) |
Definition at line 533 of file AbstractTreeView.php.
References AbstractTreeView\$bank, AbstractTreeView\$title, AbstractTreeView\getId(), AbstractTreeView\getJumpToParam(), and GeneralUtility\quoteJSvalue().
Referenced by AbstractTreeView\printTree().
$addSelfId = 0 |
Definition at line 68 of file AbstractTreeView.php.
$bank = 0 |
Definition at line 262 of file AbstractTreeView.php.
Referenced by AbstractTreeView\expandNext(), FileListFolderTree\wrapTitle(), PageTreeView\wrapTitle(), FolderTreeView\wrapTitle(), and AbstractTreeView\wrapTitle().
$BE_USER = '' |
Definition at line 90 of file AbstractTreeView.php.
$buffer_idH = array() |
Definition at line 223 of file AbstractTreeView.php.
Referenced by ExportPageTreeView\ext_tree(), and AbstractTreeView\getTree().
$clause = '' |
Definition at line 125 of file AbstractTreeView.php.
Referenced by ElementBrowserPageTreeView\__construct(), ExportPageTreeView\ext_tree(), AbstractTreeView\getCount(), AbstractTreeView\getDataInit(), PageTreeView\init(), BrowseTreeView\init(), and AbstractTreeView\init().
$data = false |
Definition at line 237 of file AbstractTreeView.php.
$dataLookup = false |
Definition at line 243 of file AbstractTreeView.php.
$defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id' |
Definition at line 151 of file AbstractTreeView.php.
$domIdPrefix = 'row' |
Definition at line 172 of file AbstractTreeView.php.
$expandAll = 0 |
Definition at line 43 of file AbstractTreeView.php.
$expandFirst = 0 |
Definition at line 37 of file AbstractTreeView.php.
Referenced by ExportPageTreeView\ext_tree(), and AbstractTreeView\getBrowsableTree().
$ext_IconMode = false |
Definition at line 62 of file AbstractTreeView.php.
$fieldArray = array('uid', 'pid', 'title') |
Definition at line 143 of file AbstractTreeView.php.
$ids = array() |
Definition at line 205 of file AbstractTreeView.php.
Referenced by ExportPageTreeView\ext_tree(), PageTreeView\getBrowsableTree(), and AbstractTreeView\getBrowsableTree().
$ids_hierarchy = array() |
Definition at line 211 of file AbstractTreeView.php.
$makeHTML = 1 |
Definition at line 180 of file AbstractTreeView.php.
$MOUNTS = null |
Definition at line 101 of file AbstractTreeView.php.
$orderByFields = '' |
Definition at line 134 of file AbstractTreeView.php.
Referenced by AbstractTreeView\init().
$orig_ids_hierarchy = array() |
Definition at line 217 of file AbstractTreeView.php.
$parentField = 'pid' |
Definition at line 116 of file AbstractTreeView.php.
$recs = array() |
Definition at line 268 of file AbstractTreeView.php.
$setRecs = 0 |
Definition at line 187 of file AbstractTreeView.php.
$showDefaultTitleAttribute = false |
Definition at line 82 of file AbstractTreeView.php.
$specUIDmap = array() |
Definition at line 230 of file AbstractTreeView.php.
$stored = array() |
Definition at line 256 of file AbstractTreeView.php.
$subLevelID = '_SUB_LEVEL' |
Definition at line 195 of file AbstractTreeView.php.
Referenced by AbstractTreeView\setDataFromArray().
$table = '' |
Definition at line 109 of file AbstractTreeView.php.
$thisScript = '' |
Definition at line 49 of file AbstractTreeView.php.
$title = 'no title' |
Definition at line 74 of file AbstractTreeView.php.
Referenced by AbstractTreeView\getIcon(), BrowseTreeView\getTitleStr(), AbstractTreeView\getTitleStr(), ExportPageTreeView\wrapTitle(), FileListFolderTree\wrapTitle(), ElementBrowserFolderTreeView\wrapTitle(), ElementBrowserPageTreeView\wrapTitle(), PageTreeView\wrapTitle(), FolderTreeView\wrapTitle(), and AbstractTreeView\wrapTitle().
$titleAttrib = 'title' |
Definition at line 55 of file AbstractTreeView.php.
$tree = array() |
Definition at line 250 of file AbstractTreeView.php.
Referenced by ElementBrowserPageTreeView\printTree(), PageTreeView\printTree(), and AbstractTreeView\printTree().
$treeName = '' |
Definition at line 162 of file AbstractTreeView.php.
Referenced by AbstractTreeView\savePosition().