Class Themes
-
Model
-
AppModel
-
Themes
Methods summary
public
|
#
__construct( )
Initialize Themes
Overrides
|
public
array
|
#
getAvailableColors( string $type = "admin" )
Retrieves a list of available theme color keys
Retrieves a list of available theme color keys
Parameters
- $type
string $type The type of theme colors to fetch (i.e. "admin" or "client", optional,
default "admin")
Returns
array A list of available theme color keys
|
public
|
#
change( integer $id, string $type = "admin" )
Changes the theme to another theme for the given company
Changes the theme to another theme for the given company
Parameters
- $id
integer $id The theme ID of the theme to change to
- $type
string $type The theme type ("admin" or "client", optional, default "admin")
|
public
mixed
|
#
get( integer $id )
Fetches a specific theme
Parameters
- $id
integer $id The theme ID
Returns
mixed An stdClass object representing the theme, or false if no results.
|
public
mixed
|
#
getDefault( string $type = "admin" )
Fetches the default theme of the given type (limit 1)
Fetches the default theme of the given type (limit 1)
Parameters
- $type
string $type The type of theme to fetch ("admin", or "client"; optional, default
"admin")
Returns
mixed An stdClass object representing the default theme of the given type, or false if
none exist
|
public
integer
|
#
add( array $vars, integer $company_id = null )
Adds a theme to this company
Adds a theme to this company
Parameters
- $vars
array $vars An array of theme info including: - name The name of the theme - logo_url
The URL to the header logo - type The type of theme ("admin", or "client") -
colors An array of color fields dependent on vars type, including: Type 'admin':
- theme_header_bg_color_top The header background hex code for the top gradient
- theme_header_bg_color_bottom The header background hex code for the bottom
gradient - theme_header_text_color The header text hex code -
theme_navigation_background_color_top The header navigation background hex code
top gradient - theme_navigation_background_color_bottom The header navigation
background hex code bottom gradient - theme_navigation_text_color The header
navigation text hex code - theme_navigation_text_hover_color The header
navigation text hex code on hover - theme_subnavigation_bg_color_top The header
subnavigation background color top gradient -
theme_subnavigation_bg_color_bottom The header subnavigation background color
bottom gradient - theme_subnavigation_text_color The header subnavigation text
color - theme_subnavigation_text_active_color The header subnavigation text
active color - theme_widget_heading_bg_color_top The widget heading background
color top gradient - theme_widget_heading_bg_color_bottom The widget heading
background color bottom gradient - theme_widget_icon_heading_bg_color_top The
widget heading icon background color top gradient -
theme_widget_icon_heading_bg_color_bottom The widget heading icon background
color bottom gradient - theme_box_text_color General box hex code -
theme_text_shadow General text shadow hex code - theme_actions_text_color
General links hex code - theme_highlight_bg_color General text
highlight/active-link hex code Type 'client': - theme_header_bg_color_top The
header background hex code for the top gradient - theme_header_bg_color_bottom
The header background hex code for the bottom gradient -
theme_page_title_background_color_top The page title background hex code for the
top gradient - theme_page_title_background_color_bottom The page title
background hex code for the bottom gradient - theme_page_title_text_color The
text color hex code for the page title - theme_navigation_background_color_top
The navigation background hex code for the top gradient -
theme_navigation_background_color_bottom The navigation background hex code for
the bottom gradient - theme_navigation_text_color The hex code for the
navigation text - theme_navigation_text_active_color The hex code for the
navigation text when active - theme_page_background_color The page background
hex code - theme_panel_header_background_color_top The page content header
background hex code for the top gradient -
theme_panel_header_background_color_bottom The page content header background
hex code for the bottom gradient - theme_panel_header_text_color The text color
of the page content header - theme_link_color General links hex code -
theme_link_settings_color The settings links hex code -
theme_highlight_hover_color General text highlight/hover hex code
- $company_id
integer $company_id The ID of the company to add this theme to (optional, defaults to
the current company)
Returns
integer The ID of the theme added
|
public
|
#
edit( integer $theme_id, array $vars )
Updates a theme belonging to this company
Updates a theme belonging to this company
Parameters
- $theme_id
integer $theme_id The ID of the theme to update
- $vars
array $vars An array of theme info including: - name The name of the theme - logo_url
The URL to the header logo - type The type of theme ("admin", "client") - colors
An array of color fields including: Type 'admin': - theme_header_bg_color_top
The header background hex code for the top gradient -
theme_header_bg_color_bottom The header background hex code for the bottom
gradient - theme_header_text_color The header text hex code -
theme_navigation_background_color_top The header navigation background hex code
top gradient - theme_navigation_background_color_bottom The header navigation
background hex code bottom gradient - theme_navigation_text_color The header
navigation text hex code - theme_navigation_text_hover_color The header
navigation text hex code on hover - theme_subnavigation_bg_color_top The header
subnavigation background color top gradient -
theme_subnavigation_bg_color_bottom The header subnavigation background color
bottom gradient - theme_subnavigation_text_color The header subnavigation text
color - theme_subnavigation_text_active_color The header subnavigation text
active color - theme_widget_heading_bg_color_top The widget heading background
color top gradient - theme_widget_heading_bg_color_bottom The widget heading
background color bottom gradient - theme_widget_icon_heading_bg_color_top The
widget heading icon background color top gradient -
theme_widget_icon_heading_bg_color_bottom The widget heading icon background
color bottom gradient - theme_box_text_color General box hex code -
theme_text_shadow General text shadow hex code - theme_actions_text_color
General links hex code - theme_highlight_bg_color General text
highlight/active-link hex code Type 'client': - theme_header_bg_color_top The
header background hex code for the top gradient - theme_header_bg_color_bottom
The header background hex code for the bottom gradient -
theme_page_title_background_color_top The page title background hex code for the
top gradient - theme_page_title_background_color_bottom The page title
background hex code for the bottom gradient - theme_page_title_text_color The
text color hex code for the page title - theme_navigation_background_color_top
The navigation background hex code for the top gradient -
theme_navigation_background_color_bottom The navigation background hex code for
the bottom gradient - theme_navigation_text_color The hex code for the
navigation text - theme_navigation_text_active_color The hex code for the
navigation text when active - theme_page_background_color The page background
hex code - theme_panel_header_background_color_top The page content header
background hex code for the top gradient -
theme_panel_header_background_color_bottom The page content header background
hex code for the bottom gradient - theme_panel_header_text_color The text color
of the page content header - theme_link_color General links hex code -
theme_link_settings_color The settings links hex code -
theme_highlight_hover_color General text highlight/hover hex code
|
public
|
#
delete( integer $theme_id )
Deletes a theme belonging to this company
Deletes a theme belonging to this company
Parameters
- $theme_id
integer $theme_id The theme ID of the theme to delete
|
public
|
#
cloneThemes( integer $from_company_id, integer $to_company_id )
Clones the themes from one company and adds them to another
Clones the themes from one company and adds them to another
Parameters
- $from_company_id
integer $from_company_id The ID of the company to duplicate the themes from
- $to_company_id
integer $to_company_id The ID of the company to add the themes to
|
public
mixed
|
#
getCurrent( integer $company_id, string $type = "admin" )
Fetches the current theme in use by a given company. The theme is inherited
in the order of company settings -> system settings where "->" represents
the left item inheriting (and overwriting in the case of duplicates) values
found in the right item.
Fetches the current theme in use by a given company. The theme is inherited
in the order of company settings -> system settings where "->" represents
the left item inheriting (and overwriting in the case of duplicates) values
found in the right item.
Parameters
- $company_id
integer $company_id The company ID
- $type
string $type The type of theme to fetch (i.e. "admin" or "client", optional, default
"admin")
Returns
mixed An array of objects containg key/values for the theme, false if no records found
|
public
array
|
#
getAll( string $type = null, mixed $company_id = null )
Fetches all themes in the system
Fetches all themes in the system
Parameters
- $type
string $type The type of themes to get (i.e. "admin", "client", or null for all.
optional, default null)
- $company_id
mixed $company_id The ID of the company whose themes to fetch (optional, defaults to
the current company's themes)
Returns
array An array of stdClass objects representing each theme
|
public
array
|
#
getTypes( )
Retrieves a list of the theme types and their language
Retrieves a list of the theme types and their language
Returns
array A key/value list of theme types and their language
|
public
boolean
|
#
validateCompanySet( integer $company_id, integer $theme_id )
Validates that the given $company_id belongs to the given theme
Validates that the given $company_id belongs to the given theme
Parameters
- $company_id
integer $company_id The company ID
- $theme_id
integer $theme_id The theme ID
Returns
boolean True if the given company ID belongs to the given theme, or false otherwise
|
Methods inherited from AppModel
_()
,
boolToInt()
,
currencyToDecimal()
,
dateToUtc()
,
errors()
,
getPerPage()
,
ifSet()
,
loadCrypto()
,
setDefaultIfEmpty()
,
setPerPage()
,
setRulesIfSet()
,
strToBool()
,
systemDecrypt()
,
systemEncrypt()
,
systemHash()
,
truncateDecimal()
,
validateExists()
,
validateStateCountry()
Methods inherited from Model
affectedRows()
,
begin()
,
commit()
,
getConnection()
,
lastInsertId()
,
makeDSN()
,
prepare()
,
query()
,
rollBack()
,
setAttribute()
,
setFetchMode()
Magic methods summary
Properties summary
Properties inherited from AppModel
$replacement_keys