PHP Class Pressbooks\Modules\ThemeOptions\GlobalOptions

Inheritance: extends Pressbooks\Options
Show file Open project: pressbooks/pressbooks

Public Properties

Property Type Description
$currentVersion integer The value for option: pressbooks_theme_options_global_version
$defaults array Global theme defaults.
$options array Global theme options.

Public Methods

Method Description
__construct ( array $options ) Constructor.
display ( ) Display the global options tab description.
doInitialUpgrade ( ) Remove deprecated keys from global options, clarify two-level TOC key name.
filterDefaults ( array $defaults ) : array Filter the array of default values for the Global options tab.
getBooleanOptions ( ) : array Get an array of options which return booleans.
getDefaults ( ) : array Get an array of default values for the global options tab.
getPredefinedOptions ( ) : array Get an array of options which return predefined values.
getSlug ( ) : string Get the slug for the global options tab.
getTitle ( ) : string Get the localized title of the global options tab.
init ( ) Configure the global options tab using the settings API.
render ( ) Render the PDF options tab form (NOT USED).
renderChapterNumbersField ( array $args ) Render the chapter_numbers checkbox.
renderCopyrightLicenseField ( array $args ) Render the copyright_license checkbox.
renderLanguagesField ( array $args ) Render the pressbooks_global_typography select.
renderTwoLevelTOCField ( array $args ) Render the parse_subsections checkbox.
sanitizeLanguages ( $input ) Sanitize the languages (just returns the array or an empty array, as these are predefined values).
upgrade ( integer $version ) Upgrade handler for global options.

Method Details

__construct() public method

Constructor.
public __construct ( array $options )
$options array

display() public method

Display the global options tab description.
public display ( )

doInitialUpgrade() public method

Remove deprecated keys from global options, clarify two-level TOC key name.
public doInitialUpgrade ( )

filterDefaults() static public method

Filter the array of default values for the Global options tab.
static public filterDefaults ( array $defaults ) : array
$defaults array
return array $defaults

getBooleanOptions() static public method

Get an array of options which return booleans.
static public getBooleanOptions ( ) : array
return array $options

getDefaults() static public method

Get an array of default values for the global options tab.
static public getDefaults ( ) : array
return array $defaults

getPredefinedOptions() static public method

Get an array of options which return predefined values.
static public getPredefinedOptions ( ) : array
return array $options

getSlug() static public method

Get the slug for the global options tab.
static public getSlug ( ) : string
return string $slug

getTitle() static public method

Get the localized title of the global options tab.
static public getTitle ( ) : string
return string $title

init() public method

Configure the global options tab using the settings API.
public init ( )

render() public method

Render the PDF options tab form (NOT USED).
public render ( )

renderChapterNumbersField() public method

Render the chapter_numbers checkbox.
public renderChapterNumbersField ( array $args )
$args array

renderCopyrightLicenseField() public method

Render the copyright_license checkbox.
public renderCopyrightLicenseField ( array $args )
$args array

renderLanguagesField() public method

Render the pressbooks_global_typography select.
public renderLanguagesField ( array $args )
$args array

renderTwoLevelTOCField() public method

Render the parse_subsections checkbox.
public renderTwoLevelTOCField ( array $args )
$args array

sanitizeLanguages() public method

Sanitize the languages (just returns the array or an empty array, as these are predefined values).
public sanitizeLanguages ( $input )

upgrade() public method

Upgrade handler for global options.
public upgrade ( integer $version )
$version integer

Property Details

$currentVersion static public property

The value for option: pressbooks_theme_options_global_version
See also: upgrade()
static public int $currentVersion
return integer

$defaults public property

Global theme defaults.
public array $defaults
return array

$options public property

Global theme options.
public array $options
return array