tce_functions_filemanager.php

Functions for TCExam file manager.

Source: admin/code/tce_functions_filemanager.php

Functions for TCExam file manager.

Functions

F_createMediaDir()

Create a new media directory inside the cache

function F_createMediaDir(mixed $dirname): true

Parameters:

  • $dirname (mixed): (string) the directory name

Returns: true: in case of success, false otherwise

Source: admin/code/tce_functions_filemanager.php:154

F_deleteMediaDir()

Delete the specified media directory

function F_deleteMediaDir(mixed $dirname): true

Parameters:

  • $dirname (mixed): (string) the directory name

Returns: true: in case of success, false otherwise

Source: admin/code/tce_functions_filemanager.php:188

F_deleteMediaFile()

Delete the selected media file

function F_deleteMediaFile(mixed $filename): true

Parameters:

  • $filename (mixed): (string) the file name

Returns: true: in case of success, false otherwise

Source: admin/code/tce_functions_filemanager.php:45

F_formatFileSize()

Return a formatted file size

function F_formatFileSize(mixed $size): string

Parameters:

  • $size (mixed): (int) size in bytes

Returns: string: formatted size

Source: admin/code/tce_functions_filemanager.php:253

F_getAuthorizedDirs()

Returns a regular expression to match authorised directories.

function F_getAuthorizedDirs(): a

Returns: a: regular expression to match authorised directories.

Source: admin/code/tce_functions_filemanager.php:655

F_getDirFiles()

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

function F_getDirFiles(mixed $dir, mixed $rootdir = \K_PATH_CACHE, mixed $authdirs = ''): an

Parameters:

  • $dir (mixed): (string) the starting directory path
  • $rootdir (mixed): (string) the user root dir.
  • $authdirs (mixed): (string) regular expression containing the authorized dirs.

Returns: an: associative array containing sorted ‘dirs’ and ‘files’

Source: admin/code/tce_functions_filemanager.php:325

F_getDirTable()

Get an html table containing files and subdirs

function F_getDirTable(
    mixed $dir,
    mixed $selected = '',
    mixed $params = '',
    mixed $rootdir = \K_PATH_CACHE,
    mixed $authdirs = ''
): html

Parameters:

  • $dir (mixed): (string) the starting directory path
  • $selected (mixed): (string) the selected file
  • $params (mixed): (string) additional parameters to add on links
  • $rootdir (mixed): (string) the user root dir.
  • $authdirs (mixed): (string) regular expression containing the authorized dirs.

Returns: html: table

Source: admin/code/tce_functions_filemanager.php:418

F_getDirVisualTable()

Get an html visual list of files and subdirs

function F_getDirVisualTable(
    mixed $dir,
    mixed $selected = '',
    mixed $params = '',
    mixed $rootdir = \K_PATH_CACHE,
    mixed $authdirs = ''
): html

Parameters:

  • $dir (mixed): (string) the starting directory path
  • $selected (mixed): (string) the selected file
  • $params (mixed): (string) additional parameters to add on links
  • $rootdir (mixed): (string) the user root dir.
  • $authdirs (mixed): (string) regular expression containing the authorized dirs.

Returns: html: table

Source: admin/code/tce_functions_filemanager.php:524

F_getFileInfo()

Get file information

function F_getFileInfo(mixed $file): associative

Parameters:

  • $file (mixed): (string) the file name

Returns: associative: array containing file info or false in case of error

Source: admin/code/tce_functions_filemanager.php:213

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

function F_getMediaDirPathLink(mixed $dirpath, mixed $viewmode = true): an

Parameters:

  • $dirpath (mixed): (string) the directory path
  • $viewmode (mixed): (boolean) true=table, false=visual

Returns: an: html string

Source: admin/code/tce_functions_filemanager.php:275

F_getMediaFileExtensions()

Returns the file extensions that the File Manager lists, deletes and renames: the configured upload extensions plus the active content extensions, so that existing markup files can be found and removed.

function F_getMediaFileExtensions(): list<string>

Returns: list<string>: lowercase extensions

Source: admin/code/tce_functions_filemanager.php:30

F_isAuthorizedDir()

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

function F_isAuthorizedDir(mixed $dir, mixed $rootdir, mixed $authdirs = ''): true

Parameters:

  • $dir (mixed): (string) the directory to check.
  • $rootdir (mixed): (string) the user root dir.
  • $authdirs (mixed): (string) regular expression containing the authorized dirs.

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

Source: admin/code/tce_functions_filemanager.php:674

F_isUsedMediaFile()

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

function F_isUsedMediaFile(mixed $file): true

Parameters:

  • $file (mixed): (string) the file to search

Returns: true: if the file is used, false otherwise

Source: admin/code/tce_functions_filemanager.php:365

F_renameMediaFile()

Rename the selected media file

function F_renameMediaFile(mixed $filename, mixed $newname): true

Parameters:

  • $filename (mixed): (string) old file name
  • $newname (mixed): (string) new file name

Returns: true: in case of success, false otherwise

Source: admin/code/tce_functions_filemanager.php:86