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

Наследование: extends AdminBaseController
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$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

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

Метод Описание
checkValidFrontmatter ( string $frontmatter ) : boolean
determineFilenameIncludingLanguage ( string $current_filename, string $language ) : string The what should be the new filename when saving as a new language
initialize ( Grav\Common\Grav $grav = null, string $view = null, string $task = null, string $route = null, array $post = null )
taskActivate ( ) : boolean Set the default theme.
taskContinue ( ) : boolean Continue to the new page.
taskDisable ( ) : boolean Disable a plugin.
taskEnable ( ) : boolean Enable a plugin.
taskReset ( ) : boolean Handle the reset password action.
taskSave ( ) : boolean Handles form and saves the input data if its valid.
taskSaveNewFolder ( ) : boolean Handles creating an empty page folder (without markdown file)
taskUninstall ( ) : boolean Handles uninstalling plugins and themes
taskUpdategrav ( ) : boolean Handles updating Grav

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

Метод Описание
findFirstAvailable ( string $item, Grav\Common\Page\Page $page ) : string Find the first available $item ('slug' | 'folder') for a page Used when copying a page, to determine the first available slot
prepareData ( array $data ) : object Gets the configuration data for a given view & post
preparePage ( Grav\Common\Page\Page $page, boolean $clean_header = false, string $language = '' ) Prepare a page to be stored: update its folder, name, template, header and content
taskAddmedia ( ) : boolean Handles adding a media file to a page
taskBackup ( ) : boolean Handle the backup action
taskClearCache ( ) : boolean Clear the cache.
taskCopy ( ) : boolean Save page as a new copy.
taskDelete ( ) : boolean Delete page.
taskDelmedia ( ) : boolean Handles deleting a media file from a page
taskFilterPages ( ) Handles filtering the page by modular/visible/routable in the pages list.
taskForgot ( ) : boolean Handle the email password recovery procedure.
taskGetNewsFeed ( )
taskGetNotifications ( ) Get Notifications from cache.
taskGetPackagesDependencies ( ) : boolean Handle getting a new package dependencies needed to be installed
taskGpmRelease ( ) Toggle the gpm.releases setting
taskHideNotification ( ) : boolean Clear the cache.
taskInstallDependenciesOfPackages ( )
taskInstallPackage ( )
taskKeepAlive ( ) Keep alive
taskListmedia ( ) : boolean Determines the file types allowed to be uploaded
taskLogin ( ) : boolean Handle login.
taskLogout ( ) : boolean Handle logout.
taskProcessMarkdown ( ) : boolean Process the page Markdown
taskProcessNotifications ( ) : boolean Process Notifications. Store the notifications object locally.
taskRemovePackage ( ) : boolean Handle removing a package
taskReorder ( ) : boolean Reorder pages.
taskSaveas ( ) : boolean Save the current page in a different language. Automatically switches to that language.
taskSwitchlanguage ( ) Switch the content language. Optionally redirect to a different page.

Приватные методы

Метод Описание
getNextOrderInFolder ( $path ) : string Get the next available ordering number in a folder

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

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

public checkValidFrontmatter ( string $frontmatter ) : boolean
$frontmatter string
Результат boolean

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

The what should be the new filename when saving as a new language
public determineFilenameIncludingLanguage ( string $current_filename, string $language ) : string
$current_filename string the current file name, including .md. Example: default.en.md
$language string The new language it will be saved as. Example: 'it' or 'en-GB'.
Результат string The new filename. Example: 'default.it'

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

Find the first available $item ('slug' | 'folder') for a page Used when copying a page, to determine the first available slot
protected findFirstAvailable ( string $item, Grav\Common\Page\Page $page ) : string
$item string
$page Grav\Common\Page\Page
Результат string The first available slot

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

public initialize ( Grav\Common\Grav $grav = null, string $view = null, string $task = null, string $route = null, array $post = null )
$grav Grav\Common\Grav
$view string
$task string
$route string
$post array

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

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

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

Prepare a page to be stored: update its folder, name, template, header and content
protected preparePage ( Grav\Common\Page\Page $page, boolean $clean_header = false, string $language = '' )
$page Grav\Common\Page\Page
$clean_header boolean
$language string

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

Set the default theme.
public taskActivate ( ) : boolean
Результат boolean True if the action was performed.

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

Handles adding a media file to a page
protected taskAddmedia ( ) : boolean
Результат boolean True if the action was performed.

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

Handle the backup action
protected taskBackup ( ) : boolean
Результат boolean True if the action was performed.

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

Clear the cache.
protected taskClearCache ( ) : boolean
Результат boolean True if the action was performed.

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

Continue to the new page.
public taskContinue ( ) : boolean
Результат boolean True if the action was performed.

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

Save page as a new copy.
protected taskCopy ( ) : boolean
Результат boolean True if the action was performed.

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

Delete page.
protected taskDelete ( ) : boolean
Результат boolean True if the action was performed.

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

Handles deleting a media file from a page
protected taskDelmedia ( ) : boolean
Результат boolean True if the action was performed.

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

Disable a plugin.
public taskDisable ( ) : boolean
Результат boolean True if the action was performed.

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

Enable a plugin.
public taskEnable ( ) : boolean
Результат boolean True if the action was performed.

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

Handles filtering the page by modular/visible/routable in the pages list.
protected taskFilterPages ( )

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

Handle the email password recovery procedure.
protected taskForgot ( ) : boolean
Результат boolean True if the action was performed.

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

protected taskGetNewsFeed ( )

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

Get Notifications from cache.
protected taskGetNotifications ( )

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

Handle getting a new package dependencies needed to be installed
protected taskGetPackagesDependencies ( ) : boolean
Результат boolean

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

Toggle the gpm.releases setting
protected taskGpmRelease ( )

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

Clear the cache.
protected taskHideNotification ( ) : boolean
Результат boolean True if the action was performed.

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

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

protected taskInstallPackage ( )

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

Keep alive
protected taskKeepAlive ( )

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

Determines the file types allowed to be uploaded
protected taskListmedia ( ) : boolean
Результат boolean True if the action was performed.

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

Handle login.
protected taskLogin ( ) : boolean
Результат boolean True if the action was performed.

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

Handle logout.
protected taskLogout ( ) : boolean
Результат boolean True if the action was performed.

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

Process the page Markdown
protected taskProcessMarkdown ( ) : boolean
Результат boolean True if the action was performed.

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

Process Notifications. Store the notifications object locally.
protected taskProcessNotifications ( ) : boolean
Результат boolean

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

Handle removing a package
protected taskRemovePackage ( ) : boolean
Результат boolean

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

Reorder pages.
protected taskReorder ( ) : boolean
Результат boolean True if the action was performed.

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

Handle the reset password action.
public taskReset ( ) : boolean
Результат boolean True if the action was performed.

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

Handles form and saves the input data if its valid.
public taskSave ( ) : boolean
Результат boolean True if the action was performed.

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

Handles creating an empty page folder (without markdown file)
public taskSaveNewFolder ( ) : boolean
Результат boolean True if the action was performed.

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

Save the current page in a different language. Automatically switches to that language.
protected taskSaveas ( ) : boolean
Результат boolean True if the action was performed.

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

Switch the content language. Optionally redirect to a different page.
protected taskSwitchlanguage ( )

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

Handles uninstalling plugins and themes
Устаревший:
public taskUninstall ( ) : boolean
Результат boolean True if the action was performed

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

Handles updating Grav
public taskUpdategrav ( ) : boolean
Результат boolean True if the action was performed

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

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

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

$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