phpBB API Documentation
Class

acp_styles

class acp_styles

Properties

$u_action
$style_cfg
$template_cfg
$theme_cfg
$imageset_cfg
$imageset_keys

Methods

main($id, $mode)

frontend($mode, $options, $actions)

Build Frontend with supplied options

edit_template(int $template_id)

Provides a template editor which allows saving changes to template files on the filesystem or in the database.

template_cache(int $template_id)

Allows the admin to view cached versions of template files and clear single template cache files

edit_theme(int $theme_id)

Provides a css editor and a basic easier to use stylesheet editing tool for less experienced (or lazy) users

edit_imageset(int $imageset_id)

Edit imagesets

remove($mode, $style_id)

Remove style/template/theme/imageset

remove_component($component, $component_id, $new_id, $style_id = false)

Remove template/theme/imageset entry from the database

boolean display_component_options($component, $component_id, $style_row = false, $style_id = false)

Display the options which can be used to replace a style/template/theme/imageset

component_in_use($component, $component_id, $style_id = false)

Check whether the component is still used by another style or component

export($mode, $style_id)

Export style or style elements

details($mode, $style_id)

Display details

load_css_file($path, $filename)

Load css file contents

string db_theme_data(array $theme_row, mixed $stylesheet = false, string $root_path = '')

Returns a string containing the value that should be used for the theme_data column in the theme database table.

store_templates($mode, $style_id, $template_path, $filelist)

Store template files into db

array template_cache_filelist(string $template_path)

Returns an array containing all template filenames for one template that are currently cached.

clear_template_cache(array $template_row, mixed $file_ary = false)

Destroys cached versions of template files

install($mode)

Install Style/Template/Theme/Imageset

add($mode)

Add new style

test_installed($element, $error, $root_path, $reqd_name, $id, $name, $copyright)

$reqdtemplate = (isset($installcfg['requiredtemplate'])) ? $installcfg['requiredtemplate'] : false; $reqdtheme = (isset($installcfg['requiredtheme'])) ? $installcfg['requiredtheme'] : false; $reqdimageset = (isset($installcfg['requiredimageset'])) ? $installcfg['required_imageset'] : false;

install_style($error, $action, $root_path, $id, $name, $path, $copyright, $active, $default, $style_row, $template_root_path = false, $template_path = false, $theme_root_path = false, $theme_path = false, $imageset_root_path = false, $imageset_path = false)

Install/Add style

install_element($mode, $error, $action, $root_path, $id, $name, $path, $copyright, $store_db)

Install/add an element, doing various checks as we go

check_inheritance(string $mode, int $id)

Checks downwards dependencies

get_super(string $mode, int $id)

Checks upwards dependencies

store_in_db(string $mode, int $id)

Moves a template set and its subtemplates to the database

_store_in_db(string $mode, int $id, string $path)

Moves a template set to the database

store_in_fs(string $mode, int $id)

Moves a template set and its subtemplates to the filesystem

_store_in_fs(string $mode, int $id, string $path)

Moves a template set to the filesystem

Details

at line 32
public main($id, $mode)

Parameters

$id
$mode

at line 538
public frontend($mode, $options, $actions)

Build Frontend with supplied options

Parameters

$mode
$options
$actions

at line 712
public edit_template(int $template_id)

Provides a template editor which allows saving changes to template files on the filesystem or in the database.

Parameters

int $template_id specifies which template set is being edited

at line 954
public template_cache(int $template_id)

Allows the admin to view cached versions of template files and clear single template cache files

Parameters

int $template_id specifies which template's cache is shown

at line 1133
public edit_theme(int $theme_id)

Provides a css editor and a basic easier to use stylesheet editing tool for less experienced (or lazy) users

Parameters

int $theme_id specifies which theme is being edited

at line 1316
public edit_imageset(int $imageset_id)

Edit imagesets

Parameters

int $imageset_id specifies which imageset is being edited

at line 1591
public remove($mode, $style_id)

Remove style/template/theme/imageset

Parameters

$mode
$style_id

at line 1729
public remove_component($component, $component_id, $new_id, $style_id = false)

Remove template/theme/imageset entry from the database

Parameters

$component
$component_id
$new_id
$style_id

at line 1788
public boolean display_component_options($component, $component_id, $style_row = false, $style_id = false)

Display the options which can be used to replace a style/template/theme/imageset

Parameters

$component
$component_id
$style_row
$style_id

Return Value

boolean Returns true if the component is the only component and can not be deleted.

at line 1885
public component_in_use($component, $component_id, $style_id = false)

Check whether the component is still used by another style or component

Parameters

$component
$component_id
$style_id

at line 1927
public export($mode, $style_id)

Export style or style elements

Parameters

$mode
$style_id

at line 2355
public details($mode, $style_id)

Display details

Parameters

$mode
$style_id

at line 2677
public load_css_file($path, $filename)

Load css file contents

Parameters

$path
$filename

at line 2709
public string db_theme_data(array $theme_row, mixed $stylesheet = false, string $root_path = '')

Returns a string containing the value that should be used for the theme_data column in the theme database table.

Includes contents of files loaded via @import

Parameters

array $theme_row is an associative array containing the theme's current database entry
mixed $stylesheet can either be the new content for the stylesheet or false to load from the standard file
string $root_path should only be used in case you want to use a different root path than "{$phpbbrootpath}styles/{$themerow['themepath']}"

Return Value

string Stylesheet data for theme_data column in the theme table

at line 2754
public store_templates($mode, $style_id, $template_path, $filelist)

Store template files into db

Parameters

$mode
$style_id
$template_path
$filelist

at line 2836
public array template_cache_filelist(string $template_path)

Returns an array containing all template filenames for one template that are currently cached.

Parameters

string $template_path contains the name of the template's folder in /styles/

Return Value

array of filenames that exist in /styles/$template_path/template/ (without extension!)

at line 2872
public clear_template_cache(array $template_row, mixed $file_ary = false)

Destroys cached versions of template files

Parameters

array $template_row contains the template's row in the STYLESTEMPLATETABLE database table
mixed $file_ary is optional and may contain an array of template file names which should be refreshed in the cache. The file names should be the original template file names and not the cache file names.

at line 2906
public install($mode)

Install Style/Template/Theme/Imageset

Parameters

$mode

at line 3083
public add($mode)

Add new style

Parameters

$mode

at line 3252
public test_installed($element, $error, $root_path, $reqd_name, $id, $name, $copyright)

$reqdtemplate = (isset($installcfg['requiredtemplate'])) ? $installcfg['requiredtemplate'] : false; $reqdtheme = (isset($installcfg['requiredtheme'])) ? $installcfg['requiredtheme'] : false; $reqdimageset = (isset($installcfg['requiredimageset'])) ? $installcfg['required_imageset'] : false;

// Check to see if each element is already installed, if it is grab the id foreach ($elementary as $element => $table) { $stylerow = arraymerge($stylerow, array( $element . 'id' => 0, $element . 'name' => '', $element . '_copyright' => '') );

                    $this->test_installed($element, $error, $root_path, ${'reqd_' . $element}, $style_row[$element . '_id'], $style_row[$element . '_name'], $style_row[$element . '_copyright']);

Is this element installed? If not, grab its cfg details

Parameters

$element
$error
$root_path
$reqd_name
$id
$name
$copyright

at line 3307
public install_style($error, $action, $root_path, $id, $name, $path, $copyright, $active, $default, $style_row, $template_root_path = false, $template_path = false, $theme_root_path = false, $theme_path = false, $imageset_root_path = false, $imageset_path = false)

Install/Add style

Parameters

$error
$action
$root_path
$id
$name
$path
$copyright
$active
$default
$style_row
$template_root_path
$template_path
$theme_root_path
$theme_path
$imageset_root_path
$imageset_path

at line 3402
public install_element($mode, $error, $action, $root_path, $id, $name, $path, $copyright, $store_db)

Install/add an element, doing various checks as we go

Parameters

$mode
$error
$action
$root_path
$id
$name
$path
$copyright
$store_db

at line 3692
public check_inheritance(string $mode, int $id)

Checks downwards dependencies

Parameters

string $mode The element type to check - only template is supported
int $id The template id

at line 3748
public get_super(string $mode, int $id)

Checks upwards dependencies

Parameters

string $mode The element type to check - only template is supported
int $id The template id

at line 3806
public store_in_db(string $mode, int $id)

Moves a template set and its subtemplates to the database

Parameters

string $mode The component to move - only template is supported
int $id The template id

at line 3856
public _store_in_db(string $mode, int $id, string $path)

Moves a template set to the database

Parameters

string $mode The component to move - only template is supported
int $id The template id
string $path TThe path to the template files

at line 3877
public store_in_fs(string $mode, int $id)

Moves a template set and its subtemplates to the filesystem

Parameters

string $mode The component to move - only template is supported
int $id The template id

at line 3928
public _store_in_fs(string $mode, int $id, string $path)

Moves a template set to the filesystem

Parameters

string $mode The component to move - only template is supported
int $id The template id
string $path The path to the template