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

  • Plugin
  • Plugins
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Plugin

Abstract class that all Plugin handlers extend

Defines all methods plugin handlers must inherit and provides all methods common between all plugin handlers

Abstract
Package: blesta\components\plugins
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/plugins/lib/plugin.php
Methods summary
public string
# getName( )

Returns the name of this plugin

Returns the name of this plugin

Returns

string
The common name of this plugin
public string
# getDescription( )

Returns the description of this plugin

Returns the description of this plugin

Returns

string
The description of this plugin
public string
# getVersion( )

Returns the version of this plugin

Returns the version of this plugin

Returns

string
The current version of this plugin
public array
# getAuthors( )

Returns the name and URL for the authors of this plugin

Returns the name and URL for the authors of this plugin

Returns

array
The name and URL of the authors of this plugin
public
# install( integer $plugin_id )

Performs any necessary bootstraping actions

Performs any necessary bootstraping actions

Parameters

$plugin_id
The ID of the plugin being installed
public
# upgrade( string $current_version, integer $plugin_id )

Performs migration of data from $current_version (the current installed version) to the given file set version

Performs migration of data from $current_version (the current installed version) to the given file set version

Parameters

$current_version
The current installed version of this plugin
$plugin_id
The ID of plugin being upgraded
public
# uninstall( integer $plugin_id, boolean $last_instance )

Performs any necessary cleanup actions

Performs any necessary cleanup actions

Parameters

$plugin_id
The ID of the plugin being uninstalled
$last_instance

True if $plugin_id is the last instance across all companies for this plugin, false otherwise

public array
# getActions( )

Returns all actions to be configured for this widget (invoked after install() or upgrade(), overwrites all existing actions)

Returns all actions to be configured for this widget (invoked after install() or upgrade(), overwrites all existing actions)

Returns

array

A numerically indexed array containing:

  • action The action to register for
  • uri The URI to be invoked for the given action
  • name The name to represent the action (can be language definition)
  • options An array of key/value pair options for the given action
public array
# getCards( )

Returns all cards to be configured for this plugin (invoked after install() or upgrade(), overwrites all existing cards)

Returns all cards to be configured for this plugin (invoked after install() or upgrade(), overwrites all existing cards)

Returns

array

A numerically indexed array containing:

  • level The level this card should be displayed on (client or staff) (optional, default client)
  • callback An array containing the class name and method defined by the plugin class for calculating the value of the card or fetching a custom html
  • callback_type The callback type, 'value' to fetch the card value or 'html' to fetch the custom html code (optional, default value)
  • background The background color in hexadecimal or path to the background image for this card (optional)
  • background_type The background type, 'color' to set a hexadecimal background or 'image' to set an image background (optional, default color)
  • label A string or language key appearing under the value as a label
  • link The link to which the card will be pointed (optional)
  • enabled Whether this card appears on client profiles by default (1 to enable, 0 to disable) (optional, default 1)
public array
# getPermissions( )

Returns all permissions to be configured for this plugin (invoked after install(), upgrade(), and uninstall(), overwrites all existing permissions)

Returns all permissions to be configured for this plugin (invoked after install(), upgrade(), and uninstall(), overwrites all existing permissions)

Returns

array

A numerically indexed array containing:

  • group_alias The alias of the permission group this permission belongs to
  • name The name of this permission
  • alias The ACO alias for this permission (i.e. the Class name to apply to)
  • action The action this ACO may control (i.e. the Method name of the alias to control access for)
public array
# getPermissionGroups( )

Returns all permission groups to be configured for this plugin (invoked after install(), upgrade(), and uninstall(), overwrites all existing permission groups)

Returns all permission groups to be configured for this plugin (invoked after install(), upgrade(), and uninstall(), overwrites all existing permission groups)

Returns

array

A numerically indexed array containing:

  • name The name of this permission group
  • level The level this permission group resides on (staff or client)
  • alias The ACO alias for this permission group (i.e. the Class name to apply to)
public array
# getEvents( )

Returns all events to be registered for this plugin (invoked after install() or upgrade(), overwrites all existing events)

Returns all events to be registered for this plugin (invoked after install() or upgrade(), overwrites all existing events)

Returns

array

A numerically indexed array containing:

  • event The event to register for
  • callback A string or array representing a callback function or class/method. If a user (e.g. non-native PHP) function or class/method, the plugin must automatically define it when the plugin is loaded. To invoke an instance methods pass "this" instead of the class name as the 1st callback element.
public array
# getMessageTemplates( )

Returns all messages to be configured for this plugin (invoked after install() or upgrade(), overwrites all existing messages)

Returns all messages to be configured for this plugin (invoked after install() or upgrade(), overwrites all existing messages)

Returns

array

A numerically indexed array containing:

  • action The name of the action that triggers the message
  • type The level of the message ('staff', 'client', 'shared')
  • tags A comma separated list of replacement tags (e.g. {client},{service.name})
  • content A key/value list of messenger types and their default content ()
public array
# getAdminServiceTabs( stdClass $service )

Returns all tabs to display to an admin when managing a service

Returns all tabs to display to an admin when managing a service

Parameters

$service
An stdClass object representing the selected service

Returns

array

An array of tabs in the format of method => array where array contains:

  • name (required) The name of the link
  • href (optional) use to link to a different URL Example: array('methodName' => "Title", 'methodName2' => "Title2") array('methodName' => array('name' => "Title", 'href' => "https://blesta.com"))
public array
# getClientServiceTabs( stdClass $service )

Returns all tabs to display to a client when managing a service

Returns all tabs to display to a client when managing a service

Parameters

$service
A stdClass object representing the selected package

Returns

array

An array of tabs in the format of method => array where array contains:

  • name (required) The name of the link
  • icon (optional) use to display a custom icon
  • href (optional) use to link to a different URL Example: array('methodName' => "Title", 'methodName2' => "Title2") array('methodName' => array('name' => "Title", 'icon' => "icon"))
public boolean
# allowsServiceTabs( )

Returns whether this plugin provides support for setting admin or client service tabs

Returns whether this plugin provides support for setting admin or client service tabs

Returns

boolean
True if the plugin supports service tabs, or false otherwise

See

Plugin::getAdminServiceTabs()
Plugin::getClientServiceTabs()
public string
# getLogo( )

Returns the relative path from this plugin's directory to the logo for this plugin. Defaults to views/default/images/logo.png

Returns the relative path from this plugin's directory to the logo for this plugin. Defaults to views/default/images/logo.png

Returns

string
The relative path to the plugin's logo
public
# cron( string $key )

Runs the cron task identified by the key used to create the cron task

Runs the cron task identified by the key used to create the cron task

Parameters

$key
The key used to create the cron task

See

CronTasks::add()
public mixed
# errors( )

Return all validation errors encountered

Return all validation errors encountered

Returns

mixed
Boolean false if no errors encountered, an array of errors otherwise
final protected
# setMessage( string $type, string $message )

Sets a message

Sets a message

Parameters

$type
The type of message ('success', 'error", or 'notice')
$message
The message text to display
final public array
# getMessages( )

Retrieves a set of messages set by the module

Retrieves a set of messages set by the module

Returns

array
An array of messages
protected
# loadConfig( string $file )

Loads a given config file

Loads a given config file

Parameters

$file
The full path to the config file to load
Properties summary
protected stdClass $config

A stdClass object representing the configuration for this plugin

A stdClass object representing the configuration for this plugin

#
Blesta API documentation generated by ApiGen