<?php

define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);

define('JPATH_BASE', dirname(dirname(dirname(dirname(__FILE__)))) . DS . 'administrator');

require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'helper.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'toolbar.php';

require_once('ExportController.php');

/*
require_once('StylesBuilder.php');

$path = dirname(dirname(__FILE__)) . '/css/template.css';
$path2 = dirname(dirname(__FILE__)) . '/css/bootstrap.css';
$path3 = dirname(dirname(__FILE__)) . '/css/templateMedia.css';
$content = file_get_contents($path) . "\r\n" . file_get_contents($path2);

//$content = file_get_contents($path3);

$files = StylesBuilder::buildCssFiles($content);
           
file_put_contents(dirname(dirname(__FILE__)) . '/css/print_output.css', $files['print']);
file_put_contents(dirname(dirname(__FILE__)) . '/css/editor_output.css', $files['editor']);
exit();*/


$app = JFactory::getApplication('administrator');
$app->initialise(array('language' => $app->getUserState('application.lang', 'lang')));

$data = array_merge($_GET, $_POST);

$controller = new ExportController();
$controller->execute($data);