Class DiDir
This class wraps directory data, obtained from portalDI and creates DiDir object that holds a lot of useful properties and functions for directory display and management.
Class accepts directory data array, generated by “fileinfo”, “browse” and “search” portalDI actions.
The following example shows how you can create DiDir object from within Elegant 6 plugin:

The following properties are available:
name |
canGoToBasket |
type |
bool |
description |
determines if directory can be put to basket |
name |
creator |
type |
string |
description |
holds file creator username |
name |
dirItems |
type |
int |
description |
holds total amount of child directories |
name |
fileItems |
type |
int |
description |
holds total amount of assets in directory |
name |
folder |
type |
string |
description |
holds containing directory name |
name |
folderUrl |
type |
string |
description |
holds containing directory “browse” url (example.com/browse?path=directory/path) |
name |
inBasket |
type |
bool |
description |
determines whether directory is in current user basket or not |
name |
id |
type |
int |
description |
holds directory ID in venture database |
name |
intems |
type |
int |
description |
holds total amount of child directories and assets |
name |
isVenture |
type |
bool |
description |
determines if an directory is registered inside venture database |
name |
length |
type |
int |
description |
holds directory length in bytes |
name |
name |
type |
string |
description |
holds directory name |
name |
parentId |
type |
int |
description |
holds containing directory ID from venture database |
name |
path |
type |
strig |
description |
holds directory path |
name |
raw |
type |
bool |
description |
holds array of raw directory data from portalDI |
name |
type |
type |
string |
description |
holds directory file type |
name |
volumeId |
type |
int |
description |
holds containing volume id |
name |
volumName |
type |
string |
description |
holds containing volume name |
name |
voluePath |
type |
string |
description |
holds containing volume path |
name |
volumName |
type |
string |
description |
holds containing volume name |
The following methods are available:
function |
getArchiveInfo |
description |
gets array of directory archive info in portalDI format. Ususally it contains date of archiving and archive media title |
parameters |
none |
returns |
array |
function |
getArchiveStatus |
description |
gets current directory archive status |
parameters |
none |
returns |
integer (0 – online, 1 – online & archived, 2 – offline, 3 nearline) |
function |
getCanManipulate |
description |
determines if directory configuration and volume settings allow to manipulate it (copy, move, delete, rename) |
parameters |
none |
returns |
bool (true – directory can be manipulated, false – directory cannot be manipulated) |
function |
getComment |
description |
gets file comment value, if it is allowed by volume settings |
parameters |
none |
returns |
null string (null - comment if not allowed, string – comment value) |
function |
getDates |
description |
gets directory creation, modification and access dates in form of an object |
parameters |
none |
returns |
stdClass (stdClass object with the following properties: |
|
- cdate |
|
- mdate |
|
- adate |
function |
getDisabled |
description |
gets directory disabled status, determined by webnative asset timer |
parameters |
none |
returns |
bool (true - disabled, false - available) |
function |
getFileHistory |
description |
gets array of directory file history in “portalDI” format and sorts it by date added |
parameters |
none |
returns |
array |
function |
getFinderColor |
description |
gets current directory finder color |
parameters |
none |
returns |
string (finder color: grey, green, violet, blue, yellow, red, orange) |
function |
getIsOnline |
description |
gets file online status |
parameters |
none |
returns |
bool (true – online, false – not online) |
function |
getKeywords |
description |
gets array of Elegant 6 “Keyword” class objects with corresponding directory keywords values being set |
parameters |
- editableOnly = true: if true, returns keywords editable for current user only |
|
- valueOnly = false: if true, returns keywords with values only (+ all editable) |
|
- browseableOnly = false: if true, returns keywords, available for “browse view” display (the setting is determined by keyword webnative options) |
returns |
array (array of “Keyword” class objects) |
function |
getViewLink |
description |
gets directory browse link in Elegant 6 format (example.com/browse?path=/path/to/directory) |
parameters |
none |
returns |
string |
function |
getUserInfo |
description |
gets “USERINFO” array from directory portalDI data, if it is not available, tries to get it from directory volume |
parameters |
none |
returns |
array (array of “USERINFO” in portalDI format) |