public function getWarningItemView( $node, $item, $options = array() ) {
     $report = new stdClass();
     $report->title = $node->title;
     $report->nid = $node->nid;
     $report->language = $node->language;
     $ReportConfig = GD_ReportConfigFactory::getInstance()->getConfig($report);
     $ReportConfig->setDisplaySize($item->size->width,$item->size->height);
     $ReportView = new GD_ReportView($ReportConfig);
     return $ReportView->getWarningView($options);
 }
/**
 * @param $dashboardNode
 * @return string
 */
function gd_dashboard_page_public_report_export ( $dashboardNode ) {
    try {
        if ( !gd_dashboard_access_view($dashboardNode) ) {
            return MENU_ACCESS_DENIED;
        }

        $config = variable_get('gd_report_config', array('export' => 0, 'print' => 0));
        $type = $_REQUEST['type'] . (isset($_REQUEST['raw']) ? '_raw' : '');
        $reportNid = $_REQUEST['report'];
        $viewFormat = null;

        if ($config['export'] == 0 || !isset($config[$type]) || $config[$type] == 0) {
            return MENU_ACCESS_DENIED;
        }

        $reportNode = gd_report_load($reportNid);
        if (!$reportNode) {
            return MENU_NOT_FOUND;
        }

        $ReportConfig = GD_ReportConfigFactory::getInstance()->getConfig($reportNode);

        // apply dashboard config, which is mainly filters
        $DashboardConfig = new GD_DashboardConfig($dashboardNode, $_REQUEST);
        $DashboardConfig->updateReportConfig($ReportConfig);

        switch ( $type ) {
            case 'xls':
            case 'xls_raw':
                $data = $ReportConfig->getExport(isset($_REQUEST['raw']));
                $viewFormat = new GD_ServicesViewFormat_Excel('public', $reportNid);
                break;

            case 'csv':
            case 'csv_raw':
                $data = $ReportConfig->getExport(isset($_REQUEST['raw']));
                $viewFormat = new GD_ServicesViewFormat_CSV('public', $reportNid);
                break;

            case 'pdf':
                $data = gd_report_get_export_table($ReportConfig, isset($_REQUEST['raw']));
                $viewFormat = new GD_ServicesViewFormat_PDF('public', $reportNid);
                break;

            default:
                $data = $ReportConfig->getExport(isset($_REQUEST['raw']));
                $viewFormat = new GD_ServicesViewFormat_CSV('public', $reportNid);
                break;
        }

        print $viewFormat->render($data);
        drupal_exit();
    } catch ( Exception $e ) {
        gd_exception_handler($e);
        drupal_set_message('An unexpected Error has occurred. Please contact your Site Administrator.', 'error');
        return ' ';
    }
}
 protected function __construct() {
     self::$configList = array();
 }