ExportPageTreeView extends AbstractTreeView

Extension of the page tree class. Used to get the tree of pages to export.

Internal

This class is not considered part of the public TYPO3 API.

Table of Contents

Properties

$bank  : int
Points to the current mountpoint key
$buffer_idH  : array<string|int, mixed>
$makeHTML  : bool
If true, HTML code is also accumulated in ->tree array during rendering of the tree
$orderByFields  : string
Field for ORDER BY. Is set by function init.
$orig_ids_hierarchy  : array<string|int, mixed>
$tree  : array<string|int, mixed>
$clause  : string
WHERE clause used for selecting records for the tree. Is set by function init.
$expandAll  : bool
If set, then ALL items will be expanded, regardless of stored settings.
$fieldArray  : array<string|int, mixed>
Default set of fields selected from the tree table.
$ids  : array<string|int, mixed>
$ids_hierarchy  : array<string|int, mixed>
$parentField  : string
Defines the field of $table which is the parent id field (like pid for table pages).
$table  : string
Database table to get the tree data from.

Methods

addField()  : void
buildTreeByLevels()  : void
Construction of the tree structure with predefined depth.
expandNext()  : bool
Returns TRUE/FALSE if the next level for $id should be expanded - based on the ->expandAll flag.
getTree()  : int<0, max>
Fetches the data for the tree
init()  : mixed
Init function REMEMBER to feed a $clause which will filter out non-readable pages!
printTree()  : string
Compiles the HTML code for displaying the structure found inside the ->tree array
buildTree()  : void
Creation of a tree structure with predefined depth to prepare the export.
getBackendUser()  : BackendUserAuthentication
getCount()  : int
Returns the number of records having the parent id, $uid
getDataInit()  : Result
Getting the tree data: Selecting/Initializing data pointer to items for a certain parent id.
getDataNext()  : array<string|int, mixed>|false
Getting the tree data: next entry
getIcon()  : string
Get the icon markup for the row
getLanguageService()  : LanguageService
getTitleAttrib()  : string
Creates title attribute content for pages.
getTitleStr()  : string
Returns the title for the input record. If blank, a "no title" label (localized) will be returned.
PMicon()  : string
Wrapping Plus/Minus icon, unused in Export Page Tree
reset()  : void
Resets the tree, recs, ids, ids_hierarchy and orig_ids_hierarchy internal variables. Use it if you need it.

Properties

$bank

Points to the current mountpoint key

public int $bank = 0

$buffer_idH

public array<string|int, mixed> $buffer_idH = []

$makeHTML

If true, HTML code is also accumulated in ->tree array during rendering of the tree

public bool $makeHTML = true

$orderByFields

Field for ORDER BY. Is set by function init.

public string $orderByFields = 'sorting'
Tags
see
init()

$orig_ids_hierarchy

public array<string|int, mixed> $orig_ids_hierarchy = []

$tree

public array<string|int, mixed> $tree = []

$clause

WHERE clause used for selecting records for the tree. Is set by function init.

protected string $clause = ''
Tags
see
init()

$expandAll

If set, then ALL items will be expanded, regardless of stored settings.

protected bool $expandAll = false

$fieldArray

Default set of fields selected from the tree table.

protected array<string|int, mixed> $fieldArray = ['uid', 'pid', 'title', 'is_siteroot', 'doktype', 'nav_title', 'mount_pid', 'php_tree_stop', 't3ver_state', 'hidden', 'starttime', 'endtime', 'fe_group', 'module', 'extendToSubpages', 'nav_hide', 't3ver_wsid', 'crdate', 'tstamp', 'sorting', 'deleted', 'perms_userid', 'perms_groupid', 'perms_user', 'perms_group', 'perms_everybody', 'editlock', 'l18n_cfg']

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)

Tags
see
addField()

$ids

protected array<string|int, mixed> $ids = []

$ids_hierarchy

protected array<string|int, mixed> $ids_hierarchy = []

$parentField

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

protected string $parentField = 'pid'

$table

Database table to get the tree data from.

protected string $table = 'pages'

Leave blank if data comes from an array.

Methods

addField()

public addField(string $field) : void
Parameters
$field : string

buildTreeByLevels()

Construction of the tree structure with predefined depth.

public buildTreeByLevels(int $pid, int $levels) : void
Parameters
$pid : int

Page ID

$levels : int

Page tree levels

expandNext()

Returns TRUE/FALSE if the next level for $id should be expanded - based on the ->expandAll flag.

public expandNext(int $id) : bool

Extending parent function

Parameters
$id : int

Record id/key

Internal
Tags
see
PageTreeView::expandNext()
Return values
bool

getTree()

Fetches the data for the tree

public getTree(int $uid[, int $depth = 999 ][, string $depthData = '' ]) : int<0, max>
Parameters
$uid : int

item id for which to select subitems (parent id)

$depth : int = 999

Max depth (recursivity limit)

$depthData : string = ''

HTML-code prefix for recursive calls.

Return values
int<0, max>

The count of items on the level

init()

Init function REMEMBER to feed a $clause which will filter out non-readable pages!

public init([string $clause = '' ][, string $orderByFields = '' ]) : mixed
Parameters
$clause : string = ''

Part of where query which will filter out non-readable pages.

$orderByFields : string = ''

Record ORDER BY field

printTree()

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

public printTree([array<string|int, mixed>|string $treeArr = '' ]) : string
Parameters
$treeArr : array<string|int, mixed>|string = ''

"tree-array" - if blank string, the internal ->tree array is used.

Return values
string

The HTML code for the tree

buildTree()

Creation of a tree structure with predefined depth to prepare the export.

protected buildTree(int $pid, int $levels, bool $checkSub) : void
Parameters
$pid : int

Page ID

$levels : int

Page tree levels

$checkSub : bool

Should root page be checked for sub pages?

getCount()

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

protected getCount(int $uid) : int
Parameters
$uid : int

Id to count subitems for

Return values
int

getDataInit()

Getting the tree data: Selecting/Initializing data pointer to items for a certain parent id.

protected getDataInit(int $parentId) : Result

For tables: This will make a database query to select all children to "parent"

Parameters
$parentId : int
Return values
Result

getDataNext()

Getting the tree data: next entry

protected getDataNext(Result $res) : array<string|int, mixed>|false
Parameters
$res : Result
Tags
see
getDataInit()
Return values
array<string|int, mixed>|false

getIcon()

Get the icon markup for the row

protected getIcon(array<string|int, mixed> $row) : string
Parameters
$row : array<string|int, mixed>

The row to get the icon for

Return values
string

The icon markup, wrapped into a span tag, with the records title as title attribute

getTitleAttrib()

Creates title attribute content for pages.

protected getTitleAttrib(array<string|int, mixed> $row) : string

Uses API function in \TYPO3\CMS\Backend\Utility\BackendUtility which will retrieve lots of useful information for pages.

Parameters
$row : array<string|int, mixed>

The table row.

Return values
string

getTitleStr()

Returns the title for the input record. If blank, a "no title" label (localized) will be returned.

protected getTitleStr(array<string|int, mixed> $row, int $titleLen) : string

Do NOT htmlspecialchar the string from this function - has already been done.

Parameters
$row : array<string|int, mixed>

The input row array (where the key "title" is used for the title)

$titleLen : int

Title length (30)

Return values
string

The title.

PMicon()

Wrapping Plus/Minus icon, unused in Export Page Tree

protected PMicon(mixed $row, mixed $a, mixed $c, mixed $nextCount, mixed $isOpen) : string
Parameters
$row : mixed

Record for the entry

$a : mixed

The current entry number

$c : mixed

The total number of entries. If equal to $a, a "bottom" element is returned.

$nextCount : mixed

The number of sub-elements to the current element.

$isOpen : mixed

The element was expanded to render subelements if this flag is set.

Return values
string

Image tag with the plus/minus icon.

reset()

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

protected reset() : void

        
On this page

Search results