<?php importar("Utilidades.Noticias.Lista.ListaNoticias"); $tituloPagina = 'Utilidades > Noticias > Cadastrar'; $iCT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/noticia.html")); $lI = new ListaIdiomas(); if (!empty($_POST)) { $erro = ''; if (empty($_POST['titulo'])) { $erro = "<b>Titulo</b> não preenchido!<br><br>"; } if (empty($erro)) { $not = new Noticia(); $not->getTexto()->titulo = $_POST['titulo']; $not->getTexto()->subTitulo = $_POST['subTitulo']; $not->getTexto()->texto = addslashes($_POST['texto']); $not->setData(new DataHora($_POST['data'])); if (!empty($_FILES['imagem']['name'])) { $not->getTexto()->getImagem()->setImage(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem']))); } $lN = new ListaNoticias(); $lN->inserir($not); $not->getURL()->setURL($_POST['url'] ? $_POST['url'] : $not->getId() . "-" . URL::cleanURL($_POST['titulo'])); $lN->alterar($not); $lT = new ListaTextos(); while ($i = $lI->listar()) { $t = new Traducao(); $t->setIdConteudo($not->getTexto()->getId()); $t->setCampoConteudo(ListaTextos::TITULO); $t->setTabelaConteudo($lT->getTabela()); $t->conteudo = $not->getTexto()->titulo;