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

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

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

Свойство Тип Описание
$base string
$forgot array
$grav Grav\Common\Grav
$json_response array
$location string
$route string
$task string
$user Grav\Common\User\User

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

Свойство Тип Описание
$blueprints Grav\Common\Data\Blueprints
$gpm Grav\Common\GPM\GPM
$pages array
$pages_count integer
$permissions array
$session RocketTheme\Toolbox\Session\Session
$uri Grav\Common\Uri

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

Метод Описание
__construct ( Grav\Common\Grav $grav, string $base, string $location, string $route ) Constructor.
accessLevels ( ) : array Get all access levels
addPermissions ( $permissions ) Adds a permission to the permissions array
adminLanguages ( ) : array Return the languages available in the admin
authenticate ( array $data, array $post ) : boolean Authenticate user.
authorize ( string $action = 'admin.login' ) : boolean Checks user authorisation to the action.
blueprints ( string $type ) : Grav\Common\Data\Blueprint Returns blueprints for the given type.
checkPackagesCanBeInstalled ( $packages ) : boolean Check the passed packages list can be updated
cleanContent ( $content )
configurations ( ) : array Return the found configuration blueprints
data ( string $type, array $post = [] ) : mixed Gets configuration data.
dateformatToMomentJS ( string $php_format ) : string
dependenciesThatCanBeRemovedWhenRemoving ( string $slug ) : array | boolean Generate an array of dependencies for a package, used to generate a list of packages that can be removed when removing a package.
field ( string $name ) : string Converts dot notation to array notation.
findFormFields ( $type, $fields, $found_fields = [] )
getDependenciesNeededToInstall ( array $packages ) : array | boolean Get an array of dependencies needed to be installed or updated for a list of packages to be installed.
getFeed ( ) : mixed Get https://getgrav.org news feed
getLastPageName ( ) : string Static helper method to return the last used page name
getLastPageRoute ( ) : string Static helper method to return the last used page route
getNonce ( ) : string Static helper method to return the admin form nonce
getPackageFromGPM ( $package_slug )
getPackagesThatDependOnPackage ( string $slug ) : array | boolean Get list of packages that depend on the passed package slug
getPage ( $path ) : Grav\Common\Page\Page Returns the page creating it if it does not exist.
getPagePathFromToken ( $path )
getPermissions ( ) : array Gets the entire permissions array
getRouteDetails ( )
getTempDir ( )
gpm ( ) : Grav\Common\GPM\GPM Get the GPM instance
guessDateFormat ( $date ) : string Guest date format based on euro/US
isPremiumProduct ( object $info ) : boolean Determine if the plugin or theme info passed is premium
isTeamGrav ( object $info ) : boolean Determine if the plugin or theme info passed is from Team Grav
lastBackup ( ) : array Search in the logs when was the latest backup made
latestPages ( integer $count = 10 ) : array | null Used by the Dashboard in the admin to display the X latest pages that have been modified
license ( $package_slug )
logEntry ( ) : string Get log file for fatal errors.
messages ( string $type = null ) : array Fetch and delete messages from the session queue.
modularTypes ( ) : array Get all modular template types
page ( boolean $route = false, null $path = null ) : Grav\Common\Page\Page Returns edited page.
pagesCount ( ) : array Count the pages
phpinfo ( ) : string Renders phpinfo
plugins ( boolean $local = true ) : mixed Get all plugins.
processNotifications ( $notifications )
route ( ) : string Static helper method to return current route.
routes ( boolean $unique = false ) : array Get all routes.
session ( ) : RocketTheme\Toolbox\Session\Session Get current session.
setMessage ( string $msg, string $type = 'info' ) Add message into the session queue.
setPermissions ( $permissions ) Sets the entire permissions array
siteLanguages ( ) : array Return the languages available in the site
themes ( boolean $local = true ) : mixed Get all themes.
translate ( array | mixed $args, mixed $languages = null ) : string Translate a string to the user-defined language
types ( ) : array Get all template types
validateDate ( $date, $format )

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

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

Constructor.
public __construct ( Grav\Common\Grav $grav, string $base, string $location, string $route )
$grav Grav\Common\Grav
$base string
$location string
$route string

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

Get all access levels
public accessLevels ( ) : array
Результат array

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

Adds a permission to the permissions array
public addPermissions ( $permissions )
$permissions

adminLanguages() публичный статический Метод

Return the languages available in the admin
public static adminLanguages ( ) : array
Результат array

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

Authenticate user.
public authenticate ( array $data, array $post ) : boolean
$data array Form data.
$post array Additional form fields.
Результат boolean

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

Checks user authorisation to the action.
public authorize ( string $action = 'admin.login' ) : boolean
$action string
Результат boolean

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

Returns blueprints for the given type.
public blueprints ( string $type ) : Grav\Common\Data\Blueprint
$type string
Результат Grav\Common\Data\Blueprint

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

Check the passed packages list can be updated
public checkPackagesCanBeInstalled ( $packages ) : boolean
$packages
Результат boolean

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

public cleanContent ( $content )

configurations() публичный статический Метод

Return the found configuration blueprints
public static configurations ( ) : array
Результат array

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

Gets configuration data.
public data ( string $type, array $post = [] ) : mixed
$type string
$post array
Результат mixed

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

public dateformatToMomentJS ( string $php_format ) : string
$php_format string
Результат string

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

Generate an array of dependencies for a package, used to generate a list of packages that can be removed when removing a package.
public dependenciesThatCanBeRemovedWhenRemoving ( string $slug ) : array | boolean
$slug string The package slug
Результат array | boolean

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

Converts dot notation to array notation.
public field ( string $name ) : string
$name string
Результат string

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

public findFormFields ( $type, $fields, $found_fields = [] )

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

Get an array of dependencies needed to be installed or updated for a list of packages to be installed.
public getDependenciesNeededToInstall ( array $packages ) : array | boolean
$packages array The packages slugs
Результат array | boolean

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

Get https://getgrav.org news feed
public getFeed ( ) : mixed
Результат mixed

getLastPageName() публичный статический Метод

Static helper method to return the last used page name
public static getLastPageName ( ) : string
Результат string

getLastPageRoute() публичный статический Метод

Static helper method to return the last used page route
public static getLastPageRoute ( ) : string
Результат string

getNonce() публичный статический Метод

Static helper method to return the admin form nonce
public static getNonce ( ) : string
Результат string

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

public getPackageFromGPM ( $package_slug )

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

Get list of packages that depend on the passed package slug
public getPackagesThatDependOnPackage ( string $slug ) : array | boolean
$slug string The package slug
Результат array | boolean

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

Returns the page creating it if it does not exist.
public getPage ( $path ) : Grav\Common\Page\Page
$path
Результат Grav\Common\Page\Page

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

public getPagePathFromToken ( $path )

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

Gets the entire permissions array
public getPermissions ( ) : array
Результат array

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

public getRouteDetails ( )

getTempDir() публичный статический Метод

public static getTempDir ( )

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

Get the GPM instance
public gpm ( ) : Grav\Common\GPM\GPM
Результат Grav\Common\GPM\GPM The GPM instance

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

Guest date format based on euro/US
public guessDateFormat ( $date ) : string
$date
Результат string

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

Determine if the plugin or theme info passed is premium
public isPremiumProduct ( object $info ) : boolean
$info object Plugin or Theme info object
Результат boolean

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

Determine if the plugin or theme info passed is from Team Grav
public isTeamGrav ( object $info ) : boolean
$info object Plugin or Theme info object
Результат boolean

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

Search in the logs when was the latest backup made
public lastBackup ( ) : array
Результат array Array containing the latest backup information

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

Used by the Dashboard in the admin to display the X latest pages that have been modified
public latestPages ( integer $count = 10 ) : array | null
$count integer number of pages to pull back
Результат array | null

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

public license ( $package_slug )

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

Get log file for fatal errors.
public logEntry ( ) : string
Результат string

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

Fetch and delete messages from the session queue.
public messages ( string $type = null ) : array
$type string
Результат array

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

Get all modular template types
public modularTypes ( ) : array
Результат array

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

Returns edited page.
public page ( boolean $route = false, null $path = null ) : Grav\Common\Page\Page
$route boolean
$path null
Результат Grav\Common\Page\Page

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

Count the pages
public pagesCount ( ) : array
Результат array

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

Renders phpinfo
public phpinfo ( ) : string
Результат string The phpinfo() output

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

Get all plugins.
public plugins ( boolean $local = true ) : mixed
$local boolean
Результат mixed

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

public processNotifications ( $notifications )

route() публичный статический Метод

Static helper method to return current route.
public static route ( ) : string
Результат string

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

Get all routes.
public routes ( boolean $unique = false ) : array
$unique boolean
Результат array

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

Get current session.
public session ( ) : RocketTheme\Toolbox\Session\Session
Результат RocketTheme\Toolbox\Session\Session

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

Add message into the session queue.
public setMessage ( string $msg, string $type = 'info' )
$msg string
$type string

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

Sets the entire permissions array
public setPermissions ( $permissions )
$permissions

siteLanguages() публичный статический Метод

Return the languages available in the site
public static siteLanguages ( ) : array
Результат array

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

Get all themes.
public themes ( boolean $local = true ) : mixed
$local boolean
Результат mixed

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

Translate a string to the user-defined language
public translate ( array | mixed $args, mixed $languages = null ) : string
$args array | mixed
$languages mixed
Результат string

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

Get all template types
public types ( ) : array
Результат array

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

public validateDate ( $date, $format )

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

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

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

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

protected Blueprints,Grav\Common\Data $blueprints
Результат Grav\Common\Data\Blueprints

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

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

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

protected GPM,Grav\Common\GPM $gpm
Результат Grav\Common\GPM\GPM

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

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

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

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

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

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

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

protected array $pages
Результат array

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

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

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

protected array $permissions
Результат array

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

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

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

protected Session,RocketTheme\Toolbox\Session $session
Результат RocketTheme\Toolbox\Session\Session

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

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

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

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

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

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