Subroutine Name

RegAdminPage

Explanation and Usage

This subroutine registers a menu entry and associated subroutine in the administrative menu. This is useful for plugin developers who wish to add to the back-end administrative functionality of Aneuch (providing options available only to logged in site administrators).

Syntax

RegAdminPage(Name, Description, Subroutine)

Options

Name - This is the 'name' of the function you're providing. It should be lower case, all one word, and fairly descriptive of the function you're going to provide (to make debugging easier). See the examples below.

Description - This is what will show on the administrative menu. The administrative menu is sorted alphabetically by these descriptions (with the exception of the "Authenticate" option, which will always be at the top regardless of any other menu items coming before it alphabetically). If this field is an empty string, the entry will not be displayed in the administrative menu (however, the subroutine will still be registered).

Subroutine - This is the name of the subroutine you want executed when a user clicks on the associated menu item. It must be entered in this format: \&SubroutineName

Examples

These are actual examples from the Aneuch source code:

RegAdminPage('version', 'View version information', \&DoAdminVersion);
This registers a menu item "View version information", which when clicked will execute ?do=admin;page=version, which will then cause Aneuch to execute the DoAdminVersion subroutine.

RegAdminPage('index', 'List all pages', \&DoAdminIndex);
This registers a menu item "List all pages", which when clicked will execute ?do=admin;page=index, which will then cause Aneuch to execute the DoAdminIndex subroutine.

← Return to API listing