Reports

Report Plugins

You can easily write your own custom reports by extending the Model_Report class.

Report plugins are located in the following directory:

/usr/local/psa/admin/plib/modules/warden/library/application/classes/Model/Report/Plugin/

Report plugins all extend the following base class:


<?php defined('SYSPATH') or die('No direct script access.');
/**
 * Model_Report
 * @package          modules/report
 * @category         Models
 * @author           Danami
 * @copyright    (c) 2016 Danami http://www.danami.com
 */
class Model_Report extends Automodeler
{
    /**
     * Model data
     * @access    protected
     * @var    array
     */
    protected $_data = array(

        // plugin data
        'enabled'     => TRUE,
        'id'          => '',
        'title'       => '',
        'description' => '',
        'author'      => '',
        'image'       => '',
        'url'         => '',

        // report data
        'start_time'  => '',
        'end_time'    => '',
        'timespan'    => '',
        'domain_id'   => '',
        'renderer'    => '',
        'renderers'   => array(),
        'options'     => array(),
        'theme'       => array(),
        'series'      => array(),
        'output'      => '',
        'refresh'     => 0
    );

    /**
     * Loads the reports series data based of a passed in query
     * @access    public
     * @return    array
     */
    public function load_series(Database_Query_Builder_Select $query = NULL){}

    /**
     * loads the plot options based on the renderer type
     * @access    public
     * @return    void
     */
    public function options(){}

    /**
     * Get the model output
     * @access    public
     * @param     string    $id           element id
     * @param     string    $width        width of the chart (in px or %)
     * @param     string    $height       height of the chart (in px)
     * @return    string
     */
    public function output($id='chart', $width='100%', $height='325px'){} 

)
?>