コード例 #1
0
ファイル: Idioma.php プロジェクト: jhonnybail/marktronic
 public function getTraducaoByConteudo($conteudo, $tabela = '', $returnOriginal = true)
 {
     $v[1] = array('campo' => ListaTraducoes::CONTEUDO, 'valor' => $conteudo);
     $v[2] = array('campo' => ListaTraducoes::IDIOMA, 'valor' => $this->id);
     if (!empty($tabela)) {
         $v[3] = array('campo' => ListaTraducoes::TABELACONTEUDO, 'valor' => $tabela);
     }
     $lT = new ListaTraducoes();
     $lT->condicoes($v);
     if ($lT->getTotal() > 0) {
         return $lT->listar();
     } else {
         $t = new Traducao();
         if ($returnOriginal) {
             $t->traducao = $conteudo;
         }
         return $t;
     }
 }
コード例 #2
0
 public function deletar(Idioma $i)
 {
     $where = "WHERE " . self::ID . " = '" . $i->getId() . "'";
     Arquivos::__DeleteArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataIdiomas . $i->getImagem()->nome . '.' . $i->getImagem()->extensao);
     $lT = new ListaTraducoes();
     $lT->condicoes('', $i->getId(), ListaTraducoes::IDIOMA);
     while ($t = $lT->listar()) {
         $lT->deletar($t);
         $lT->setParametros(0);
     }
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
コード例 #3
0
<?php

importar("Geral.Idiomas.Lista.ListaIdiomas");
$tituloPagina = 'Configurações > Idiomas > Traduções';
$iTLT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaConfiguracoes/listarTraducoes.html"));
$iTLT->trocar("linkDeletar.Traducao", "?p=" . $_GET['p'] . "&a=" . $_GET['a'] . "&");
$iTLT->trocar("linkBuscar.Traducao", "?p=" . $_GET['p'] . "&");
$lI = new ListaIdiomas();
$lI->condicoes('', $_GET['idioma'], ListaIdiomas::ID);
if ($lI->getTotal() > 0) {
    $i = $lI->listar();
} else {
    $i = new Idioma();
}
if (!empty($_GET['deletar'])) {
    $lT = new ListaTraducoes();
    $lT->condicoes('', $_GET['deletar'], ListaTraducoes::ID);
    if ($lT->getTotal() > 0) {
        try {
            $lT->deletar($lT->listar());
            $javaScript .= Aviso::criar("Tradução removida com sucesso!");
        } catch (Exception $e) {
            $javaScript .= Aviso::criar($e->getMessage());
        }
    }
}
$iTLT->createRepeticao("repetir->Traducoes");
if (!empty($_GET['busca'])) {
    $i->getTraducoes()->condicoes('', "%" . $_GET['busca'] . "%", 'empresa', 'LIKE');
}
$iTLT->condicao("condicaoBusca", !empty($_SESSION['nivel']));