Пример #1
0
importar("Geral.Lista.ListaTextos");
$tituloPagina = 'Utilidades > Textos > Alterar';
$iAT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/texto.html"));
$lI = new ListaIdiomas();
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['titulo'])) {
        $erro = "<b>Titulo</b> não preenchido!<br><br>";
    }
    if (empty($_POST['url'])) {
        $erro = "<b>URL</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        $lT = new ListaTextos();
        $lT->condicoes('', $_GET['texto'], ListaTextos::ID);
        $tx = $lT->listar();
        $tx->titulo = $_POST['titulo'];
        $tx->subTitulo = $_POST['subTitulo'];
        $tx->ordem = $_POST['ordem'];
        $tx->getURL()->setURL($_POST['url']);
        $tx->textoPequeno = $_POST['textoPequeno'];
        $tx->texto = $_POST['texto'];
        if (!empty($_FILES['imagem']['name'])) {
            $tx->getImagem()->setImage(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem'])));
        }
        $lT->alterar($tx);
        while ($i = $lI->listar()) {
            $t = $i->getTraducaoById(ListaTextos::TITULO, $lT->getTabela(), $tx->getId());
            if ($t->getId()) {
                $t->conteudo = $tx->titulo;
                $t->traducao = $_POST['ititulo'][$i->getId()];
Пример #2
0
 public function resgatarObjetos(&$a)
 {
     if (!empty($a[self::URL])) {
         $lU = new ListaURLs();
         $lU->condicoes('', $a[self::URL], ListaURLs::ID);
         if ($lU->getTotal() > 0) {
             $a[self::URL] = $lU->listar();
         } else {
             $a[self::URL] = new URL();
         }
     } else {
         $a[self::URL] = new URL();
     }
     $valor = !empty($a[self::TEXTO]) ? (int) $a[self::TEXTO] : 0;
     if (!empty($valor)) {
         $lT = new ListaTextos();
         $lT->condicoes('', $a[self::TEXTO], ListaTextos::ID);
         if ($lT->getTotal() > 0) {
             $a[self::TEXTO] = $lT->listar();
         } else {
             $a[self::TEXTO] = new Texto();
         }
     } elseif (!empty($a[self::TEXTO]) && is_int($a[self::TEXTO])) {
         $a[self::TEXTO] = new Texto();
     }
 }
Пример #3
0
        try {
            $lT->deletar($lT->listar());
            $javaScript .= Aviso::criar("Texto removido com sucesso!");
        } catch (Exception $e) {
            $javaScript .= Aviso::criar($e->getMessage());
        }
    }
}
$lT = new ListaTextos();
$ILT->createRepeticao("repetir->Textos");
if (!empty($_GET['busca'])) {
    $lT->condicoes('', "%" . $_GET['busca'] . "%", 'empresa', 'LIKE');
}
$ILT->condicao("condicaoBusca", !empty($_SESSION['nivel']));
$ILT->trocar("linkCadastrar.Texto", "?p=" . $_GET['p'] . "&a=cadastrarTexto");
$a[1] = array('campo' => Lista::URL, 'valor' => '', 'operador' => '<>');
$lT->condicoes($a);
while ($tx = $lT->listar("ASC", ListaTextos::TITULO)) {
    $ILT->repetir();
    $ILT->enterRepeticao()->condicao("condicaoRemover", !empty($_SESSION['nivel']));
    $bgColor = $lT->getParametros() % 2 == 0 ? '#FFFFFF' : '#EAEAEA';
    $ILT->enterRepeticao()->trocar("bgColorEmpresa", $bgColor);
    $ILT->enterRepeticao()->trocar("id.Texto", $tx->getId());
    $ILT->enterRepeticao()->trocar("titulo.Texto", $tx->titulo);
    $ILT->enterRepeticao()->trocar("linkVisualizar.Texto", "?p=" . $_GET['p'] . "&a=listarTextos&texto=" . $tx->getId());
    $ILT->enterRepeticao()->trocar("linkAlterar.Texto", "?p=" . $_GET['p'] . "&a=alterarTexto&texto=" . $tx->getId());
    $ILT->enterRepeticao()->condicao("condicaoVisualizar", $tx->tipo == 1);
}
$botoes = $ILT->cutParte('botoes');
$ILT->trocar('link.Voltar', "?p=" . $_GET['p'] . "&a=utilidades");
$includePagina = $ILT->concluir();