PKPUsageStatsPlugin::statisticsDisplayCallback PHP 메소드

statisticsDisplayCallback() 공개 메소드

This is temporarily unused. When backend display of statistics is implemented it may be useful.
public statisticsDisplayCallback ( $hookName, $params ) : boolean
$hookName string
$params
리턴 boolean
    function statisticsDisplayCallback($hookName, $params)
    {
        $smarty =& $params[1];
        $output =& $params[2];
        $pubObjectId = $this->getPubObjectId($smarty);
        list($statsByRepresentation, $statsByMonth, $statsYears) = $this->_getDownloadStats($pubObjectId);
        $smarty->assign('statsYears', $statsYears);
        end($statsYears);
        $smarty->assign('year', key($statsYears));
        $smarty->assign('statistics', json_encode(array('byRepresentation' => $statsByRepresentation, 'byMonth' => $statsByMonth)));
        $smarty->assign('labels', json_encode(explode(' ', __('plugins.generic.usageStats.monthInitials'))));
        $smarty->assign('chartType', $this->getSetting(CONTEXT_ID_NONE, 'chartType'));
        $smarty->assign('datasetMaxCount', $this->getSetting(CONTEXT_ID_NONE, 'datasetMaxCount'));
        $metricsHTML = $smarty->fetch($this->getTemplatePath(true) . 'outputBackend.tpl');
        $output .= $metricsHTML;
        return false;
    }