Phpxforms documentation

BasicBrowser extends Body
in package

Basic functions for file browser

Tags
author

DaVee

version
0.87dev
license

Lesser General Public License 2.1 or later; see http://www.gnu.org/licenses/lgpl-2.1.html

Table of Contents

Properties

$baseDir  : string
$body  : string|null
$ignoreItems  : array<string|int, string>
$mark  : string
$mode  : string
$bookmarks  : array<string, string>
$css  : array<string, mixed>
$dirExist  : bool
$dirs  : array<string|int, array<string, mixed>>
$dynamicTag  : string|null
$error  : string|null
$files  : array<string|int, array<string, mixed>>
$filter  : array<string, string>|null
$filters  : array<string, array<string, string>>
$nav  : AdminNavigation
$openDir  : string
$parentDir  : string|null
$rights  : array<string, bool>
$scripts  : array<string, mixed>
$title  : string

Methods

__construct()  : mixed
addCss()  : void
Add CSS
addScript()  : void
Add javascript
denyPath()  : string|null
Checks if given path has allowed access and does not contain ../
getAlert()  : string
Get bootstrap like alert
getCSS()  : array<string, mixed>
Get CSS
getError()  : string|null
Get last error
getScript()  : array<string, mixed>
Get javascript
getShortTitle()  : string
Get page title without page name
loadContent()  : void
Loads the contents of an open directory
renderActionBar()  : void
Prints the top action bar of the browser
renderContent()  : void
Prints content of the browser
setFilters()  : void
Sets allowed filters for files to display
getFunctions()  : string
Returns allowed action for selected file/directory
getParentDir()  : string|null
Returns parent directory
getPath()  : string
Returns full path to inserted directory
getTitle()  : string
Get page title
isMime()  : bool
Check if file can be shown based on its mime
renderDir()  : void
Prints files
renderUploadBox()  : void
Prints dropbox element for file upload

Properties

$ignoreItems

public static array<string|int, string> $ignoreItems = ['.', '..']

$bookmarks

protected array<string, string> $bookmarks = []

$css

protected array<string, mixed> $css = []

$dirs

protected array<string|int, array<string, mixed>> $dirs = []

$dynamicTag

protected string|null $dynamicTag = null

$files

protected array<string|int, array<string, mixed>> $files = []

$filter

protected array<string, string>|null $filter = null

$filters

protected array<string, array<string, string>> $filters = []

$scripts

protected array<string, mixed> $scripts = []

$title

protected string $title = ''

Methods

__construct()

public __construct(AdminNavigation $nav, array<string, bool> $rights[, array<string, mixed> $access = [] ][, array<string, string> $bookmarks = [] ][, string $defaultDir = '' ]) : mixed
Parameters
$nav : AdminNavigation
$rights : array<string, bool>
$access : array<string, mixed> = []
$bookmarks : array<string, string> = []
$defaultDir : string = ''

addCss()

Add CSS

public final addCss(string $type, string $value[, string $media = 'all' ]) : void
Parameters
$type : string

FILE,CODE

$value : string

depends on type

$media : string = 'all'

css media type

addScript()

Add javascript

public final addScript(string $type, array<string, mixed>|string|null $value) : void
Parameters
$type : string

FILE,READY,GLOBAL,ARRAY

$value : array<string, mixed>|string|null

depends on type

denyPath()

Checks if given path has allowed access and does not contain ../

public static denyPath(string $openDir[, array<string, array<string|int, string>> $access = [] ]) : string|null
Parameters
$openDir : string
$access : array<string, array<string|int, string>> = []
Return values
string|null

getAlert()

Get bootstrap like alert

public static getAlert(string $text[, string $type = 'danger' ]) : string
Parameters
$text : string
$type : string = 'danger'

alert type

Return values
string

getCSS()

Get CSS

public final getCSS() : array<string, mixed>
Return values
array<string, mixed>

getError()

Get last error

public getError() : string|null
Return values
string|null

getScript()

Get javascript

public final getScript() : array<string, mixed>
Return values
array<string, mixed>

getShortTitle()

Get page title without page name

public getShortTitle() : string
Return values
string

loadContent()

Loads the contents of an open directory

public loadContent() : void

renderActionBar()

Prints the top action bar of the browser

public renderActionBar() : void

renderContent()

Prints content of the browser

public renderContent() : void

setFilters()

Sets allowed filters for files to display

public setFilters(array<string, mixed> $filters[, string|null $default = null ]) : void
Parameters
$filters : array<string, mixed>
$default : string|null = null

getFunctions()

Returns allowed action for selected file/directory

protected getFunctions(string $name[, bool $dir = false ]) : string
Parameters
$name : string
$dir : bool = false
Return values
string

getParentDir()

Returns parent directory

protected getParentDir(string $openDir, array<string, mixed> $access) : string|null
Parameters
$openDir : string
$access : array<string, mixed>
Return values
string|null

getPath()

Returns full path to inserted directory

protected getPath(string $dir) : string
Parameters
$dir : string
Return values
string

getTitle()

Get page title

protected getTitle([string $split = ' - ' ]) : string
Parameters
$split : string = ' - '
Return values
string

isMime()

Check if file can be shown based on its mime

protected isMime(string $mime, array<string, string>|null $filter) : bool
Parameters
$mime : string
$filter : array<string, string>|null
Return values
bool

renderUploadBox()

Prints dropbox element for file upload

protected renderUploadBox() : void

        
On this page

Search results