Filelist Filelist(
FileRoot
$FileRoot, [boolean|string
$path = NULL], integer
2
)
|
|
Constructor
Parameters:
|
integer |
2: |
ID of the user, the group or the collection the file belongs to... |
|
FileRoot |
$FileRoot: |
See FileRootCache::get_by_type_and_ID() |
|
boolean|string |
$path: |
Default path for the files, false if you want to create an arbitrary list; NULL for the Fileroot's ads_path. |
boolean add(
File
&$File, [boolean
$mustExist = false]
)
|
|
Add a File object to the list (by reference).
Parameters:
|
File |
&$File: |
File object (by reference) |
|
boolean |
$mustExist: |
Has the file to exist to get added? |
API Tags:
| Return: | true on success, false on failure |
boolean add_by_subpath(
string
$rel_path, [boolean
$mustExist = false]
)
|
|
Add a file to the list, by filename.
This is a stub for Filelist::add().
Parameters:
|
string |
$rel_path: |
Subpath for this file/folder, relative the associated root, including trailing slash (if directory) |
|
boolean |
$mustExist: |
Has the file to exist to get added? |
API Tags:
| Return: | true on success, false on failure (path not allowed, file does not exist) |
boolean contains(
File
&$File
)
|
|
Does the list contain a specific File?
Parameters:
|
File |
&$File: |
the File object to look for |
Get the total number of entries in the list.
Get the total number of bytes of all files in the list
Get the total number of directories in the list
Get the total number of files in the list
void get_ads_list_path(
)
|
|
Get absolute path to list.
array get_array(
[string
$method = NULL]
)
|
|
Get the list of File entries.
You can use a method on each object to get this as result instead of the object itself.
Parameters:
|
string |
$method: |
Use this method on every File and put the result into the list. |
API Tags:
| Return: | The array with the File objects or method results |
mixed &get_by_full_path(
string
$adfs_path
)
|
|
Get a file by its full path.
Parameters:
|
string |
$adfs_path: |
the full/absolute path (with ending slash for directories) |
API Tags:
| Return: | File object (by reference) on success, false on failure. |
false|File &get_by_idx(
integer
$index
)
|
|
Get a file by index.
Parameters:
|
integer |
$index: |
Index of the entries (starting with 0) |
mixed &get_by_md5_ID(
string
$md5id
)
|
|
Get a file by it's ID.
Parameters:
|
string |
$md5id: |
the ID (MD5 of path and name) |
API Tags:
| Return: | File object (by reference) on success, false on failure. |
mixed &get_by_rdfs_path(
string
$rdfs_path
)
|
|
Get a file by its relative (to root) path.
Parameters:
|
string |
$rdfs_path: |
the RELATIVE path (with ending slash for directories) |
API Tags:
| Return: | File object (by reference) on success, false on failure. |
string get_cwd_clickable(
[
$clickableOnly = true]
)
|
|
Returns cwd, where the accessible directories (below root) are clickable
Parameters:
API Tags:
| Return: | cwd as clickable html |
Get the FileLists FileRoot
string get_filter(
[boolean
$verbose = true]
)
|
|
Return the current filter
Parameters:
|
boolean |
$verbose: |
add a note when it's a regexp or no filter? |
API Tags:
boolean|File &get_next(
[string
$type = '']
)
|
|
Get the next entry and increment internal counter.
Parameters:
|
string |
$type: |
can be used to query only 'file's or 'dir's. |
API Tags:
| Return: | object (by reference) on success, false on end of list |
void get_rds_list_path(
)
|
|
Get path to list relative to root.
Get the FileLists root ID (in_type_ID).
Get the FileLists root type.
string get_sort_link(
string
$type, string
$atext
)
|
|
Get the link to sort by a column. Handle current order and appends an icon to reflect the current state (ascending/descending), if the column is the same we're sorting by.
Parameters:
|
string |
$type: |
The type (name, path, size, ..) |
|
string |
$atext: |
The text for the anchor. |
Information Tags:
| Todo: | get this outta here. This is NOT a displayable object. We might want to have a "FileListResults" object that derives from Widget/Results/FilteredResults (the more the better) This object is what the SQL or the ItemQuery object is to Results or to ItemList2. The model and the display should not be mixed. IF NOT doing the clean objects, move this at least to file.funcs. |
NULL|boolean is_filter_regexp(
)
|
|
Is the current Filter a regexp?
API Tags:
| Return: | true if regexp, NULL if no filter set |
integer is_sorting_asc(
[string
$col = '']
)
|
|
Are we sorting ascending?
Parameters:
|
string |
$col: |
The type (empty for current order type) |
API Tags:
| Return: | 1 for ascending sorting, 0 for descending |
Loads or reloads the filelist entries.
NOTE: this does not work for arbitrary lists!
API Tags:
Attempt to load meta data for all files in the list.
Will attempt only once per file and cache the result.
Get a MD5 checksum over the entries.
Used to identify a unique filelist.
API Tags:
string rdfs_relto_root_from_adfs(
string
$adfs_path
)
|
|
Get the path (and name) of a File relative to the Filelist::_FileRoot->ads_path.
Parameters:
Removes a File from the entries list.
This handles indexes and number of total entries, bytes, files/dirs.
Parameters:
API Tags:
| Return: | true on success, false if not found in list. |
void set_filter(
string
$filter_string, boolean
$filter_is_regexp
)
|
|
Set the filter.
Parameters:
|
string |
$filter_string: |
Filter string (for regular expressions, if no delimiter/modifiers are included, we try magically adding them) |
|
boolean |
$filter_is_regexp: |
Is the filter a regular expression? (it's a glob pattern otherwise) |
void sort(
[string
$order = NULL], [boolean
$orderasc = NULL], [boolean
$dirsattop = NULL]
)
|
|
Sort the entries by sorting the internal $_order_index array.
Parameters:
|
string |
$order: |
The order to use ('name', 'type', 'lastmod', .. ) |
|
boolean |
$orderasc: |
Ascending (true) or descending |
|
boolean |
$dirsattop: |
Sort directories at top? |
Update the name dependent caches
This is especially useful after a name change of one of the files in the list
integer _sort_callback(
$a,
$b
)
|
|
usort callback function for Filelist::sort()
Parameters:
API Tags: