<?php
/**
 * #4023
 * Advanced reports dashboard widget
 */

include_once "modules/AdvancedReports/controllers/ARReportController.php";

$controller = new ARReportController();
$controller->widget($_REQUEST);

$smarty = $this->getViewer($request);
$smarty->force_compile = true; // Disable smarty caching
$smarty->caching = 0; // Disable smarty caching

foreach($controller->getViewMapping() as $key => $value) {
    $smarty->assign($key, $value);
}

$templateFilePath = 'modules/AdvancedReports/widget.tpl';
$smarty->clear_cache($templateFilePath);  // Clear template file cache
$smarty->display($templateFilePath);
