‪TYPO3CMS  10.4
TYPO3\CMS\Backend\Tree\View\FolderTreeView Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Tree\View\FolderTreeView:
TYPO3\CMS\Backend\Tree\View\AbstractTreeView TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView TYPO3\CMS\Filelist\FileListFolderTree

Public Member Functions

 __construct ()
 
string PMicon ($folderObject, $subFolderCounter, $totalSubFolders, $nextCount, $isExpanded)
 
string PMiconATagWrap ($icon, $cmd, $isExpand=true)
 
string wrapIcon ($icon, $folderObject)
 
string wrapTitle ($title, $folderObject, $bank=0)
 
int getId ($folderObject)
 
string getJumpToParam ($folderObject)
 
string getTitleStr ($row, $titleLen=30)
 
string getTitleAttrib ($folderObject)
 
string getBrowsableTree ()
 
 getBrowseableTreeForStorage (ResourceStorage $storageObject)
 
int getFolderTree (Folder $folderObject, $depth=999, $type='')
 
string printTree ($treeItems='')
 
int getNumberOfSubfolders (Folder $folderObject)
 
 initializePositionSaving ()
 
bool getAjaxStatus ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView
 init ($clause='', $orderByFields='')
 
 addField ($field, $noCheck=false)
 
 reset ()
 
string PM_ATagWrap ($icon, $cmd, $bMark='', $isOpen=false)
 
string addTagAttributes ($icon, $attr)
 
string wrapStop ($str, $row)
 
bool expandNext ($id)
 
 savePosition ()
 
string getRootIcon ($rec)
 
string getIcon ($row)
 
int getTree ($uid, $depth=999, $depthData='')
 
int getCount ($uid)
 
array getRootRecord ()
 
array getRecord ($uid)
 
mixed getDataInit ($parentId)
 
int getDataCount (&$res)
 
array bool getDataNext (&$res)
 
 getDataFree (&$res)
 

Public Attributes

string $titleAttrib = ''
 
string $treeName = 'folder'
 
string $domIdPrefix = 'folder'
 
- ‪Public Attributes inherited from ‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView
bool $expandFirst = false
 
bool $expandAll = false
 
string $thisScript = ''
 
string $titleAttrib = 'title'
 
bool $ext_IconMode = false
 
bool $ext_showPathAboveMounts = false
 
int $addSelfId = 0
 
string $title = 'no title'
 
bool $showDefaultTitleAttribute = false
 
TYPO3 CMS Core Authentication BackendUserAuthentication string $BE_USER = ''
 
array null $MOUNTS
 
string $table = ''
 
string $parentField = 'pid'
 
string $clause = ''
 
string $orderByFields = ''
 
array $fieldArray = array( 'uid', 'pid', 'title', 'is_siteroot' )
 
string $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id'
 
string $treeName = ''
 
string $domIdPrefix = 'row'
 
int $makeHTML = 1
 
int $setRecs = 0
 
array $ids = array( )
 
array $ids_hierarchy = array( )
 
array $orig_ids_hierarchy = array( )
 
array $buffer_idH = array( )
 
array $specUIDmap = array( )
 
array $tree = array( )
 
array $stored = array( )
 
int $bank = 0
 
array $recs = array( )
 

Protected Member Functions

string renderPMIconAndLink ($cmd, $isOpen)
 
string getTableNameForClickMenu (Folder $folderObject)
 
int getShortHashNumberForStorage (ResourceStorage $storageObject=null, Folder $startingPointFolder=null)
 
array evaluateExpandCollapseParameter ($PM=null)
 
string generateExpandCollapseParameter ($mountKey=null, $doExpand=false, Folder $folderObject=null, $treeName=null)
 
LanguageService getLanguageService ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Backend\Tree\View\AbstractTreeView
 determineScriptUrl ()
 
string getThisScript ()
 
string getMountPointPath (int $uid)
 
BackendUserAuthentication getBackendUser ()
 

Protected Attributes

ResourceStorage[] $storages
 
array $storageHashNumbers
 
bool $ajaxStatus = false
 
array $scope
 
IconFactory $iconFactory
 

Detailed Description

Generate a folder tree, specially made for browsing folders in the File module

This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API.

Definition at line 37 of file FolderTreeView.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Tree\View\FolderTreeView::__construct ( )

Constructor function of the class

Reimplemented from TYPO3\CMS\Backend\Tree\View\AbstractTreeView.

Definition at line 83 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\AbstractTreeView\init().

Member Function Documentation

◆ evaluateExpandCollapseParameter()

array TYPO3\CMS\Backend\Tree\View\FolderTreeView::evaluateExpandCollapseParameter (   $PM = null)
protected

Gets the values from the Expand/Collapse Parameter (&PM) previously known as "PM" (plus/minus) PM action: (If a plus/minus icon has been clicked, the PM GET var is sent and we must update the stored positions in the tree): 0: mount key, 1: set/clear boolean, 2: item ID (cannot contain "_"), 3: treeName

Parameters
string$PM‪The "plus/minus" command
Returns
‪array

Definition at line 652 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\FolderTreeView\$treeName, and TYPO3\CMS\Core\Utility\GeneralUtility\revExplode().

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\initializePositionSaving(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\printTree().

◆ generateExpandCollapseParameter()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::generateExpandCollapseParameter (   $mountKey = null,
  $doExpand = false,
Folder  $folderObject = null,
  $treeName = null 
)
protected

Generates the "PM" string to sent to expand/collapse items

Parameters
string$mountKey‪The mount key / storage UID
bool$doExpand‪Whether to expand/collapse
Folder$folderObject‪The folder object
string$treeName‪The name of the tree
Returns
‪string

Definition at line 683 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$bank, and TYPO3\CMS\Backend\Tree\View\FolderTreeView\$treeName.

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\getBrowseableTreeForStorage(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\PMicon().

◆ getAjaxStatus()

bool TYPO3\CMS\Backend\Tree\View\FolderTreeView::getAjaxStatus ( )

Gets the AJAX status.

Returns
‪bool

Definition at line 699 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\FolderTreeView\$ajaxStatus.

◆ getBrowsableTree()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::getBrowsableTree ( )

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

Returns
‪string HTML code for the browsable tree

Reimplemented from TYPO3\CMS\Backend\Tree\View\AbstractTreeView.

Definition at line 258 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\FolderTreeView\getBrowseableTreeForStorage(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\initializePositionSaving(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\printTree().

◆ getBrowseableTreeForStorage()

◆ getFolderTree()

int TYPO3\CMS\Backend\Tree\View\FolderTreeView::getFolderTree ( Folder  $folderObject,
  $depth = 999,
  $type = '' 
)

◆ getId()

int TYPO3\CMS\Backend\Tree\View\FolderTreeView::getId (   $folderObject)

Returns the id from the record - for folders, this is an md5 hash.

Parameters
Folder$folderObject‪The folder object
Returns
‪int The "uid" field value.

Reimplemented from TYPO3\CMS\Backend\Tree\View\AbstractTreeView.

Definition at line 210 of file FolderTreeView.php.

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\printTree(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\wrapIcon(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\wrapTitle().

◆ getJumpToParam()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::getJumpToParam (   $folderObject)

Returns jump-url parameter value.

Parameters
Folder$folderObject‪The folder object
Returns
‪string The jump-url parameter.

Reimplemented from TYPO3\CMS\Backend\Tree\View\AbstractTreeView.

Definition at line 222 of file FolderTreeView.php.

Referenced by TYPO3\CMS\Filelist\FileListFolderTree\wrapIcon(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\wrapIcon(), TYPO3\CMS\Filelist\FileListFolderTree\wrapTitle(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\wrapTitle().

◆ getLanguageService()

LanguageService TYPO3\CMS\Backend\Tree\View\FolderTreeView::getLanguageService ( )
protected

◆ getNumberOfSubfolders()

int TYPO3\CMS\Backend\Tree\View\FolderTreeView::getNumberOfSubfolders ( Folder  $folderObject)

Counts the number of directories in a file path.

Parameters
Folder$folderObject‪File path.
Returns
‪int

Definition at line 571 of file FolderTreeView.php.

References TYPO3\CMS\Core\Resource\Folder\getSubfolders().

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\getFolderTree().

◆ getShortHashNumberForStorage()

int TYPO3\CMS\Backend\Tree\View\FolderTreeView::getShortHashNumberForStorage ( ResourceStorage  $storageObject = null,
Folder  $startingPointFolder = null 
)
protected

Helper method to map md5-hash to shorter number

Parameters
ResourceStorage$storageObject
Folder$startingPointFolder
Returns
‪int

Definition at line 614 of file FolderTreeView.php.

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\getBrowseableTreeForStorage(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\initializePositionSaving().

◆ getTableNameForClickMenu()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::getTableNameForClickMenu ( Folder  $folderObject)
protected

◆ getTitleAttrib()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::getTitleAttrib (   $folderObject)

Returns the value for the image "title" attribute

Parameters
Folder$folderObject‪The folder to be used
Returns
‪string The attribute value (is htmlspecialchared() already)

Reimplemented from TYPO3\CMS\Backend\Tree\View\AbstractTreeView.

Definition at line 247 of file FolderTreeView.php.

◆ getTitleStr()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::getTitleStr (   $row,
  $titleLen = 30 
)

Returns the title for the input record. If blank, a "no title" label (localized) will be returned. '_title' is used for setting an alternative title for folders.

Parameters
array$row‪The input row array (where the key "_title" is used for the title)
int$titleLen‪Title length (30)
Returns
‪string The title

Reimplemented from TYPO3\CMS\Backend\Tree\View\AbstractTreeView.

Definition at line 235 of file FolderTreeView.php.

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\printTree().

◆ initializePositionSaving()

◆ PMicon()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::PMicon (   $folderObject,
  $subFolderCounter,
  $totalSubFolders,
  $nextCount,
  $isExpanded 
)

Generate the plus/minus icon for the browsable tree.

Parameters
Folder$folderObject‪Entry folder object
int$subFolderCounter‪The current entry number
int$totalSubFolders‪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$isExpanded‪The element was expanded to render subelements if this flag is set.
Returns
‪string Image tag with the plus/minus icon.
See also
‪\TYPO3\CMS\Backend\Tree\View\PageTreeView::PMicon()

Reimplemented from TYPO3\CMS\Backend\Tree\View\AbstractTreeView.

Definition at line 104 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\FolderTreeView\generateExpandCollapseParameter(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\PMiconATagWrap().

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\getFolderTree().

◆ PMiconATagWrap()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::PMiconATagWrap (   $icon,
  $cmd,
  $isExpand = true 
)

Wrap the plus/minus icon in a link

Parameters
string$icon‪HTML string to wrap, probably an image tag.
string$cmdCommand for 'PM' get var
bool$isExpand‪Whether to be expanded
Returns
‪string Link-wrapped input string

Reimplemented in TYPO3\CMS\Backend\Tree\View\ElementBrowserFolderTreeView.

Definition at line 123 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$thisScript.

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\PMicon().

◆ printTree()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::printTree (   $treeItems = '')

◆ renderPMIconAndLink()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::renderPMIconAndLink (   $cmd,
  $isOpen 
)
protected

◆ wrapIcon()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::wrapIcon (   $icon,
  $folderObject 
)

◆ wrapTitle()

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::wrapTitle (   $title,
  $folderObject,
  $bank = 0 
)

Member Data Documentation

◆ $ajaxStatus

bool TYPO3\CMS\Backend\Tree\View\FolderTreeView::$ajaxStatus = false
protected

Indicates, whether the AJAX call was successful, i.e. the requested page has been found

Definition at line 54 of file FolderTreeView.php.

Referenced by TYPO3\CMS\Backend\Tree\View\FolderTreeView\getAjaxStatus().

◆ $domIdPrefix

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::$domIdPrefix = 'folder'

override to use this domIdPrefix

Definition at line 78 of file FolderTreeView.php.

◆ $iconFactory

IconFactory TYPO3\CMS\Backend\Tree\View\FolderTreeView::$iconFactory
protected

Definition at line 62 of file FolderTreeView.php.

◆ $scope

array TYPO3\CMS\Backend\Tree\View\FolderTreeView::$scope
protected

Definition at line 58 of file FolderTreeView.php.

◆ $storageHashNumbers

array TYPO3\CMS\Backend\Tree\View\FolderTreeView::$storageHashNumbers
protected

Definition at line 47 of file FolderTreeView.php.

◆ $storages

ResourceStorage [] TYPO3\CMS\Backend\Tree\View\FolderTreeView::$storages
protected

The users' file Storages

Definition at line 43 of file FolderTreeView.php.

◆ $titleAttrib

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::$titleAttrib = ''

override to not use a title attribute

Definition at line 67 of file FolderTreeView.php.

◆ $treeName

string TYPO3\CMS\Backend\Tree\View\FolderTreeView::$treeName = 'folder'