Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Accounts
  • Actions
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CouponTerms
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • EmailVerifications
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • MessageGroups
  • Messages
  • MessengerManager
  • ModuleClientMeta
  • ModuleManager
  • ModuleTypes
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • ServiceInvoices
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • SystemEvents
  • Taxes
  • Themes
  • Transactions
  • Users
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Themes

Company Theme Settings

Model
Extended by AppModel uses Blesta\Core\Util\Common\Traits\Container
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
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
The theme ID of the theme to change to
$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
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
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

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
      • theme_box_shadow_color The color of shadows shown under boxes
    • 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
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
The ID of the theme to update
$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
      • theme_box_shadow_color The color of shadows shown under boxes
    • 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
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
The ID of the company to duplicate the themes from
$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
The company ID
$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, $company_id = null )

Fetches all themes in the system

Fetches all themes in the system

Parameters

$type
The type of themes to get (i.e. "admin", "client", or null for all. optional, default null)
$company_id

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
The company ID
$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

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
    • theme_box_shadow_color The color of shadows shown under boxes
  • 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
$type
The theme type ("admin" or "client", optional, default "admin")

Returns

boolean
True if the colors exist and are set, false otherwise
public array
# formatMissingColors( array $colors )

Formats the given color codes to set blank hex codes to 'transparent'

Formats the given color codes to set blank hex codes to 'transparent'

Parameters

$colors
A key/value array of admin/client colors

Returns

array
An array of updated colors
Methods inherited from AppModel
_(), boolToInt(), currencyToDecimal(), dateToUtc(), errors(), getPerPage(), ifSet(), loadCrypto(), setDefaultIfEmpty(), setPerPage(), setRulesIfSet(), strToBool(), systemDecrypt(), systemEncrypt(), systemHash(), truncateDecimal(), validateExists(), validateStateCountry()
Methods used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Properties inherited from AppModel
$logger, $replacement_keys
Blesta API documentation generated by ApiGen