TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
FolderTreeView Class Reference
Inheritance diagram for FolderTreeView:
AbstractTreeView ElementBrowserFolderTreeView 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 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 AbstractTreeView
 $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

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

Constructor & Destructor Documentation

__construct ( )

Constructor function of the class

Definition at line 92 of file FolderTreeView.php.

References AbstractTreeView\init(), and GeneralUtility\makeInstance().

Member Function Documentation

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

References FolderTreeView\$treeName, GeneralUtility\_GP(), and GeneralUtility\revExplode().

Referenced by FolderTreeView\initializePositionSaving().

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

References FolderTreeView\$treeName, and GeneralUtility\md5int().

Referenced by FolderTreeView\PMicon().

getAjaxStatus ( )

Gets the AJAX status.

Returns
bool

Definition at line 691 of file FolderTreeView.php.

References FolderTreeView\$ajaxStatus.

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

References FolderTreeView\initializePositionSaving(), and AbstractTreeView\printTree().

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

Referenced by FolderTreeView\wrapIcon(), and FolderTreeView\wrapTitle().

getJumpToParam (   $folderObject)

Returns jump-url parameter value.

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

Definition at line 231 of file FolderTreeView.php.

Referenced by FileListFolderTree\wrapIcon(), FolderTreeView\wrapIcon(), FileListFolderTree\wrapTitle(), and FolderTreeView\wrapTitle().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 699 of file FolderTreeView.php.

References $GLOBALS.

getNumberOfSubfolders ( Folder  $folderObject)

Counts the number of directories in a file path.

Parameters
Folder$folderObjectFile path.
Returns
int

Definition at line 558 of file FolderTreeView.php.

References Folder\getSubfolders().

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

References ResourceStorage\getUid(), and GeneralUtility\md5int().

Referenced by FolderTreeView\initializePositionSaving().

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

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

initializePositionSaving ( )

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

Returns
void private

Definition at line 570 of file FolderTreeView.php.

References FolderTreeView\$treeName, FolderTreeView\evaluateExpandCollapseParameter(), FolderTreeView\getShortHashNumberForStorage(), and AbstractTreeView\savePosition().

Referenced by FolderTreeView\getBrowsableTree().

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

References FolderTreeView\generateExpandCollapseParameter(), and FolderTreeView\PMiconATagWrap().

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

References GeneralUtility\hmac(), and GeneralUtility\quoteJSvalue().

Referenced by FolderTreeView\PMicon().

renderPMIconAndLink (   $cmd,
  $isOpen 
)
protected
Parameters
string$cmd
bool$isOpen
Returns
string

Definition at line 158 of file FolderTreeView.php.

References AbstractTreeView\getThisScript().

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

References elseif, FolderTreeView\getId(), FolderTreeView\getJumpToParam(), GeneralUtility\quoteJSvalue(), and BackendUtility\wrapClickMenuOnIcon().

wrapTitle (   $title,
  $folderObject,
  $bank = 0 
)

Wrapping $title in a-tags.

Parameters
string$titleTitle string
Folder$folderObjectthe folder record
int$bankBank pointer (which mount point number)
Returns
string

Definition at line 200 of file FolderTreeView.php.

References AbstractTreeView\$bank, AbstractTreeView\$title, FolderTreeView\getId(), FolderTreeView\getJumpToParam(), GeneralUtility\implodeAttributes(), GeneralUtility\quoteJSvalue(), and BackendUtility\wrapClickMenuOnIcon().

Member Data Documentation

$ajaxStatus = false
protected

Definition at line 52 of file FolderTreeView.php.

Referenced by FolderTreeView\getAjaxStatus().

$domIdPrefix = 'folder'

Definition at line 87 of file FolderTreeView.php.

$ext_noTempRecyclerDirs = false

Definition at line 68 of file FolderTreeView.php.

$iconFactory
protected

Definition at line 62 of file FolderTreeView.php.

$scope
protected

Definition at line 57 of file FolderTreeView.php.

$storageHashNumbers
protected

Definition at line 44 of file FolderTreeView.php.

$storages = null
protected

Definition at line 39 of file FolderTreeView.php.

$titleAttrib = ''

Definition at line 74 of file FolderTreeView.php.

$treeName = 'folder'