$lI = new ListaIdiomas(); if (!empty($_POST)) { $erro = ''; if (empty($_POST['titulo'])) { $erro = "<b>Titulo</b> não preenchido!<br><br>"; } if (empty($erro)) { $gC = new NoticiaCategoria(); $gC->ordem = $_POST['ordem']; $gC->getTexto()->titulo = $_POST['titulo']; $gC->getTexto()->texto = $_POST['descricao']; if (!empty($_FILES['imagem']['name'])) { $gC->getTexto()->getImagem()->setImage(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem']))); } $lB = new ListaNoticiaCategorias(); $lB->inserir($gC); $gC->getURL()->setURL($_POST['url'] ? $_POST['url'] : $gC->getId() . "-" . URL::cleanURL($_POST['titulo'])); $lB->alterar($gC); $lT = new ListaTextos(); while ($i = $lI->listar()) { $t = new Traducao(); $t->setIdConteudo($gC->getTexto()->getId()); $t->setCampoConteudo(ListaTextos::TITULO); $t->setTabelaConteudo($lT->getTabela()); $t->conteudo = $gC->getTexto()->titulo; $t->traducao = $_POST['ititulo'][$i->getId()]; $i->addTraducao($t); $t = new Traducao(); $t->setIdConteudo($gC->getTexto()->getId()); $t->setCampoConteudo(ListaTextos::TEXTO); $t->setTabelaConteudo($lT->getTabela());