<?php

defined ( '_JEXEC' ) or die ( 'Restricted access' );
/*
 * @component Calc Builder 
 * @copyright Copyright (C) January 2017. 
 * @license GPL 3.0 
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU General Public License for more details. 
 * See <http://www.gnu.org/licenses/>. 
 * More info www.moonsoft.es 
 * gestion@moonsoft.es
 */
// $stylesheet = file_get_contents(JURI::base().'modules/mod_calcbuilder/assets/css/'.MSHelper::__requestGetVarWrapper('style'));
$return = '<html>';
$return .= '<body>';
/*
 * $return .='<style>'.$stylesheet.'</style>'; $return .=decode_characters($this->calculo['solution']->precalcprint); $return .='<br /><br />'; $return .=decode_characters($this->calculo['code']); $return .='<br /><br />'; $return .=decode_characters($this->calculo['solution']->poscalcprint);
 */
$return .= decode_characters ( $this->calculo ['external_content'] );
$return .= '</body></html>';
echo $return;
function decode_characters($info) {
	$info = mb_convert_encoding ( $info, "HTML-ENTITIES", "UTF-8" );
	$info = preg_replace ( '~^(&([a-zA-Z0-9]);)~', htmlentities ( '${1}' ), $info );
	return ($info);
}
?>