* * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo * sob os termos da Licença Pública Geral GNU conforme publicada pela Free * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) * qualquer versão posterior. * * Este programa é distribuí­do na expectativa de que seja útil, porém, SEM * NENHUMA GARANTIA; nem mesmo a garantia implí­cita de COMERCIABILIDADE OU * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral * do GNU para mais detalhes. * * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto * com este programa; se não, escreva para a Free Software Foundation, Inc., no * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. * * @author Prefeitura Municipal de Itajaí * @category i-Educar * @license @@license@@ * @package iEd_Include * @since Arquivo disponível desde a versão 1.0.0 * @version $Id$ */ require_once 'Core/Controller/Page/Abstract.php'; require_once 'include/localizacaoSistema.php'; /** * clsDetalhe class. * * Cria um template para a visualização de um registro de alguma tabela do banco * de dados. * * @author Prefeitura Municipal de Itajaí * @category i-Educar * @license @@license@@ * @package iEd_Include * @since Classe disponível desde a versão 1.0.0 * @version @@package_version@@ */ class clsDetalhe extends Core_Controller_Page_Abstract { var $titulo; var $banner = FALSE; var $bannerLateral = FALSE; var $titulo_barra; var $bannerClose = FALSE; var $largura; var $detalhe = array(); var $locale = null; var $url_novo; var $caption_novo = "Novo"; var $url_editar; var $url_cancelar; var $nome_url_cancelar = "Voltar"; var $array_botao; var $array_botao_url; var $array_botao_url_script; function addBanner($strBannerUrl = '', $strBannerLateralUrl = '', $strBannerTitulo = '', $boolFechaBanner = TRUE) { if ($strBannerUrl != '') { $this->banner = $strBannerUrl; } if ($strBannerLateralUrl != '') { $this->bannerLateral = $strBannerLateralUrl; } if ($strBannerTitulo != '') { $this->titulo_barra = $strBannerTitulo; } $this->bannerClose = $boolFechaBanner; } function addDetalhe($detalhe) { $this->detalhe[] = $detalhe; } function enviaLocalizacao($localizao){ if($localizao) $this->locale = $localizao; } function Gerar() { return FALSE; } function RenderHTML() { $this->_preRender(); $this->titulo_barra= 'Intranet'; $this->Gerar(); $retorno = ''; if ($this->banner) { $retorno .= ""; $retorno .= "
bannerLateral}\" align=\"right\" border=\"0\" alt=\"$this->titulo_barra\" title=\"$this->titulo_barra\">"; } $script = explode('/', $_SERVER['PHP_SELF']); $script = $script[count($script)-1]; $width = empty($this->largura) ? '' : 'width=' . $this->largura; /* * adiciona os botoes de help para a pagina atual */ $url = parse_url($_SERVER['REQUEST_URI']); $url = preg_match( "^/", "", $url["path"] ); if (strpos($url, '_det.php') !== FALSE) { $tipo = "det"; } elseif (strpos($url, '_lst.php') !== FALSE) { $tipo = 'lst'; } elseif (strpos($url, '_pdf.php') !== FALSE) { $tipo = 'pdf'; } else { $tipo = 'cad'; } $barra = '' . $this->titulo . ''; if (class_exists('clsPmiajudaPagina')) { $ajudaPagina = new clsPmiajudaPagina(); $lista = $ajudaPagina->lista(null,null,$url); if ($lista) { $barra = "
\"Bot�o {$this->titulo} \"Bot�o
"; } } if ($this->locale){ $retorno .= " "; $retorno .= ""; $retorno .= "
{$this->locale}
"; } $retorno .= " "; if (empty($this->detalhe)) { $retorno .= "\n"; } else { if (is_array($this->detalhe)) { reset($this->detalhe); $campo_anterior = ""; $md = TRUE; foreach ($this->detalhe as $pardetalhe) { if (is_array($pardetalhe)) { $campo = $pardetalhe[0].":"; $texto = $pardetalhe[1]; if ($campo == $campo_anterior) { $campo = ""; } else { $campo_anterior = $campo; $md = !$md; } if ($campo == "-:") { if (empty($texto)) { $texto = ' '; } $retorno .= "\n"; } else { $classe = $md ? 'formmdtd' : 'formlttd'; $retorno .= "\n"; } } else { $retorno .= ""; } } } } $retorno .= "\n"; if (!empty($this->url_editar) || !empty($this->url_cancelar) || $this->array_botao) { $retorno .= " "; if ($this->array_botao_url || $this->array_botao_url_script) { $retorno .= ""; } $retorno .= ""; } $retorno .= "
{$barra}
Não há informação a ser apresentada.
$texto
$campo$texto
$pardetalhe
"; if ($this->url_novo) { $retorno .= "  \n"; } if ($this->url_editar) { $retorno .= "  \n"; } if ($this->url_cancelar) { $retorno .= "  \n"; } $retorno .= "
 
"; } if ($this->array_botao_url) { for ($i = 0, $total = count($this->array_botao); $i < $total; $i++) { $retorno .= "  \n"; } } elseif ($this->array_botao_url_script) { for ($i = 0, $total = count($this->array_botao); $i < $total; $i++) { $retorno .= "  \n"; } } if ($this->array_botao_url || $this->array_botao_url_script) { $retorno .= "
 


"; if ($this->bannerClose) { $retorno .= "
"; } return $retorno; } }