Location: PHPKode > projects > Netautor Professional > netautor/napro4/appl/na_professional/compile.php
<?php
/* +----------------------------------------------------------------------+
   | Netautor Professional Application Server                             |
   +----------------------------------------------------------------------+
   | Copyright (C) 1998-2005 digiconcept GmbH. <www.digiconcept.net>      |
   +----------------------------------------------------------------------+
   | This file is subject to license, that is bundled with this package   |
   | in the file LICENSE.TXT, and is available at through the             |
   | world-wide-web at http://www.netautor.com/license/                   |
   |                                                                      |
   | If you did not receive a copy of the license and are unable to       |
   | obtain it through the world-wide-web, please send a note to          |
   | hide@address.com so we can mail you a copy.                      |
   +----------------------------------------------------------------------+
   | Authors: Stefan Rottensteiner <hide@address.com>    |
   |          Marek  Kadziela      <hide@address.com>	      |
   |          Gregor Wollner                                              |
   |          Christian Unger                                             |
   |          Helli  Kleinhans  									      |
   +----------------------------------------------------------------------+
   | @version	$Revision: 1.8 $										  |
   +----------------------------------------------------------------------+*/

/**
* Simple site for layout preview
* @author	Stefan Rottensteiner
*/

require_once('../../include/init.inc');

if(!$GLOBALS['USER']->check_feature('Admin') && !$GLOBALS['USER']->check_feature('ac_layout'))
{
	$GLOBALS['USER']->login_call();
}

$mlay_definition = @strval( $_POST['mlay_definition']);

if (empty($mlay_definition) || strlen(trim($mlay_definition))==0)
{
	?>
<html>
	<body bgcolor="#FFFFFF">
		<span style="text-align: center; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10px; color: Red; font-weight: bold;">[Empty layout ]</span>
	</body>
</html>
	<?php
	die();
}


error_reporting(65535);

includeNaPro('mlay');
$original_mlay_id 	=$mlay_id;
$mlay_id			=9999999;

$invalues['mlay_id']		=$mlay_id;				// Fake-ID
$invalues['mlay_name']		=$mlay_name;			// Name
$invalues['mlay_remark']	=$mlay_remark;			// Bemerkungen
$invalues['mlay_definition']=$mlay_definition;		// Der eigentliche Inhalt
$invalues['mlay_mn_naid']	=$mlay_mn_naid;			// NA-Database ID
$invalues['mlay_typ']		='FUNCTION';			// Funktionlayout
$invalues['mlay_default']	= (empty($mlay_default)?0:1);

$lay 	= new layout($sql_world);
/* Set a default saveToPath */
$lay->setSaveTo($GLOBALS['DC_ENV']->layoutspath.$mlay_id.'.lay');
$lay->setFromArray($invalues);
$compile_success 	= $lay->compileIntoFile('',7);

if ( $compile_success && empty($lay->analysis['ERROR']))
{
	Header('Location: parse.php?mlay_id=9999999&npf_cache=no');
?><html>
 <head>
	<title>Netautor Professonal layout preview</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="Expires" content="0">
	<meta name="robots" content="nofollow">
	<meta http-equiv="refresh" content="0; URL=parse.php?mlay_id=9999999&npf_cache=no">
 </head>
<body>
</body>
</html><?php
	die();
}
else
{
	?>
	<html>
	<head>
		<title>/digiconcept/netautor/layoutmanager/preview of <?php echo($mlay_name); ?></title>
	</head>
		<body color=White>
			<span style="text-align: center; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10px; color: Red; font-weight: bold;">Error while compiling!</span>
		</body>
	</html>
	<?php 
}
?>
Return current item: Netautor Professional