Ejemplo n.º 1
0
 public static function createNavegador(ProdutoCategoria $pC, Idioma $idioma = null, Templates $tem = null, $separador = " > ")
 {
     $lPC = new ListaProdutoCategorias();
     $lPC->condicoes('', $pC->getIdCategoriaPai(), ListaProdutoCategorias::ID);
     if ($lPC->getTotal() > 0) {
         $cPC = $lPC->listar();
         if ($tem) {
             $tem2 = new Templates(Arquivos::__Create($tem->getArquivo()->arquivo));
             if ($idioma) {
                 $tem->trocar("nome", $idioma->getTraducaoByConteudo($pC->nome)->traducao);
             } else {
                 $tem->trocar("nome", $pC->nome);
             }
             $tem->trocar("url", $pC->getURL()->url);
             $tem->trocar("id", $pC->getId());
             $tem->trocar("ordem", $pC->ordem);
             if ($pC->getId() != '') {
                 return self::createNavegador($cPC, $idioma, $tem2, $separador) . $separador . $tem->concluir();
             }
         } else {
             if ($idioma) {
                 return self::createNavegador($cPC, $idioma, null, $separador) . $separador . $idioma->getTraducaoByConteudo($pC->nome)->traducao;
             } else {
                 return self::createNavegador($cPC, null, null, $separador) . $separador . $pC->nome;
             }
         }
     } else {
         if ($tem) {
             if ($idioma) {
                 $tem->trocar("nome", $idioma->getTraducaoByConteudo($pC->nome)->traducao);
             } else {
                 $tem->trocar("nome", $pC->nome);
             }
             $tem->trocar("url", $pC->getURL()->url);
             $tem->trocar("id", $pC->getId());
             $tem->trocar("ordem", $pC->ordem);
             if ($pC->getId() != '') {
                 return $tem->concluir();
             }
         } else {
             if ($idioma) {
                 return $idioma->getTraducaoByConteudo($pC->nome)->traducao;
             } else {
                 return $pC->nome;
             }
         }
     }
 }
Ejemplo n.º 2
0
 public function concluir()
 {
     $this->trocar('nomeBotao', $this->nomeBotao);
     $cont = $this->getListaTraducoes();
     if (count($cont) > 0) {
         $lI = new ListaIdiomas();
         $lI->condicoes('', $this->SESSION['lang'], ListaIdiomas::SIGLA);
         if ($lI->getTotal() > 0) {
             $i = $lI->listar();
         } else {
             $i = new Idioma();
         }
         foreach ($cont as $v) {
             $this->trocar('traduzir->' . $v, $i->getTraducaoByConteudo($v)->traducao);
         }
     }
     return parent::concluir();
 }