PHP Класс Habari\Themes

Показать файл Открыть проект

Открытые методы

Метод Описание
activate_theme ( $theme_name, $theme_dir ) function activate_theme Updates the database with the name of the new theme to use
cancel_preview ( ) Cancel the viewing of any preview theme
class_from_filename ( $file, $check_realpath = false )
create ( string $name = null, string $template_engine = null, string $theme_dir = null ) : Theme Returns a named Theme descendant.
get_active ( $nopreview = false ) : QueryRecord Returns the active theme information from the database
get_active_data ( $nopreview = false ) : array Returns theme information for the active theme -- dir, path, theme.xml, screenshot url
get_all ( ) : array Returns the theme dir and path information
get_all_data ( ) : array Returns all theme information -- dir, path, theme.xml, screenshot url
get_theme_classes ( ) : array Get a list of classes that extend Theme
get_theme_dir ( $nopreview = false ) : string Returns the name of the active or previewed theme
preview_theme ( string $theme_name, string $theme_dir ) Sets a theme to be the current user's preview theme
validate_theme ( string $theme_dir ) : boolean Ensure that a theme meets requirements for activation/preview

Приватные методы

Метод Описание
get_active_theme_dir ( $nopreview = false ) : string Returns the active theme's full directory path.
get_by_name ( $name )

Описание методов

activate_theme() публичный статический Метод

function activate_theme Updates the database with the name of the new theme to use
public static activate_theme ( $theme_name, $theme_dir )

cancel_preview() публичный статический Метод

Cancel the viewing of any preview theme
public static cancel_preview ( )

class_from_filename() публичный статический Метод

public static class_from_filename ( $file, $check_realpath = false )

create() публичный статический Метод

If no parameter is supplied, then load the active theme from the database. If no theme option is set, a fatal error is thrown
public static create ( string $name = null, string $template_engine = null, string $theme_dir = null ) : Theme
$name string ( optional ) override the default theme lookup
$template_engine string ( optional ) specify a template engine
$theme_dir string ( optional ) specify a theme directory
Результат Theme An instance of the requested theme or the default theme

get_active() публичный статический Метод

Returns the active theme information from the database
public static get_active ( $nopreview = false ) : QueryRecord
Результат QueryRecord An array of Theme data

get_active_data() публичный статический Метод

Returns theme information for the active theme -- dir, path, theme.xml, screenshot url
public static get_active_data ( $nopreview = false ) : array
Результат array An array of Theme data

get_all() публичный статический Метод

Returns the theme dir and path information
public static get_all ( ) : array
Результат array An array of Theme data

get_all_data() публичный статический Метод

Returns all theme information -- dir, path, theme.xml, screenshot url
public static get_all_data ( ) : array
Результат array An array of Theme data

get_theme_classes() публичный статический Метод

Get a list of classes that extend Theme
public static get_theme_classes ( ) : array
Результат array List of string names of classes that extend Theme

get_theme_dir() публичный статический Метод

Returns the name of the active or previewed theme
public static get_theme_dir ( $nopreview = false ) : string
Результат string the current theme or previewed theme's directory name

preview_theme() публичный статический Метод

Sets a theme to be the current user's preview theme
public static preview_theme ( string $theme_name, string $theme_dir )
$theme_name string The name of the theme to preview
$theme_dir string The directory of the theme to preview

validate_theme() публичный статический Метод

Ensure that a theme meets requirements for activation/preview
public static validate_theme ( string $theme_dir ) : boolean
$theme_dir string the directory of the theme
Результат boolean True if the theme meets all requirements