CMS Made Simple API

CmsLayoutCollection
in package

A class to manage a collection (or theme) of Templates and Stylesheets

Tags
license

GPL

since
2.0
author

Robert Campbell calguy1000@gmail.com

Table of Contents

Methods

add_stylesheet()  : mixed
Adds a stylesheet to the theme
add_template()  : mixed
Add a template to the list of templates associated with this theme.
delete()  : mixed
Delete the current theme This class will not allow deleting themes that still have templates associated with them.
delete_stylesheet()  : mixed
Delete a stylesheet from the list of stylesheets associated with this theme
delete_template()  : mixed
Delete a template from the list of templates associated with this theme
get_all()  : array<string|int, mixed>
Load all themes
get_created()  : int
Get the creation date of this theme The creation date is specified automatically on the first save
get_default()  : bool
Get the default flag Note, only one theme can be the default.
get_description()  : string
Get the theme description
get_id()  : int
Get the theme id Only themes that have been saved to the database have an id.
get_list()  : mixed
Get a list of designs
get_modified()  : int
Get the date of the last modification of this theme
get_name()  : string
Get the theme name
get_stylesheets()  : array<string|int, mixed>
Get the list of stylesheets (if any) associated with this theme.
get_templates()  : array<string|int, mixed>
Return a list of the template ids associated with this template
has_stylesheets()  : bool
Test if this theme has stylesheets attached to it
has_templates()  : bool
Test if this theme has templates associated with it
load()  : CmsLayoutCollection
Load a theme object
load_default()  : CmsLayoutCollection
Load the default theme
save()  : mixed
Save this theme This method will send the AddDesignPre and AddDesignPost events before and after saving a new theme and the EditDesignPre and EditDesignPost events before and after saving an existing theme.
set_default()  : mixed
Sets this theme as the default theme.
set_description()  : mixed
Set the theme description
set_name()  : mixed
Set the theme name This marks the theme as dirty
set_stylesheets()  : mixed
Set the list of stylesheets associated with this theme
set_templates()  : mixed
Set the list of templates associated with this theme
suggest_name()  : string
Given a base name, suggest a name for a copied theme
validate()  : mixed
Validate this object before saving.

Methods

add_stylesheet()

Adds a stylesheet to the theme

public add_stylesheet(mixed $css) : mixed
Parameters
$css : mixed

Either an integer stylesheet id, or a CmsLayoutStylesheet object

Tags
throws
CmsLogicException

add_template()

Add a template to the list of templates associated with this theme.

public add_template(mixed $tpl) : mixed
Parameters
$tpl : mixed

Accepts either an integer template id, or an instance of a CmsLayoutTemplate object

Tags
throws
CmsLogicException

delete()

Delete the current theme This class will not allow deleting themes that still have templates associated with them.

public delete([bool $force = FALSE ]) : mixed
Parameters
$force : bool = FALSE

Force deleting the theme even if there are templates attached

Tags
throws
CmsLogicException

delete_stylesheet()

Delete a stylesheet from the list of stylesheets associated with this theme

public delete_stylesheet(mixed $css) : mixed
Parameters
$css : mixed

Either an integer stylesheet id, or a CmsLayoutStylesheet object

Tags
throws
CmsLogicException

delete_template()

Delete a template from the list of templates associated with this theme

public delete_template(mixed $tpl) : mixed
Parameters
$tpl : mixed

Either an integer template id, or a CmsLayoutTemplate object

Tags
throws
CmsInvalidDataException

get_all()

Load all themes

public static get_all([string $quick = FALSE ]) : array<string|int, mixed>
Parameters
$quick : string = FALSE

Do not load the templates and stylesheets.

Return values
array<string|int, mixed>

Array of CmsLayoutCollection objects.

get_created()

Get the creation date of this theme The creation date is specified automatically on the first save

public get_created() : int
Return values
int

get_default()

Get the default flag Note, only one theme can be the default.

public get_default() : bool
Return values
bool

get_id()

Get the theme id Only themes that have been saved to the database have an id.

public get_id() : int
Return values
int

get_modified()

Get the date of the last modification of this theme

public get_modified() : int
Return values
int

get_stylesheets()

Get the list of stylesheets (if any) associated with this theme.

public get_stylesheets() : array<string|int, mixed>
Return values
array<string|int, mixed>

of integers

get_templates()

Return a list of the template ids associated with this template

public get_templates() : array<string|int, mixed>
Return values
array<string|int, mixed>

of integers

has_stylesheets()

Test if this theme has stylesheets attached to it

public has_stylesheets() : bool
Return values
bool

has_templates()

Test if this theme has templates associated with it

public has_templates() : bool
Return values
bool

save()

Save this theme This method will send the AddDesignPre and AddDesignPost events before and after saving a new theme and the EditDesignPre and EditDesignPost events before and after saving an existing theme.

public save() : mixed

set_default()

Sets this theme as the default theme.

public set_default(bool $flag) : mixed

Sets the dirty flag. Note, only one theme can be the default.

Parameters
$flag : bool

set_description()

Set the theme description

public set_description(string $str) : mixed
Parameters
$str : string

set_stylesheets()

Set the list of stylesheets associated with this theme

public set_stylesheets(array<string|int, mixed> $id_array) : mixed
Parameters
$id_array : array<string|int, mixed>

Array of integer stylesheet ids.

Tags
throws
CmsLogicException

set_templates()

Set the list of templates associated with this theme

public set_templates(array<string|int, mixed> $id_array) : mixed
Parameters
$id_array : array<string|int, mixed>

Array of integer template ids

Tags
throws
CmsLogicException

suggest_name()

Given a base name, suggest a name for a copied theme

public static suggest_name([string $newname = '' ]) : string
Parameters
$newname : string = ''
Return values
string

        
On this page

Search results