示例#1
0
 public function deletar($t)
 {
     if ($this->enableClearCache) {
         $this->clearCache();
     }
     $lU = new ListaURLs();
     if (method_exists($t, "getURL")) {
         $lU->deletar($t->getURL());
     }
     $lT = new ListaTextos();
     if (method_exists($t, "getTexto")) {
         $lT->deletar($t->getTexto());
     }
 }
示例#2
0
<?php

importar("Geral.Lista.ListaTextos");
$tituloPagina = 'Utilidades > Textos';
$ILT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/listarTextos.html"));
$ILT->trocar("linkDeletar.Texto", "?p=" . $_GET['p'] . "&a=" . $_GET['a'] . "&");
$ILT->trocar("linkBuscar.Texto", "?p=" . $_GET['p'] . "&");
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']));