PHP Class Mlp_Quicklink

Inheritance: implements Mlp_Updatable
Datei anzeigen Open project: inpsyde/multilingual-press Class Usage Examples

Public Methods

Method Description
__construct ( Inpsyde\MultilingualPress\Module\ModuleManager $module_manager, Mlp_Language_Api_Interface $language_api, AssetManager $asset_manager, Inpsyde\MultilingualPress\Common\Nonce\Nonce $nonce ) Constructor. Sets up the properties.
deactivate_module ( ) : void Deletes the according site option on module deactivation.
draw_options_page_form_fields ( ) : void Displays the module options page form fields.
extend_allowed_hosts ( array $home_hosts, string $remote_host ) : string[] Adds all domains of the network to the allowed hosts.
frontend_tab ( string $content ) : string Create the tab and prepend it to the body tag.
initialize ( ) : void Wires up all functions.
load_style ( ) : boolean Requires the stylesheet.
save_options_page_form_fields ( ) : void Saves module user input.
update ( string $name ) : void Nothing to do here.

Protected Methods

Method Description
get_html_container ( string $selections, string $type, array $translated, string $position ) : string Returns the remote post links in form of up to three link elements, or a select element for more than three links.
to_html ( array $translated, string $position ) : string Converts the list of translated posts into HTML.

Private Methods

Method Description
get_translations ( ) : Inpsyde\MultilingualPress\Common\Type\Translation[] Returns the translations.
redirect_quick_link ( string $url ) : void Catches quicklink submissions and redirects if the URL is valid.
register_setting ( ) : boolean Registers the module.

Method Details

__construct() public method

Constructor. Sets up the properties.
public __construct ( Inpsyde\MultilingualPress\Module\ModuleManager $module_manager, Mlp_Language_Api_Interface $language_api, AssetManager $asset_manager, Inpsyde\MultilingualPress\Common\Nonce\Nonce $nonce )
$module_manager Inpsyde\MultilingualPress\Module\ModuleManager Module manager object.
$language_api Mlp_Language_Api_Interface Language API object.
$asset_manager Inpsyde\MultilingualPress\Asset\AssetManager Asset manager object.
$nonce Inpsyde\MultilingualPress\Common\Nonce\Nonce Nonce object.

deactivate_module() public static method

Deletes the according site option on module deactivation.
Since: 0.1
public static deactivate_module ( ) : void
return void

draw_options_page_form_fields() public method

Displays the module options page form fields.
Since: 0.1

extend_allowed_hosts() public method

Adds all domains of the network to the allowed hosts.
Since: 1.0.4
public extend_allowed_hosts ( array $home_hosts, string $remote_host ) : string[]
$home_hosts array Array with one entry: the host of home_url().
$remote_host string Host name of the URL to validate.
return string[]

frontend_tab() public method

Create the tab and prepend it to the body tag.
public frontend_tab ( string $content ) : string
$content string HTML content.
return string

get_html_container() protected method

Returns the remote post links in form of up to three link elements, or a select element for more than three links.
protected get_html_container ( string $selections, string $type, array $translated, string $position ) : string
$selections string 'option' or 'a' elements.
$type string 'links' or 'form'.
$translated array Original array of translated posts, passed to the filter.
$position string Quicklink position.
return string

initialize() public method

Wires up all functions.
public initialize ( ) : void
return void

load_style() public method

Requires the stylesheet.
public load_style ( ) : boolean
return boolean

save_options_page_form_fields() public method

Saves module user input.
Since: 0.1

to_html() protected method

Converts the list of translated posts into HTML.
protected to_html ( array $translated, string $position ) : string
$translated array Translated posts.
$position string Position of the quicklinks tab.
return string

update() public method

Nothing to do here.
public update ( string $name ) : void
$name string
return void