PHP Class PMA\libraries\Theme

Show file Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Properties

Property Type Description
$filesize_info needed because sometimes, the mtime for different themes is identical
$id theme id
$img_path image path
$mtime_info last modification time for info file
$name theme name
$path theme path
$version theme version

Public Methods

Method Description
checkImgPath ( ) : boolean checks image path for existence - if not found use img from fallback theme
checkVersion ( string $version ) : boolean checks theme version against $version returns true if theme version is equal or higher to $version
getCssGradient ( string $start_color, string $end_color ) : string Generates code for CSS gradient using various browser extensions.
getFontSize ( ) : String Gets currently configured font size.
getId ( ) : string returns id
getImgPath ( string $file = null ) : string Returns the path to image for the theme.
getLayoutFile ( ) : string returns layout file
getName ( ) : string returns name
getPath ( ) : string returns path to theme
getPrintPreview ( ) : string Renders the preview for this theme
getSpriteData ( ) : array Loads sprites data
getVersion ( ) : string returns version
load ( string $folder ) : Theme | false returns theme object loaded from given folder or false if theme is invalid
loadCss ( ) : boolean load css (send to stdout, normally the browser)
loadInfo ( ) : boolean Loads theme information
setId ( string $id ) : void sets id
setImgPath ( string $path ) : void Sets path to images for the theme
setName ( string $name ) : void sets name
setPath ( string $path ) : void set path to theme
setVersion ( string $version ) : void sets version

Method Details

checkImgPath() public method

checks image path for existence - if not found use img from fallback theme
public checkImgPath ( ) : boolean
return boolean

checkVersion() public method

checks theme version against $version returns true if theme version is equal or higher to $version
public checkVersion ( string $version ) : boolean
$version string version to compare to
return boolean true if theme version is equal or higher to $version

getCssGradient() public method

Generates code for CSS gradient using various browser extensions.
public getCssGradient ( string $start_color, string $end_color ) : string
$start_color string Color of gradient start, hex value without #
$end_color string Color of gradient end, hex value without #
return string CSS code.

getFontSize() public method

Gets currently configured font size.
public getFontSize ( ) : String
return String with font size.

getId() public method

returns id
public getId ( ) : string
return string id

getImgPath() public method

If filename is given, it possibly fallbacks to fallback theme for it if image does not exist.
public getImgPath ( string $file = null ) : string
$file string file name for image
return string image path for this theme

getLayoutFile() public method

returns layout file
public getLayoutFile ( ) : string
return string layout file

getName() public method

returns name
public getName ( ) : string
return string name

getPath() public method

returns path to theme
public getPath ( ) : string
return string path to theme

getPrintPreview() public method

Renders the preview for this theme
public getPrintPreview ( ) : string
return string

getSpriteData() public method

Loads sprites data
public getSpriteData ( ) : array
return array with sprites

getVersion() public method

returns version
public getVersion ( ) : string
return string version

load() public static method

returns theme object loaded from given folder or false if theme is invalid
public static load ( string $folder ) : Theme | false
$folder string path to theme
return Theme | false

loadCss() public method

load css (send to stdout, normally the browser)
public loadCss ( ) : boolean
return boolean

loadInfo() public method

Loads theme information
public loadInfo ( ) : boolean
return boolean whether loading them info was successful or not

setId() public method

sets id
public setId ( string $id ) : void
$id string new id
return void

setImgPath() public method

Sets path to images for the theme
public setImgPath ( string $path ) : void
$path string path to images for this theme
return void

setName() public method

sets name
public setName ( string $name ) : void
$name string name to set
return void

setPath() public method

set path to theme
public setPath ( string $path ) : void
$path string path to theme
return void

setVersion() public method

sets version
public setVersion ( string $version ) : void
$version string version to set
return void

Property Details

$filesize_info public property

needed because sometimes, the mtime for different themes is identical
public $filesize_info

$id public property

theme id
public $id

$img_path public property

image path
public $img_path

$mtime_info public property

last modification time for info file
public $mtime_info

$name public property

theme name
public $name

$path public property

theme path
public $path

$version public property

theme version
public $version