Пример #1
0
                $t->conteudo = $tx->subTitulo;
                $t->traducao = $_POST['subTitulo'][$i->getId()];
                $t->setIdConteudo($tx->getId());
                $t->setCampoConteudo(ListaTextos::SUBTITULO);
                $t->setTabelaConteudo($lT->getTabela());
                $i->addTraducao($t);
            }
        }
        $lI->setParametros(0);
        $javaScript .= Aviso::criar("Texto salvo com sucesso!");
    } else {
        $javaScript .= Aviso::criar($erro);
    }
}
$lT = new ListaTextos();
$t = $lT->condicoes('', $_GET['texto'], ListaTextos::ID)->listar();
$iAT->trocar("titulo", $t->titulo);
$iAT->trocar("subTitulo", $t->subTitulo);
$iAT->trocar("url", $t->getURL()->getURL());
$iAT->trocar("ordem", $t->ordem);
$iAT->trocar("textoPequeno", $t->textoPequeno);
$iAT->trocar("texto", $t->texto);
$sub = "repetir->titulo.Textos.Idiomas";
$sub2 = "repetir->texto.Textos.Idiomas";
$sub3 = "repetir->subTitulo.Textos.Idiomas";
$sub4 = "repetir->textoPequeno.Textos.Idiomas";
$iAT->createRepeticao($sub);
$iAT->createRepeticao($sub2);
$iAT->createRepeticao($sub3);
$iAT->createRepeticao($sub4);
while ($i = $lI->listar()) {
Пример #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
if (!empty($_GET['deletar'])) {
    $lT = new ListaTextos();
    $lT->condicoes('', $_GET['deletar'], ListaTextos::ID);
    if ($lT->getTotal() > 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);