Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Accounts
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • ModuleManager
  • Navigation
  • PackageGroups
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • Taxes
  • Themes
  • Transactions
  • Users

Class Themes

Company Theme Settings

Model
Extended by AppModel
Extended by Themes
Package: blesta\app\models
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/themes.php

Methods summary

public
# __construct( )

Initialize Themes

Initialize Themes

Overrides

AppModel::__construct
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

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
# add( array $vars )

Adds a theme to this company

Adds a theme to this company

Parameters

$vars
integer
$theme_id The ID of the theme to update
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_page_title_button_background_color_top The page title button background hex code for the top gradient - theme_page_title_button_background_color_bottom The page title button background hex code for the bottom gradient - 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_link_color General links hex code - theme_link_settings_color The settings links 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 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 )

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)

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
public boolean
# validateColorsSet( array $colors, string $type = "admin" )

Validates that the given theme $colors exist and are set

Validates that the given theme $colors exist and are set

Parameters

$colors
array
$colors An array of colors 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_page_title_button_background_color_top The page title button background hex code for the top gradient - theme_page_title_button_background_color_bottom The page title button background hex code for the bottom gradient - 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_link_color General links hex code - theme_link_settings_color The settings links hex code
$type
string
$type The theme type ("admin" or "client", optional, default "admin")

Returns

boolean
True if the colors exist and are set, false otherwise
private boolean
# validateHexCode( string $hex_code )

Validates that the given string is a valid 6-character hex code

Validates that the given string is a valid 6-character hex code

Parameters

$hex_code
string
$hex_code A hex color code

Returns

boolean
True if the given hex code is a valid 6-character hex code, or false otherwise
private stdClass
# formatData( stdClass $theme )

Formats the given theme's serialized and encoded data into useful fields

Formats the given theme's serialized and encoded data into useful fields

Parameters

$theme
stdClass
$theme An stdClass representing the theme

Returns

stdClass
An updated theme object
private array
# getRules( array $vars = array(), boolean $edit = false )

Retrieves a list of rules for adding/editing/deleting a theme

Retrieves a list of rules for adding/editing/deleting a theme

Parameters

$vars
array
$vars A list of input vars for use with the rules
$edit
boolean
$edit True when editing a theme, false when adding

Returns

array
The rules for adding or editing a theme

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

private Available $staff_theme_colors
#

Staff Theme color fields. Each array VALUE must be unique

Staff Theme color fields. Each array VALUE must be unique

private Available $client_theme_colors
#

Client Theme color fields. Each array value must be unique

Client Theme color fields. Each array value must be unique

Properties inherited from AppModel

$replacement_keys

Blesta API documentation generated by ApiGen 2.8.0