PHP Class Grav\Plugin\AdminPlugin

Inheritance: extends Grav\Common\Plugin
Show file Open project: getgrav/grav-plugin-admin

Public Properties

Property Type Description
$features

Protected Properties

Property Type Description
$active boolean
$admin Grav\Plugin\Admin\Admin
$admin_route string
$base string
$popularity Grav\Plugin\Admin\Popularity
$route string
$session RocketTheme\Toolbox\Session\Session
$template string
$theme string
$uri Grav\Common\Uri
$version

Public Methods

Method Description
getFormFieldTypes ( ) : array Get list of form field types specified in this plugin. Only special types needs to be listed.
getSubscribedEvents ( ) : array
isAdminPath ( ) : boolean Check if the current route is under the admin path
onAdminDashboard ( )
onAdminRegisterPermissions ( RocketTheme\Toolbox\Event\Event $e ) Initial stab at registering permissions (WIP)
onAssetsInitialized ( ) Handles initializing the assets
onFormProcessed ( RocketTheme\Toolbox\Event\Event $event ) Process the admin registration form.
onOutputGenerated ( )
onPagesInitialized ( ) Sets longer path to the home page allowing us to have list of pages when we enter to pages section.
onPluginsInitialized ( ) If the admin plugin is set as active, initialize the admin
onShutdown ( ) Handles the shutdown
onTaskGPM ( ) Handles getting GPM updates
onTwigExtensions ( ) Add the Admin Twig Extensions
onTwigSiteVariables ( ) Set all twig variables for generating output.
onTwigTemplatePaths ( ) Add twig paths to plugin templates.
setup ( ) If the admin path matches, initialize the Login plugin configuration and set the admin as active.

Protected Methods

Method Description
initializeAdmin ( ) Initialize the admin.
initializeController ( $task, $post )
validate ( string $type, string $value, string $extra = '' ) : boolean Validate a value. Currently validates

Method Details

getFormFieldTypes() public method

Get list of form field types specified in this plugin. Only special types needs to be listed.
public getFormFieldTypes ( ) : array
return array

getSubscribedEvents() public static method

public static getSubscribedEvents ( ) : array
return array

initializeAdmin() protected method

Initialize the admin.
protected initializeAdmin ( )

initializeController() protected method

protected initializeController ( $task, $post )

isAdminPath() public method

Check if the current route is under the admin path
public isAdminPath ( ) : boolean
return boolean

onAdminDashboard() public method

public onAdminDashboard ( )

onAdminRegisterPermissions() public method

Initial stab at registering permissions (WIP)
public onAdminRegisterPermissions ( RocketTheme\Toolbox\Event\Event $e )
$e RocketTheme\Toolbox\Event\Event

onAssetsInitialized() public method

Handles initializing the assets
public onAssetsInitialized ( )

onFormProcessed() public method

Process the admin registration form.
public onFormProcessed ( RocketTheme\Toolbox\Event\Event $event )
$event RocketTheme\Toolbox\Event\Event

onOutputGenerated() public method

public onOutputGenerated ( )

onPagesInitialized() public method

Sets longer path to the home page allowing us to have list of pages when we enter to pages section.
public onPagesInitialized ( )

onPluginsInitialized() public method

If the admin plugin is set as active, initialize the admin

onShutdown() public method

Handles the shutdown
public onShutdown ( )

onTaskGPM() public method

Handles getting GPM updates
public onTaskGPM ( )

onTwigExtensions() public method

Add the Admin Twig Extensions
public onTwigExtensions ( )

onTwigSiteVariables() public method

Set all twig variables for generating output.
public onTwigSiteVariables ( )

onTwigTemplatePaths() public method

Add twig paths to plugin templates.
public onTwigTemplatePaths ( )

setup() public method

If the admin path matches, initialize the Login plugin configuration and set the admin as active.
public setup ( )

validate() protected method

- 'user' for username format and username availability. - 'password1' for password format - 'password2' for equality to password1
protected validate ( string $type, string $value, string $extra = '' ) : boolean
$type string The field type
$value string The field value
$extra string Any extra value required
return boolean

Property Details

$active protected property

protected bool $active
return boolean

$admin protected property

protected Admin,Grav\Plugin\Admin $admin
return Grav\Plugin\Admin\Admin

$admin_route protected property

protected string $admin_route
return string

$base protected property

protected string $base
return string

$features public property

public $features

$popularity protected property

protected Popularity,Grav\Plugin\Admin $popularity
return Grav\Plugin\Admin\Popularity

$route protected property

protected string $route
return string

$session protected property

protected Session,RocketTheme\Toolbox\Session $session
return RocketTheme\Toolbox\Session\Session

$template protected property

protected string $template
return string

$theme protected property

protected string $theme
return string

$uri protected property

protected Uri,Grav\Common $uri
return Grav\Common\Uri

$version protected property

protected $version