TYPO3 CMS  TYPO3_7-6
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 ()
 
 PMicon ($folderObject, $subFolderCounter, $totalSubFolders, $nextCount, $isExpanded)
 
 PMiconATagWrap ($icon, $cmd, $isExpand=true)
 
 wrapIcon ($icon, $folderObject)
 
 wrapTitle ($title, $folderObject, $bank=0)
 
 getId ($folderObject)
 
 getJumpToParam ($folderObject)
 
 getTitleStr ($row, $titleLen=30)
 
 getTitleAttrib ($folderObject)
 
 getBrowsableTree ()
 
 getNumberOfSubfolders (Folder $folderObject)
 
 initializePositionSaving ()
 
 getAjaxStatus ()
 
- Public Member Functions inherited from TYPO3\CMS\Backend\Tree\View\AbstractTreeView
 __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

 $ext_noTempRecyclerDirs = false
 
 $titleAttrib = ''
 
 $treeName = 'folder'
 
 $domIdPrefix = 'folder'
 
- Public Attributes inherited from TYPO3\CMS\Backend\Tree\View\AbstractTreeView
 $expandFirst = 0
 
 $expandAll = 0
 
 $thisScript = ''
 
 $titleAttrib = 'title'
 
 $ext_IconMode = false
 
 $ext_showPathAboveMounts = false
 
 $addSelfId = 0
 
 $title = 'no title'
 
 $showDefaultTitleAttribute = false
 
 $BE_USER = ''
 
 $MOUNTS = null
 
 $table = ''
 
 $parentField = 'pid'
 
 $clause = ''
 
 $orderByFields = ''
 
 $fieldArray = ['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 = []
 
 $ids_hierarchy = []
 
 $orig_ids_hierarchy = []
 
 $buffer_idH = []
 
 $specUIDmap = []
 
 $data = false
 
 $dataLookup = false
 
 $tree = []
 
 $stored = []
 
 $bank = 0
 
 $recs = []
 

Protected Member Functions

 renderPMIconAndLink ($cmd, $isOpen)
 
 getShortHashNumberForStorage (ResourceStorage $storageObject=null, Folder $startingPointFolder=null)
 
 evaluateExpandCollapseParameter ($PM=null)
 
 generateExpandCollapseParameter ($mountKey=null, $doExpand=false, Folder $folderObject=null, $treeName=null)
 
 getLanguageService ()
 
- Protected Member Functions inherited from TYPO3\CMS\Backend\Tree\View\AbstractTreeView
 determineScriptUrl ()
 
 getThisScript ()
 
 getLanguageService ()
 
 getBackendUser ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $storages = null
 
 $storageHashNumbers
 
 $ajaxStatus = false
 
 $scope
 
 $iconFactory
 

Detailed Description

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

Definition at line 33 of file FolderTreeView.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor function of the class

Definition at line 93 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\AbstractTreeView\init(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Function Documentation

◆ evaluateExpandCollapseParameter()

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 an 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$PMThe "plus/minus" command
Returns
array

Definition at line 650 of file FolderTreeView.php.

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

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

◆ generateExpandCollapseParameter()

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$mountKeyThe mount key / storage UID
bool$doExpandWhether to expand/collapse
Folder$folderObjectThe folder object
string$treeNameThe name of the tree
Returns
string

Definition at line 681 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$bank, TYPO3\CMS\Backend\Tree\View\FolderTreeView\$treeName, TYPO3\CMS\Core\Resource\Folder\getCombinedIdentifier(), and TYPO3\CMS\Core\Utility\GeneralUtility\md5int().

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

◆ getAjaxStatus()

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

Gets the AJAX status.

Returns
bool

Definition at line 697 of file FolderTreeView.php.

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

◆ getBrowsableTree()

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

Definition at line 268 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$bank, TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$expandFirst, TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$tree, TYPO3\CMS\Backend\Tree\View\FolderTreeView\evaluateExpandCollapseParameter(), TYPO3\CMS\Backend\Tree\View\AbstractTreeView\expandNext(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\generateExpandCollapseParameter(), TYPO3\CMS\Core\Resource\Folder\getCombinedIdentifier(), TYPO3\CMS\Core\Resource\ResourceStorage\getFileMounts(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\getId(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\getLanguageService(), TYPO3\CMS\Core\Resource\ResourceStorage\getName(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\getNumberOfSubfolders(), TYPO3\CMS\Core\Resource\ResourceStorage\getRootLevelFolder(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\getShortHashNumberForStorage(), TYPO3\CMS\Core\Resource\Folder\getSubfolders(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\getTitleStr(), if, TYPO3\CMS\Core\Messaging\AbstractMessage\INFO, TYPO3\CMS\Backend\Tree\View\FolderTreeView\initializePositionSaving(), TYPO3\CMS\Core\Resource\ResourceStorage\isBrowsable(), TYPO3\CMS\Core\Resource\ResourceStorage\isOnline(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), TYPO3\CMS\Core\Utility\GeneralUtility\md5int(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\PMicon(), TYPO3\CMS\Backend\Tree\View\AbstractTreeView\printTree(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\renderPMIconAndLink(), TYPO3\CMS\Backend\Tree\View\AbstractTreeView\reset(), TYPO3\CMS\Core\Resource\FolderInterface\ROLE_DEFAULT, TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL, TYPO3\CMS\Backend\Tree\View\FolderTreeView\wrapIcon(), and TYPO3\CMS\Backend\Tree\View\FolderTreeView\wrapTitle().

◆ getId()

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

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

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

Definition at line 220 of file FolderTreeView.php.

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

◆ getJumpToParam()

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

Returns jump-url parameter value.

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

Definition at line 232 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()

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

Definition at line 705 of file FolderTreeView.php.

References $GLOBALS.

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

◆ getNumberOfSubfolders()

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

Counts the number of directories in a file path.

Parameters
Folder$folderObjectFile path.
Returns
int

Definition at line 564 of file FolderTreeView.php.

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

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

◆ getShortHashNumberForStorage()

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 608 of file FolderTreeView.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getUid(), and TYPO3\CMS\Core\Utility\GeneralUtility\md5int().

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

◆ getTitleAttrib()

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

Returns the value for the image "title" attribute

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

Definition at line 257 of file FolderTreeView.php.

◆ getTitleStr()

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

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

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

Definition at line 245 of file FolderTreeView.php.

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

◆ initializePositionSaving()

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

◆ PMicon()

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

Generate the plus/minus icon for the browsable tree.

Parameters
Folder$folderObjectEntry folder object
int$subFolderCounterThe current entry number
int$totalSubFoldersThe total number of entries. If equal to $a, a "bottom" element is returned.
int$nextCountThe number of sub-elements to the current element.
bool$isExpandedThe element was expanded to render subelements if this flag is set.
Returns
string Image tag with the plus/minus icon.

Definition at line 114 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\getBrowsableTree().

◆ PMiconATagWrap()

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

Wrap the plus/minus icon in a link

Parameters
string$iconHTML string to wrap, probably an image tag.
string$cmdCommand for 'PM' get var
bool$isExpandWhether to be expanded
Returns
string Link-wrapped input string

Definition at line 133 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\FolderTreeView\$ext_noTempRecyclerDirs, TYPO3\CMS\Backend\Tree\View\AbstractTreeView\$thisScript, TYPO3\CMS\Core\Utility\GeneralUtility\hmac(), and TYPO3\CMS\Core\Utility\GeneralUtility\quoteJSvalue().

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

◆ renderPMIconAndLink()

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

Definition at line 159 of file FolderTreeView.php.

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

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

◆ wrapIcon()

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

Wrapping the folder icon

Parameters
string$iconThe image tag for the icon
Folder$folderObjectThe row for the current element
Returns
string The processed icon input value.

Definition at line 174 of file FolderTreeView.php.

References TYPO3\CMS\Backend\Tree\View\FolderTreeView\getId(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\getJumpToParam(), TYPO3\CMS\Core\Utility\GeneralUtility\quoteJSvalue(), and TYPO3\CMS\Backend\Utility\BackendUtility\wrapClickMenuOnIcon().

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

◆ wrapTitle()

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

Member Data Documentation

◆ $ajaxStatus

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

◆ $domIdPrefix

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

Definition at line 88 of file FolderTreeView.php.

◆ $ext_noTempRecyclerDirs

TYPO3\CMS\Backend\Tree\View\FolderTreeView::$ext_noTempRecyclerDirs = false

◆ $iconFactory

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

Definition at line 63 of file FolderTreeView.php.

◆ $scope

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

Definition at line 58 of file FolderTreeView.php.

◆ $storageHashNumbers

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

Definition at line 45 of file FolderTreeView.php.

◆ $storages

TYPO3\CMS\Backend\Tree\View\FolderTreeView::$storages = null
protected

Definition at line 40 of file FolderTreeView.php.

◆ $titleAttrib

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

Definition at line 75 of file FolderTreeView.php.

◆ $treeName