<?php
/*
 *  flag: indica executando em modo RAD
 */
$modo_RAD = false;
  
/*
 *  Arquivo de Page  -----------------------------------------------------  //
 *  ===============
 * arquivo: page1.main.php
 */
 
/*
 *  Carrega os arquivos de Biblioteca PHP dos Componentes  //
 */
foreach($componentes_no_Prj as $_ind_ => $_val_)
{
  include( CORE . $_ind_ . '.lib.php' );
}// End foreach($componentes_no_Prj as $_ind_ => $_val_)

/*
 *  Arquivo Header da Page Principal
 *  ----------------------------------------------------------------------  //
 */
include($_SERVER['DOCUMENT_ROOT'] . $_desenv_."config/" . $nPage.'.header.php');
/*
 *  carrega a Folha de Estilos da Page  //
 *  ----------------------------------------------------------------------  //
 */
include($_SERVER['DOCUMENT_ROOT'] . $_desenv_."css/" . $nPage . '.css.php');

/*
 *  Carrega os arquivos de Objetos da Page  //
 *
 *  ----------------------------------------------------------------------  //
 */
foreach($componentes_no_Prj as $_ind_ => $_val_)
{
  include( USES . $nPage . '.' . $_ind_ . '.obj.php' );
}// End foreach($componentes_no_Prj as $_ind_ => $_val_)

/*
 *  Carrega os arquivos de Biblioteca JavaScript dos Componentes  //
 *  ----------------------------------------------------------------------  //
 */
foreach($componentes_no_Prj as $_ind_ => $_val_)
{
  include( CORE . $_ind_ . '.lib.js.php' );
}// End foreach($componentes_no_Prj as $_ind_ => $_val_)

$uri_  = "http://" . $_SERVER["HTTP_HOST"] . '/' . getRoot() . "Studio/lib_JS/";
$dirJS = $_SESSION["nBrowser"];
$iniJS = "  <script type=\"text/javascript\" ";
$endJS = "</script>\n";
/*
 *  carrega os arquivos da biblioteca básica de JavaScript //
 *  ----------------------------------------------------------------------  //
 */
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/control.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/PhPage.lib.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/findDOM.js\">" . $endJS );

/*
 *  carrega os arquivos do client WEB-Service  (remote scripting) //
 *  ----------------------------------------------------------------------  //
 */
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/wddx.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/wddxDes.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/jsrsClient.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/msgStudio.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $uri_ . $dirJS . "/dataAccess.js\">" . $endJS );

/*
 *  carrega os arquivos do Controle de Eventos  //
 *  ----------------------------------------------------------------------  //
 */
include( INC . $dirJS . '/EventoMouse.js.php');
include( INC . $dirJS . '/EventoTeclado.js.php');
include( INC . $dirJS . '/EventoGlobal.js.php');

/*
 *  Arquivo Body da Page
 *  -----------------------------------------------------------------------  //
 */
include($_SERVER['DOCUMENT_ROOT'] . $_desenv_."config/" . $nPage.'.body.php');

/*
 *  Executa os arquivos de comandos "antes" de carregar a Page
 *  ----------------------------------------------------------------------  //
 */
$arrFile = getFile( INC, "onBeforeLoad" );
foreach( $arrFile as $i_ => $nFile )
{
  include( INC . $nFile );
}// End foreach( $arrFile as $i_ => $nFile )

/*
 *  Carrega os templates dos Componentes na Page Principal
 *  ----------------------------------------------------------------------  //
 */
//$arr = getTemplates_old( $componentes_no_Prj, $nPage );
$arr = getTemplates( $projeto['projeto_nome'], $nPage );
//echo("<pre>\n");print_r($arr);exit;
foreach( $arr as $_i_ => $_n_)
{
  include( INC . $_n_ . '.tpl.php' );
}// End foreach( $arr as $_i_ => $_n_)

/*
 *  Executa os arquivos de comandos "depois" de carregar a Page
 *  ----------------------------------------------------------------------  //
 */
$arrFile = getFile( INC, "onAfterLoad" );
foreach( $arrFile as $i_ => $nFile )
{
  include( INC . $nFile );
}// End foreach( $arrFile as $i_ => $nFile )

/*
 *  Arquivo Foot da Page
 *  -----------------------------------------------------------------------  //
 */
include($_SERVER['DOCUMENT_ROOT'] . $_desenv_."config/" . $nPage.'.foot.php');

?>

