PHP Class PMA\libraries\ThemeManager

Show file Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Properties

Property Type Description
$active_theme name of active theme
$cookie_name cookie name
$per_server boolean
$theme Theme active theme
$theme_default string
$themes available themes

Public Methods

Method Description
__construct ( ) Constructor for Theme Manager class
checkConfig ( ) : void Checks configuration
checkTheme ( string $theme ) : boolean checks if given theme name is a known theme
getFallBackTheme ( ) : Theme returns Theme object for fall back theme
getHtmlSelectBox ( boolean $form = true ) : string returns HTML selectbox, with or without form enclosed
getInstance ( ) : Response Returns the singleton Response object
getPrintPreviews ( ) : string Renders the previews for all themes
getThemeCookie ( ) : string returns name of theme stored in the cookie
getThemeCookieName ( ) : string Returns name for storing theme
init ( ) : void Initialise the class
initializeTheme ( ) : void Theme initialization
loadThemes ( ) : boolean read all themes
makeBc ( ) : void enables backward compatibility
printCss ( ) : boolean prints css data
setActiveTheme ( string $theme = null ) : boolean Sets active theme
setThemeCookie ( ) : boolean save theme in cookie
setThemePerServer ( boolean $per_server ) : void sets if there are different themes per server
setThemesPath ( string $path ) : boolean sets path to folder containing the themes

Private Methods

Method Description
_checkThemeFolder ( string $folder ) : boolean Checks whether folder is valid for storing themes

Method Details

__construct() public method

Constructor for Theme Manager class
public __construct ( )

checkConfig() public method

Checks configuration
public checkConfig ( ) : void
return void

checkTheme() public method

checks if given theme name is a known theme
public checkTheme ( string $theme ) : boolean
$theme string name fo theme to check for
return boolean

getFallBackTheme() public method

returns Theme object for fall back theme
public getFallBackTheme ( ) : Theme
return Theme fall back theme

getHtmlSelectBox() public method

returns HTML selectbox, with or without form enclosed
public getHtmlSelectBox ( boolean $form = true ) : string
$form boolean whether enclosed by from tags or not
return string

getInstance() public static method

Returns the singleton Response object
public static getInstance ( ) : Response
return Response object

getPrintPreviews() public method

Renders the previews for all themes
public getPrintPreviews ( ) : string
return string

getThemeCookie() public method

returns name of theme stored in the cookie
public getThemeCookie ( ) : string
return string theme name from cookie

getThemeCookieName() public method

Returns name for storing theme
public getThemeCookieName ( ) : string
return string cookie name

init() public method

Initialise the class
public init ( ) : void
return void

initializeTheme() public static method

Theme initialization
public static initializeTheme ( ) : void
return void

loadThemes() public method

read all themes
public loadThemes ( ) : boolean
return boolean true

makeBc() public method

enables backward compatibility
public makeBc ( ) : void
return void

printCss() public method

prints css data
public printCss ( ) : boolean
return boolean

setActiveTheme() public method

Sets active theme
public setActiveTheme ( string $theme = null ) : boolean
$theme string theme name
return boolean true on success

setThemeCookie() public method

save theme in cookie
public setThemeCookie ( ) : boolean
return boolean true

setThemePerServer() public method

sets if there are different themes per server
public setThemePerServer ( boolean $per_server ) : void
$per_server boolean Whether to enable per server flag
return void

setThemesPath() public method

sets path to folder containing the themes
public setThemesPath ( string $path ) : boolean
$path string path to themes folder
return boolean success

Property Details

$active_theme public property

name of active theme
public $active_theme

$per_server public property

public bool $per_server
return boolean

$theme public property

Theme active theme
public $theme

$theme_default public property

public string $theme_default
return string

$themes public property

available themes
public $themes