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; $t->traducao = $_POST['ititulo'][$i->getId()]; $i->addTraducao($t); $t->setCampoConteudo(ListaTextos::SUBTITULO); $t->conteudo = $not->getTexto()->subTitulo; $t->traducao = $_POST['isubTitulo'][$i->getId()]; $i->addTraducao($t); $t->setCampoConteudo(ListaTextos::TEXTO); $t->conteudo = $not->getTexto()->texto;