PHP Class Grav\Plugin\Admin\AdminController

Inheritance: extends AdminBaseController
Afficher le fichier Open project: getgrav/grav-plugin-admin Class Usage Examples

Méthodes publiques

Свойство Type Description
$data array | null
$grav Grav\Common\Grav
$post array
$route string
$task string
$view string

Protected Properties

Свойство Type Description
$admin Admin
$redirect string
$redirectCode integer
$upload_errors
$uri Grav\Common\Uri

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
getNextOrderInFolder ( $path ) : string Get the next available ordering number in a folder

Method Details

checkValidFrontmatter() public méthode

public checkValidFrontmatter ( string $frontmatter ) : boolean
$frontmatter string
Résultat boolean

determineFilenameIncludingLanguage() public méthode

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'.
Résultat string The new filename. Example: 'default.it'

findFirstAvailable() protected méthode

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
Résultat string The first available slot

initialize() public méthode

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() protected méthode

Gets the configuration data for a given view & post
protected prepareData ( array $data ) : object
$data array
Résultat object

preparePage() protected méthode

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() public méthode

Set the default theme.
public taskActivate ( ) : boolean
Résultat boolean True if the action was performed.

taskAddmedia() protected méthode

Handles adding a media file to a page
protected taskAddmedia ( ) : boolean
Résultat boolean True if the action was performed.

taskBackup() protected méthode

Handle the backup action
protected taskBackup ( ) : boolean
Résultat boolean True if the action was performed.

taskClearCache() protected méthode

Clear the cache.
protected taskClearCache ( ) : boolean
Résultat boolean True if the action was performed.

taskContinue() public méthode

Continue to the new page.
public taskContinue ( ) : boolean
Résultat boolean True if the action was performed.

taskCopy() protected méthode

Save page as a new copy.
protected taskCopy ( ) : boolean
Résultat boolean True if the action was performed.

taskDelete() protected méthode

Delete page.
protected taskDelete ( ) : boolean
Résultat boolean True if the action was performed.

taskDelmedia() protected méthode

Handles deleting a media file from a page
protected taskDelmedia ( ) : boolean
Résultat boolean True if the action was performed.

taskDisable() public méthode

Disable a plugin.
public taskDisable ( ) : boolean
Résultat boolean True if the action was performed.

taskEnable() public méthode

Enable a plugin.
public taskEnable ( ) : boolean
Résultat boolean True if the action was performed.

taskFilterPages() protected méthode

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

taskForgot() protected méthode

Handle the email password recovery procedure.
protected taskForgot ( ) : boolean
Résultat boolean True if the action was performed.

taskGetNewsFeed() protected méthode

protected taskGetNewsFeed ( )

taskGetNotifications() protected méthode

Get Notifications from cache.
protected taskGetNotifications ( )

taskGetPackagesDependencies() protected méthode

Handle getting a new package dependencies needed to be installed
protected taskGetPackagesDependencies ( ) : boolean
Résultat boolean

taskGpmRelease() protected méthode

Toggle the gpm.releases setting
protected taskGpmRelease ( )

taskHideNotification() protected méthode

Clear the cache.
protected taskHideNotification ( ) : boolean
Résultat boolean True if the action was performed.

taskInstallDependenciesOfPackages() protected méthode

taskInstallPackage() protected méthode

protected taskInstallPackage ( )

taskKeepAlive() protected méthode

Keep alive
protected taskKeepAlive ( )

taskListmedia() protected méthode

Determines the file types allowed to be uploaded
protected taskListmedia ( ) : boolean
Résultat boolean True if the action was performed.

taskLogin() protected méthode

Handle login.
protected taskLogin ( ) : boolean
Résultat boolean True if the action was performed.

taskLogout() protected méthode

Handle logout.
protected taskLogout ( ) : boolean
Résultat boolean True if the action was performed.

taskProcessMarkdown() protected méthode

Process the page Markdown
protected taskProcessMarkdown ( ) : boolean
Résultat boolean True if the action was performed.

taskProcessNotifications() protected méthode

Process Notifications. Store the notifications object locally.
protected taskProcessNotifications ( ) : boolean
Résultat boolean

taskRemovePackage() protected méthode

Handle removing a package
protected taskRemovePackage ( ) : boolean
Résultat boolean

taskReorder() protected méthode

Reorder pages.
protected taskReorder ( ) : boolean
Résultat boolean True if the action was performed.

taskReset() public méthode

Handle the reset password action.
public taskReset ( ) : boolean
Résultat boolean True if the action was performed.

taskSave() public méthode

Handles form and saves the input data if its valid.
public taskSave ( ) : boolean
Résultat boolean True if the action was performed.

taskSaveNewFolder() public méthode

Handles creating an empty page folder (without markdown file)
public taskSaveNewFolder ( ) : boolean
Résultat boolean True if the action was performed.

taskSaveas() protected méthode

Save the current page in a different language. Automatically switches to that language.
protected taskSaveas ( ) : boolean
Résultat boolean True if the action was performed.

taskSwitchlanguage() protected méthode

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

taskUninstall() public méthode

Handles uninstalling plugins and themes
Deprecation:
public taskUninstall ( ) : boolean
Résultat boolean True if the action was performed

taskUpdategrav() public méthode

Handles updating Grav
public taskUpdategrav ( ) : boolean
Résultat boolean True if the action was performed

Property Details

$admin protected_oe property

protected Admin,Grav\Plugin\Admin $admin
Résultat Admin

$data public_oe property

public array|null $data
Résultat array | null

$grav public_oe property

public Grav,Grav\Common $grav
Résultat Grav\Common\Grav

$post public_oe property

public array $post
Résultat array

$redirect protected_oe property

protected string $redirect
Résultat string

$redirectCode protected_oe property

protected int $redirectCode
Résultat integer

$route public_oe property

public string $route
Résultat string

$task public_oe property

public string $task
Résultat string

$upload_errors protected_oe property

protected $upload_errors

$uri protected_oe property

protected Uri,Grav\Common $uri
Résultat Grav\Common\Uri

$view public_oe property

public string $view
Résultat string