Static Public Member Functions

Themes Class Reference

List of all members.

Static Public Member Functions

static get_all ()
static get_all_data ()
static get_theme_dir ($nopreview=false)
static get_active ($nopreview=false)
static get_active_data ($nopreview=false)
static validate_theme ($theme_dir)
static activate_theme ($theme_name, $theme_dir)
static preview_theme ($theme_name, $theme_dir)
static cancel_preview ()
static create ($name=null, $template_engine=null, $theme_dir=null)
static class_from_filename ($file, $check_realpath=false)
static get_theme_classes ()

Detailed Description

Habari Themes class

Definition at line 13 of file themes.php.


Member Function Documentation

static Themes::activate_theme ( theme_name,
theme_dir 
) [static]

function activate_theme Updates the database with the name of the new theme to use

Parameters:
string the name of the theme

Definition at line 216 of file themes.php.

Referenced by AdminThemesHandler::get_activate_theme().

static Themes::cancel_preview (  )  [static]

Cancel the viewing of any preview theme

Definition at line 270 of file themes.php.

Referenced by activate_theme(), and AdminThemesHandler::get_preview_theme().

static Themes::create ( name = null,
template_engine = null,
theme_dir = null 
) [static]

Returns a named Theme descendant. If no parameter is supplied, then load the active theme from the database.

If no theme option is set, a fatal error is thrown

Parameters:
string $name ( optional ) override the default theme lookup
string $template_engine ( optional ) specify a template engine
string $theme_dir ( optional ) specify a theme directory
Returns:
Theme An instance of the requested theme or the default theme

Definition at line 294 of file themes.php.

Referenced by AdminHandler::__construct(), FeedbackHandler::act_add_comment(), InstallHandler::act_begin_install(), activate_theme(), FeedbackHandler::add_comment(), cancel_preview(), UserHandler::login_form(), preview_theme(), AdminHandler::setup_admin_theme(), and ActionHandler::setup_theme().

static Themes::get_active ( nopreview = false  )  [static]

Returns the active theme information from the database boolean $nopreview If true, return the real active theme, not the preview

Returns:
QueryRecord An array of Theme data

Definition at line 141 of file themes.php.

Referenced by create().

static Themes::get_active_data ( nopreview = false  )  [static]

Returns theme information for the active theme -- dir, path, theme.xml, screenshot url boolean $nopreview If true, return the real active theme, not the preview

Returns:
array An array of Theme data

Definition at line 170 of file themes.php.

Referenced by AdminThemesHandler::ajax_add_block(), AdminThemesHandler::ajax_delete_block(), AdminThemesHandler::ajax_save_areas(), AdminPluginsHandler::get_plugins(), and AdminThemesHandler::get_themes().

static Themes::get_all (  )  [static]

Returns the theme dir and path information

Returns:
array An array of Theme data

Definition at line 22 of file themes.php.

static Themes::get_all_data (  )  [static]

Returns all theme information -- dir, path, theme.xml, screenshot url

Returns:
array An array of Theme data

Definition at line 45 of file themes.php.

Referenced by get_active_data(), InstallHandler::get_themes(), AdminThemesHandler::get_themes(), and validate_theme().

static Themes::get_theme_classes (  )  [static]

Get a list of classes that extend Theme

Returns:
array List of string names of classes that extend Theme

Definition at line 422 of file themes.php.

static Themes::get_theme_dir ( nopreview = false  )  [static]

Returns the name of the active or previewed theme

boolean $nopreview If true, return the real active theme, not the preview

Returns:
string the current theme or previewed theme's directory name

Definition at line 91 of file themes.php.

Referenced by Site::get_dir(), Site::get_path(), AdminThemesHandler::get_preview_theme(), AdminThemesHandler::get_themes(), and Site::get_url().

static Themes::preview_theme ( theme_name,
theme_dir 
) [static]

Sets a theme to be the current user's preview theme

Parameters:
string $theme_name The name of the theme to preview
string $theme_dir The directory of the theme to preview

Definition at line 251 of file themes.php.

Referenced by AdminThemesHandler::get_preview_theme().

static Themes::validate_theme ( theme_dir  )  [static]

Ensure that a theme meets requirements for activation/preview

Parameters:
string $theme_dir the directory of the theme
Returns:
bool True if the theme meets all requirements

Definition at line 184 of file themes.php.

Referenced by activate_theme(), and preview_theme().


The documentation for this class was generated from the following file: