files-admin-code-tce-functions-filemanager

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

tce_functions_filemanager.php

Tags
file

Functions for TCExam file manager.

author

Nicola Asuni

since
2010-09-20

Table of Contents

Functions

F_deleteMediaFile()  : true
Delete the selected media file
F_renameMediaFile()  : true
Rename the selected media file
F_createMediaDir()  : true
Create a new media directory inside the cache
F_deleteMediaDir()  : true
Delete the specified media directory
F_getFileInfo()  : associative
Get file information
F_formatFileSize()  : string
Return a formatted file size
F_getMediaDirPathLink()  : an
Get an html string containing active path of the specified directory with links to subdirectories.
F_getDirFiles()  : an
Get an associative array of directories and folder inside the specified dir.
F_isUsedMediaFile()  : true
Return true if the file is used on question or answer descriptions
F_getDirTable()  : html
Get an html table containing files and subdirs
F_getDirVisualTable()  : html
Get an html visual list of files and subdirs
F_getAuthorizedDirs()  : a
Returns a regular expression to match authorised directories.
F_isAuthorizedDir()  : true
Returns true if the user is authorized to use the specified directory, false otherwise.

Functions

F_deleteMediaFile()

Delete the selected media file

F_deleteMediaFile( $filename) : true
Parameters
$filename :

(string) the file name

Tags
author

Nicola Asuni

Return values
true

in case of success, false otherwise

F_renameMediaFile()

Rename the selected media file

F_renameMediaFile( $filename,  $newname) : true
Parameters
$filename :

(string) old file name

$newname :

(string) new file name

Tags
author

Nicola Asuni

Return values
true

in case of success, false otherwise

F_createMediaDir()

Create a new media directory inside the cache

F_createMediaDir( $dirname) : true
Parameters
$dirname :

(string) the directory name

Tags
author

Nicola Asuni

Return values
true

in case of success, false otherwise

F_deleteMediaDir()

Delete the specified media directory

F_deleteMediaDir( $dirname) : true
Parameters
$dirname :

(string) the directory name

Tags
author

Nicola Asuni

Return values
true

in case of success, false otherwise

F_getFileInfo()

Get file information

F_getFileInfo( $file) : associative
Parameters
$file :

(string) the file name

Tags
author

Nicola Asuni

Return values
associative

array containing file info or false in case of error

F_formatFileSize()

Return a formatted file size

F_formatFileSize( $size) : string
Parameters
$size :

(int) size in bytes

Tags
author

Nicola Asuni

Return values
string

formatted size

Get an html string containing active path of the specified directory with links to subdirectories.

F_getMediaDirPathLink( $dirpath[,  $viewmode = true ]) : an
Parameters
$dirpath :

(string) the directory path

$viewmode : = true

(boolean) true=table, false=visual

Tags
author

Nicola Asuni

Return values
an

html string

F_getDirFiles()

Get an associative array of directories and folder inside the specified dir.

F_getDirFiles( $dir[,  $rootdir = K_PATH_CACHE ][,  $authdirs = '' ]) : an
Parameters
$dir :

(string) the starting directory path

$rootdir : = K_PATH_CACHE

(string) the user root dir.

$authdirs : = ''

(string) regular expression containing the authorized dirs.

Tags
author

Nicola Asuni

Return values
an

associative array containing sorted 'dirs' and 'files'

F_isUsedMediaFile()

Return true if the file is used on question or answer descriptions

F_isUsedMediaFile( $file) : true
Parameters
$file :

(string) the file to search

Tags
author

Nicola Asuni

Return values
true

if the file is used, false otherwise

F_getDirTable()

Get an html table containing files and subdirs

F_getDirTable( $dir[,  $selected = '' ][,  $params = '' ][,  $rootdir = K_PATH_CACHE ][,  $authdirs = '' ]) : html
Parameters
$dir :

(string) the starting directory path

$selected : = ''

(string) the selected file

$params : = ''

(string) additional parameters to add on links

$rootdir : = K_PATH_CACHE

(string) the user root dir.

$authdirs : = ''

(string) regular expression containing the authorized dirs.

Tags
author

Nicola Asuni

Return values
html

table

F_getDirVisualTable()

Get an html visual list of files and subdirs

F_getDirVisualTable( $dir[,  $selected = '' ][,  $params = '' ][,  $rootdir = K_PATH_CACHE ][,  $authdirs = '' ]) : html
Parameters
$dir :

(string) the starting directory path

$selected : = ''

(string) the selected file

$params : = ''

(string) additional parameters to add on links

$rootdir : = K_PATH_CACHE

(string) the user root dir.

$authdirs : = ''

(string) regular expression containing the authorized dirs.

Tags
author

Nicola Asuni

Return values
html

table

F_getAuthorizedDirs()

Returns a regular expression to match authorised directories.

F_getAuthorizedDirs() : a
Return values
a

regular expression to match authorised directories.

F_isAuthorizedDir()

Returns true if the user is authorized to use the specified directory, false otherwise.

F_isAuthorizedDir( $dir,  $rootdir[,  $authdirs = '' ]) : true
Parameters
$dir :

(string) the directory to check.

$rootdir :

(string) the user root dir.

$authdirs : = ''

(string) regular expression containing the authorized dirs.

Return values
true

if the user is authorized to use the specified directory, false otherwise.

On this page
 

© 2004-2024 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy