<?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_)

$root_ = "http://" . $_SERVER["HTTP_HOST"] . "/studio/lib_JS/";
//$root_ = "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=\"" . $root_ . $dirJS . "/control.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $root_ . $dirJS . "/PhPage.lib.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $root_ . $dirJS . "/findDOM.js\">" . $endJS );

/*
 *  carrega os arquivos do client WEB-Service  (remote scripting) //
 *  ----------------------------------------------------------------------  //
 */
 
  echo( $iniJS . "src=\"" . $root_ . $dirJS . "/wddx.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $root_ . $dirJS . "/wddxDes.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $root_ . $dirJS . "/jsrsClient.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $root_ . $dirJS . "/msgStudio.js\">" . $endJS );
  echo( $iniJS . "src=\"" . $root_ . $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( $componentes_no_Prj, $nPage );
  
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');
?>

