PHP Class Habari\AdminHandler

Inheritance: extends ActionHandler
Mostrar archivo Open project: habari/system

Protected Properties

Property Type Description
$active_theme An instance of the active public theme, which allows plugin hooks to execute

Public Methods

Method Description
__construct ( ) Verifies user credentials before creating the theme and displaying the request.
__static ( ) Register plugin hooks
act ( $action ) Dispatches the request to the defined method. (ie: post_{page})
act_admin_ajax ( ) Handle incoming requests to /admin_ajax for admin ajax requests
ajax_facets ( $handler_vars ) Handle ajax requests for facets on admin pages
create_theme ( ) Create the active theme instance
get_blank ( string $content = '' ) Display a blank admin page with appropriate navigation.
get_sysinfo ( ) Handles get requests for the system information page.
setup_admin_theme ( string $page, string $type = '' ) Create the admin theme instance

Protected Methods

Method Description
display ( $template_name ) Helper function to assign all handler_vars into the theme and displays a theme template.
filter_menus_by_permission ( array $menuarray ) : array Remove menus for which the user does not have qualifying permissions.
get_main_menu ( Theme $theme ) Assembles the main menu for the admin area.
set_admin_template_vars ( $theme ) Assigns the main menu to $mainmenu into the theme.

Private Methods

Method Description
access_allowed ( $page, $type ) Checks if the currently logged in user has access to a page and post type.

Method Details

__construct() public method

Verifies user credentials before creating the theme and displaying the request.
public __construct ( )

__static() public static method

Register plugin hooks
public static __static ( )

act() public method

Dispatches the request to the defined method. (ie: post_{page})
public act ( $action )

act_admin_ajax() public method

Handle incoming requests to /admin_ajax for admin ajax requests
public act_admin_ajax ( )

ajax_facets() public method

Handle ajax requests for facets on admin pages
public ajax_facets ( $handler_vars )
$handler_vars

create_theme() public method

Create the active theme instance
public create_theme ( )

display() protected method

Helper function to assign all handler_vars into the theme and displays a theme template.
protected display ( $template_name )

filter_menus_by_permission() protected method

Remove menus for which the user does not have qualifying permissions.
protected filter_menus_by_permission ( array $menuarray ) : array
$menuarray array The master array of admin menu items
return array The modified array of admin menu items

get_blank() public method

This function terminates execution before returning. Useful for displaying errors when permission is denied for viewing.
public get_blank ( string $content = '' )
$content string Optional default content to display

get_main_menu() protected method

Assembles the main menu for the admin area.
protected get_main_menu ( Theme $theme )
$theme Theme The theme to add the menu to

get_sysinfo() public method

Handles get requests for the system information page.
public get_sysinfo ( )

set_admin_template_vars() protected method

Assigns the main menu to $mainmenu into the theme.
protected set_admin_template_vars ( $theme )

setup_admin_theme() public method

Create the admin theme instance
public setup_admin_theme ( string $page, string $type = '' )
$page string The admin page requested
$type string The content type included in the request

Property Details

$active_theme protected_oe property

An instance of the active public theme, which allows plugin hooks to execute
protected $active_theme