\O3PO_Admin

The admin-specific functionality of the plugin.

Defines the plugin name, version, and hooks

Summary

Methods
Properties
Constants
__construct()
enqueue_styles()
enqueue_scripts()
add_plugin_action_links()
add_meta_data_explorer_page_to_menu()
render_meta_data_explorer()
enable_mathjax()
get_plugin_name()
get_plugin_pretty_name()
get_meta_data_explorer_tabs()
get_output_formats()
get_meta_data_field_map()
get_meta_data_fields()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$plugin_name
$version
$plugin__pretty_name
$meta_data_explorer_tabs
N/A

Properties

$plugin_name

$plugin_name : string

The ID of this plugin.

Type

string — The ID of this plugin.

$version

$version : string

The version of this plugin.

Type

string — The current version of this plugin.

$plugin__pretty_name

$plugin__pretty_name : string

The pretty name of this plugin.

Type

string — The pretty name of this plugin.

$meta_data_explorer_tabs

$meta_data_explorer_tabs : array

Array of tabs in the meta-data explorer.

Type

array — Array of slugs and labels of the tabs of the meta-data explorer.

Methods

__construct()

__construct(string  $plugin_name, string  $version, string  $plugin_pretty_name) 

Initialize the class and set its properties.

Parameters

string $plugin_name

The name of this plugin.

string $version

The version of this plugin.

string $plugin_pretty_name

The pretty name of this plugin.

enqueue_styles()

enqueue_styles() 

Register the stylesheets for the admin area.

To be added to the 'admin_enqueue_scripts' action.

enqueue_scripts()

enqueue_scripts() 

Register the JavaScript for the admin area.

To be added to the 'admin_enqueue_scripts' action.

add_plugin_action_links()

add_plugin_action_links(array  $actions) 

Add links

To be added to the 'plugin_actionlinks[plugin-name]/[plugin-name].php' filter.

Parameters

array $actions

Array of links to filter

add_meta_data_explorer_page_to_menu()

add_meta_data_explorer_page_to_menu() 

Top-level item to the administration menu

render_meta_data_explorer()

render_meta_data_explorer() 

Renders the O-3PO meta-data explorer

enable_mathjax()

enable_mathjax() 

Enable MathJax and some extra functionality on admin pages.

This allows us to show a live preview of titles and abstracts containing mathematical formulas and save their MathML representation when a post is saved. This would be very hard (impossible?) to do with just php, so we have to resort to running some code in the browser of the person adding the manuscript to the website. Concretely, the following adds a live preview and MathML output to all text fields of with css class "preview_and_mathml". The MathML output is itself a textfield and gets and id that is derived from that of the input field. When the post is saved its content hence ends up in POST and can be captured by our PHP code in the custom post types.

To be added to the 'admin_head' action.

get_plugin_name()

get_plugin_name() 

Get the plugin_name.

get_plugin_pretty_name()

get_plugin_pretty_name() 

Get the plugin_pretty_name.

get_meta_data_explorer_tabs()

get_meta_data_explorer_tabs() : array

Get the array of tabs in the meta-data explorer.

Returns

array —

Array of slugs and labels of the tabs of the meta-data explorer.

get_output_formats()

get_output_formats() : array

Get the array of output formats of the meta-data explorer.

Returns

array —

Array of output formats of the meta-data explorer.

get_meta_data_field_map()

get_meta_data_field_map() : array

Get the dictionary of meta-data fields and their corresponding callables.

Returns

array —

dictionary of meta-data fields and their corresponding callables.

get_meta_data_fields()

get_meta_data_fields() : array

Get the array of all meta-data fields.

Returns

array —

array of meta-data fields.