Class Themes
	
	
		- 
			Model
			
			
			
		
- 
			 AppModel AppModel
- 
			 Themes 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
						$typestring$type The type of theme colors to fetch (i.e. "admin" or "client", optional,
default "admin")
Returns
						arrayA 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
						$idinteger$id The theme ID of the theme to change to
$typestring$type The theme type ("admin" or "client", optional, default "admin")
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			get( integer $id )
				
Fetches a specific theme Parameters
						$idinteger$id The theme ID
Returns
						mixedAn 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
						$typestring$type The type of theme to fetch ("admin", or "client"; optional, default
"admin")
Returns
						mixedAn 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
						$varsarray$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_idinteger$company_id The ID of the company to add this theme to (optional, defaults to
the current company)
Returns
						integerThe 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_idinteger$theme_id The ID of the theme to update
$varsarray$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_idinteger$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_idinteger$from_company_id The ID of the company to duplicate the themes from
$to_company_idinteger$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_idinteger$company_id The company ID
$typestring$type The type of theme to fetch (i.e. "admin" or "client", optional, default
"admin")
Returns
						mixedAn 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
						$typestring$type The type of themes to get (i.e. "admin", "client", or null for all.
optional, default null)
$company_idmixed$company_id The ID of the company whose themes to fetch (optional, defaults to
the current company's themes)
Returns
						arrayAn 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
						arrayA 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_idinteger$company_id The company ID
$theme_idinteger$theme_id The theme ID
Returns
						booleanTrue 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