PHP Класс Grav\Plugin\Admin\AdminBaseController

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$blacklist_views array
$data array | null
$grav Grav\Common\Grav
$post array
$route string
$task string
$view string

Защищенные свойства (Protected)

Свойство Тип Описание
$admin Admin
$redirect string
$redirectCode integer
$upload_errors
$uri Grav\Common\Uri

Открытые методы

Метод Описание
execute ( ) : boolean Performs a task.
redirect ( ) Redirect to the route stored in $this->redirect
setRedirect ( string $path, integer $code = 303 ) Sets the page redirect.
taskFilesSessionRemove ( ) : boolean Removes a file from the flash object session, before it gets saved
taskFilesUpload ( ) : boolean Handles ajax upload for files.
taskRemoveMedia ( ) : boolean Handles removing a media file

Защищенные методы

Метод Описание
authorizeTask ( string $task = '', array $permissions = [] ) : boolean Checks if the user is allowed to perform the given task with its associated permissions
canEditMedia ( string $type = 'media' ) : boolean Determine if the user can edit media
cleanDataKeys ( $source = [] )
dataPermissions ( ) : array Gets the permissions needed to access a given view
filterAcceptedFiles ( $file, $settings )
getPost ( array $post ) : array Prepare and return POST data.
isMultilang ( ) : boolean Return true if multilang is active
jsonDecode ( array $data ) : array Recursively JSON decode data.
normalizeFiles ( array $data, string $key = '' ) : object Internal method to normalize the $_FILES array
prepareData ( array $data ) : array Gets the configuration data for a given view & post
storeFiles ( Grav\Common\Page\Page | Grav\Common\Data\Data $obj ) : Grav\Common\Page\Page | Grav\Common\Data\Data
taskGetFilesInFolder ( ) Used by the filepicker field to get a list of files in a folder.
taskRemoveFileFromBlueprint ( ) : boolean Handle deleting a file from a blueprint
validateNonce ( )

Описание методов

authorizeTask() защищенный Метод

Checks if the user is allowed to perform the given task with its associated permissions
protected authorizeTask ( string $task = '', array $permissions = [] ) : boolean
$task string The task to execute
$permissions array The permissions given
Результат boolean True if authorized. False if not.

canEditMedia() защищенный Метод

Determine if the user can edit media
protected canEditMedia ( string $type = 'media' ) : boolean
$type string
Результат boolean True if the media action is allowed

cleanDataKeys() защищенный Метод

protected cleanDataKeys ( $source = [] )

dataPermissions() защищенный Метод

Gets the permissions needed to access a given view
protected dataPermissions ( ) : array
Результат array An array of permissions

execute() публичный Метод

Performs a task.
public execute ( ) : boolean
Результат boolean True if the action was performed successfully.

filterAcceptedFiles() защищенный Метод

protected filterAcceptedFiles ( $file, $settings )

getPost() защищенный Метод

Prepare and return POST data.
protected getPost ( array $post ) : array
$post array
Результат array

isMultilang() защищенный Метод

Return true if multilang is active
protected isMultilang ( ) : boolean
Результат boolean True if multilang is active

jsonDecode() защищенный Метод

Recursively JSON decode data.
protected jsonDecode ( array $data ) : array
$data array
Результат array

normalizeFiles() защищенный Метод

Internal method to normalize the $_FILES array
protected normalizeFiles ( array $data, string $key = '' ) : object
$data array $_FILES starting point data
$key string
Результат object a new Object with a normalized list of files

prepareData() защищенный Метод

Gets the configuration data for a given view & post
protected prepareData ( array $data ) : array
$data array
Результат array

redirect() публичный Метод

Redirect to the route stored in $this->redirect
public redirect ( )

setRedirect() публичный Метод

Sets the page redirect.
public setRedirect ( string $path, integer $code = 303 )
$path string The path to redirect to
$code integer The HTTP redirect code

storeFiles() защищенный Метод

protected storeFiles ( Grav\Common\Page\Page | Grav\Common\Data\Data $obj ) : Grav\Common\Page\Page | Grav\Common\Data\Data
$obj Grav\Common\Page\Page | Grav\Common\Data\Data
Результат Grav\Common\Page\Page | Grav\Common\Data\Data

taskFilesSessionRemove() публичный Метод

Removes a file from the flash object session, before it gets saved
public taskFilesSessionRemove ( ) : boolean
Результат boolean True if the action was performed.

taskFilesUpload() публичный Метод

Stores in a flash object the temporary file and deals with potential file errors.
public taskFilesUpload ( ) : boolean
Результат boolean True if the action was performed.

taskGetFilesInFolder() защищенный Метод

Used by the filepicker field to get a list of files in a folder.
protected taskGetFilesInFolder ( )

taskRemoveFileFromBlueprint() защищенный Метод

Handle deleting a file from a blueprint
protected taskRemoveFileFromBlueprint ( ) : boolean
Результат boolean True if the action was performed.

taskRemoveMedia() публичный Метод

Handles removing a media file
public taskRemoveMedia ( ) : boolean
Результат boolean True if the action was performed

validateNonce() защищенный Метод

protected validateNonce ( )

Описание свойств

$admin защищенное свойство

protected Admin,Grav\Plugin\Admin $admin
Результат Admin

$blacklist_views публичное свойство

public array $blacklist_views
Результат array

$data публичное свойство

public array|null $data
Результат array | null

$grav публичное свойство

public Grav,Grav\Common $grav
Результат Grav\Common\Grav

$post публичное свойство

public array $post
Результат array

$redirect защищенное свойство

protected string $redirect
Результат string

$redirectCode защищенное свойство

protected int $redirectCode
Результат integer

$route публичное свойство

public string $route
Результат string

$task публичное свойство

public string $task
Результат string

$upload_errors защищенное свойство

protected $upload_errors

$uri защищенное свойство

protected Uri,Grav\Common $uri
Результат Grav\Common\Uri

$view публичное свойство

public string $view
Результат string