Store Locator Plus®

MySLP_Styles_Admin extends SLPlus_BaseClass_Object
in package

SLP Styles Admin Class

Table of Contents

Properties

$css_dir  : mixed
$css_url  : mixed
$notifications  : mixed
$slplus  : SLPlus
$uses_slplus  : bool
$slplus  : mixed
$uses_slplus  : mixed
$addon_settings  : mixed
$current_slug  : mixed
$theme_option_fields  : mixed
$themeDetails  : mixed

Methods

__construct()  : mixed
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
get_instance()  : SLPlus_BaseClass_Object
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
get_theme()  : mixed
Add the theme settings to the admin panel.
get_theme_details()  : mixed
set_properties()  : mixed
Set our properties.
initialize()  : mixed
Do these things when this object is invoked. Override in your class.
create_string_addon_layout()  : string
Create the string for the theme layouts.
create_string_addon_links()  : string
Get the HTML for a list of add-ons linked to their product pages.
create_string_addon_packs()  : string
Create the output string for add on packs used by themes.
createstring_ThemeDetails()  : string
Build an HTML string to show under the theme selection box.
get_addons_that_provide_attribute()  : array<string|int, mixed>|null
Return an array of add-on slugs and field names that provide the given Plugin Style attribute.
get_first_active_addon()  : null
Get the first active add-on in a list of addon slugs.
get_slp_option_for_attribute()  : string
Get the settings field to update based on which add-on packs are active.
get_theme_addons()  : string
Create a list of add-on packs that this plugin style works best with.
get_theme_info()  : mixed
Extract the label & key from a CSS file header.
get_theme_list()  : array<string|int, mixed>
Get the list of themes from the options table, adding new entries from the CSS directory if files have been added.
has_theme_details()  : bool
Return true if this theme slug has details.
set_layout_defaults()  : array<string|int, mixed>
Set layout defaults when not specified in the Plugin Style header.
setup_ThemeDetails()  : string
Create the details divs for the SLP styles.

Properties

$uses_slplus

public bool $uses_slplus

Set to true (default) if the object needs access to the SLPlus plugin object.

$addon_settings

private mixed $addon_settings = array('bubble' => array('slp-experience' => 'slp-experience[bubblelayout]', 'slp-enhanced-map' => 'bubblelayout'), 'layout' => array('slp-experience' => 'slp-experience[layout]', 'slp-pro' => 'csl-slplus-layout'), 'results' => array('slp-experience' => 'slp-experience[resultslayout]', 'slp-enhanced-results' => 'csl-slplus-ER-options[resultslayout]'), 'results_header' => array('slp-premier' => 'slp-premier-options[results_header]'), 'search' => array('slp-experience' => 'slp-experience[searchlayout]', 'slp-enhanced-results' => 'csl-slplus-ES-options[searchlayout]'))

Methods

__construct()

public __construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

__isset()

public __isset(string $property) : bool
Parameters
$property : string
Return values
bool

get_instance()

Return an instance of the object which is also registered to the slplus global less the SLP_ part.

public static get_instance([bool $no_global = false ][, mixed $params = array() ]) : SLPlus_BaseClass_Object

TODO: PHP7.4 and PHP8.0 the static instance variable returns an object matching $class TODO: PHP8.1 the static instance continually returns the FIRST object (SLP_Admin_Helper) every time -- it is like PHP8.1 static instance is bound to base_class-object versus the calling class object

Parameters
$no_global : bool = false

set to true to skip assigning object to SLP global as a property.

$params : mixed = array()

object init params

Return values
SLPlus_BaseClass_Object

get_theme()

Add the theme settings to the admin panel.

public get_theme() : mixed

set_properties()

Set our properties.

public set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

initialize()

Do these things when this object is invoked. Override in your class.

protected initialize() : mixed

create_string_addon_layout()

Create the string for the theme layouts.

private create_string_addon_layout(string $slp_option_name, string $slp_option_value) : string
Parameters
$slp_option_name : string

which option name should be set by this

$slp_option_value : string

what to set this setting to

Return values
string

HTML for the hidden settings div used by JavaScript to set the options.

Get the HTML for a list of add-ons linked to their product pages.

private create_string_addon_links(array<string|int, string> $add_on_slugs) : string
Parameters
$add_on_slugs : array<string|int, string>
Return values
string

HTML for links to add-ons.

create_string_addon_packs()

Create the output string for add on packs used by themes.

private create_string_addon_packs() : string
Return values
string

createstring_ThemeDetails()

Build an HTML string to show under the theme selection box.

private createstring_ThemeDetails() : string
Return values
string

get_addons_that_provide_attribute()

Return an array of add-on slugs and field names that provide the given Plugin Style attribute.

private get_addons_that_provide_attribute(string $style_attribute) : array<string|int, mixed>|null

Preferred add-on is listed first. key = add-on slug, value = slp option (setting) field name on admin UI.

Returns null if nothing is known to provide this attribute.

Parameters
$style_attribute : string

A style attribute slug.

Return values
array<string|int, mixed>|null

A list of add-on slugs the provide the given attribute.

get_first_active_addon()

Get the first active add-on in a list of addon slugs.

private get_first_active_addon(array<string|int, string> $addon_slugs) : null
Parameters
$addon_slugs : array<string|int, string>
Return values
null

| string the string of the first add-on slug that is active.

get_slp_option_for_attribute()

Get the settings field to update based on which add-on packs are active.

private get_slp_option_for_attribute(string $style_attribute) : string
Parameters
$style_attribute : string

Which plugin style attribute are we working on?

Return values
string

get_theme_addons()

Create a list of add-on packs that this plugin style works best with.

private get_theme_addons(array<string|int, mixed> $header_data) : string
Parameters
$header_data : array<string|int, mixed>

The CSS stylesheet header info that contains the metadata.

Return values
string

Comma-separate list of the add-ons this plugin style likes to use.

get_theme_info()

Extract the label & key from a CSS file header.

private get_theme_info(string $filename) : mixed
Parameters
$filename : string
  • a fully qualified path to a CSS file
Return values
mixed
  • a named array of the data.

get_theme_list()

Get the list of themes from the options table, adding new entries from the CSS directory if files have been added.

private get_theme_list() : array<string|int, mixed>

This looks in the ./css directory for any new files. If they are newer than options_nojs['themes_last_updated'] then add them to the plugin styles array.

Return values
array<string|int, mixed>

The theme array: key = the label for the drop down, value = the value for the dropdown = base file name (no path, no suffix) : stored in option csl-slplus-theme_array.

has_theme_details()

Return true if this theme slug has details.

private has_theme_details( $theme_slug) : bool
Parameters
$theme_slug :
Return values
bool

set_layout_defaults()

Set layout defaults when not specified in the Plugin Style header.

private set_layout_defaults(array<string|int, mixed> $plugin_style_meta) : array<string|int, mixed>
Parameters
$plugin_style_meta : array<string|int, mixed>
Return values
array<string|int, mixed>

setup_ThemeDetails()

Create the details divs for the SLP styles.

private setup_ThemeDetails(array<string|int, mixed> $themeArray) : string
Parameters
$themeArray : array<string|int, mixed>
Return values
string

the div HTML


        
On this page

Search results