Toolbar Service - mithra62/ee_debug_toolbar GitHub Wiki

The Toolbar Service is a traditional ExpressionEngine Service to help you in manipulating the Toolbar.

Toolbar

The Toolbar library is loaded just like any other CodeIgniter library.

Example

$toolbar =  ee('ee_debug_toolbar:ToolbarService');
$toolbar->getSettings();

Methods

Below are the available methods to you.

getSettings()

getSettings()
  • return - Array

Returns the EEDT Settings

setupFiles()

setupFiles(array $files)
  • $files - The files for the Files Toolbar
  • return - Array

Takes the included files and breaks up into mutli arrays for use in EEDT view

setupQueries()

setupQueries()
  • return - Array

Sets up the ExpressionEngine SQL output for use in EEDT view

setupBenchmarks()

setupBenchmarks()
  • return - Array

Sets up the ExpressionEngine Benchmark output for use in EEDT view

formatTmplLog()

formatTmplLog(array $log)
  • $log - The ExpressionEngine Template Log
  • return - Array

Takes the ExpressionEngine Template Log and breaks it up for use in EEDT view and Graph JSON

formatTmplChartJson()

formatTmplChartJson(array $data)
  • $data - The ExpressionEngine Template Log data
  • return - Array

Creates the specialized array for the Template Graph and returns the JSON

filesizeFormat()

filesizeFormat($val, $digits = 3, $mode = "SI", $bB = "B")
  • $val - The number, in bytes, you want to format
  • $digits - The amount of decimal points to contain
  • return - String

Formats the given $val to a filesize

getThemes()

getThemes()
  • return - Array

Checks the system for the available themes and sets up as $key => $value array

createThemeUrl

createThemeUrl($theme, $sub_dir = '')
  • $theme - The theme directory name you want
  • $sub_dir - Any sub directory to append
  • return - String

Creates the Theme asset URLs

fetchActionId

fetchActionId($class, $method)
  • $class - Module class name
  • $method - Class method
  • return - Int

Returns the ACT for the given params

getActionUrl

getActionUrl($method, $class = 'Ee_debug_toolbar')
  • $method - Module method name
  • $class - Class name
  • return - string

Returns the action URL for the given parameters

createActUrl

createActUrl($act_method, $act_class = 'Ee_debug_toolbar_ext')
  • $act_method - Module method name
  • $act_class - Class name
  • return - string

Creates the URL for the EEDT ACT router for use by extensions

cachePanels

cachePanels(array $panels, $path)
  • $panels - Array of the complete panel data
  • $path - Path to save the XML file
  • return - Null

Takes the panel data and writes them to $path

makeCacheFilename

makeCacheFilename()
  • return - String

Creates the Toolbar panel cache filename

jsConfig

jsConfig($vars = array())
  • $vars - The JS object used for creating the graph
  • return - String

Builds the JS Config to be output as JSON