Exemplo n.º 1
0
	function Muestra(){
		include "../../lib/php/messageResources.php";
		$INDEXIDIOMA=$_SESSION["idiomausuario"];
		$idioma= new Idioma();
		if(isset($_GET['idioma_id'])){
			$idioma_id=$_GET['idioma_id'];
			$idioma->Load_Idioma($idioma_id);
		} else {
			header("Location: index.php");
		}
	
		$I  = new Interfaz("Usuarios:: Editar Usuario",true);
		?>
<style type="text/css">
<!--
.Estilo1 {color: #FF0000}
-->
</style>
<script language="JavaScript" src="../../lib/js/jquery/jquery-1.3.2.js" type="text/javascript"></script>
<script language="JavaScript" src="../../lib/js/validateForm.js" type="text/javascript"></script>
<script language="JavaScript" src="../../lib/js/valida_form.js" type="text/javascript"></script>

<br><br>
		<form name="form1" method="post"/>
			<table width="80%" align="center" cellpadding="4" cellspacing="4" border="0" bgcolor="#f4f4f4" style="padding-top: 20px;">
				<tr>
				    <td colspan="2" align="center"><strong><?php echo $LABELINDEX[$INDEXIDIOMA][435]?></strong></td>
                </tr>
                <tr>
                    <td>
                        <input type="hidden" name="i_id" id="i_id" value="<?php echo $_GET['idioma_id']; ?>" readonly="readonly" style="border-color:#FFFFFF" />
                    </td>
                </tr>                 
				<tr>
                    <td align="right" width="50%"><?php echo $LABELINDEX[$INDEXIDIOMA][327]?><span class="Estilo1">*</span>:</td><td> <input type="text" name="nombre" id="nombre" size="20" value="<?php echo $idioma->Get_dato("i_idioma");?>"/></td>
                </tr>
				<tr>
				 	<td align="right" width="50%"><?php echo $LABELINDEX[$INDEXIDIOMA][28]?>:</td>
                    <td>
					<?php if($idioma->Get_dato("i_estatus") == 1){ ?>
						<input type=checkbox name="estatus" id="estatus" checked="checked" />
					<? }else{ ?>
						<input type=checkbox name="estatus" id="estatus" />
					<? } ?>
                    </td>
				</tr>
				<tr><td colspan="2">&nbsp;</td></tr>
				<tr>
				 	<td colspan="2" align="center">
				 		<input type="submit" value="<?php echo $LABELINDEX[$INDEXIDIOMA][345]?>" name="actualizar" onclick="return validar_formulario_editar_idioma(); ">
				 		<input type="submit" value="<?php echo $LABELINDEX[$INDEXIDIOMA][219]?>" name="cancelar">
					</td>
				</tr>
			</table>
        </form>
		
		<?php
		
		$I->Footer();
	}
Exemplo n.º 2
0
function Guardar()
{
    $idioma = new Idioma();
    if (isset($_POST['nombre']) && $_POST['nombre'] != "") {
        $i_idioma = $_POST['nombre'];
        $i_estatus = 0;
        if (isset($_POST['estatus'])) {
            if ($_POST['estatus'] == "on") {
                $i_estatus = 1;
            }
        }
        $idioma->Nuevo_Idioma($i_idioma, $i_estatus);
        header("Location: index.php?oksave");
    } else {
        header("Location: index.php?error");
    }
}
 public function mostrarInfo($url)
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $item_lang = Item::join('item_lang', 'item_lang.item_id', '=', 'item.id')->where('item_lang.lang_id', $lang->id)->where('item_lang.url', $url)->first();
     //Me quedo con el item, buscando por url
     //$item = Item::where('url', $url)->first();
     $item = Item::find($item_lang->item_id);
     $this->array_view['item'] = $item;
     return View::make($this->folder_name . '.' . $this->project_name . '-ver', $this->array_view);
 }
Exemplo n.º 4
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;
             }
         }
     }
 }
 public function vistaEditar($id)
 {
     //Me quedo con la categoria, buscando por id
     //$categoria = Categoria::find($id);
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $categoria = Categoria::join('categoria_lang', 'categoria_lang.categoria_id', '=', 'categoria.id')->where('categoria_lang.lang_id', $lang->id)->where('categoria_lang.estado', 'A')->where('categoria.id', $id)->first();
     $categorias = Categoria::where('estado', 'A')->where('id', '<>', $id)->get();
     $this->array_view['categoria'] = $categoria;
     $this->array_view['categorias'] = $categorias;
     if ($categoria) {
         return View::make($this->folder_name . '.editar', $this->array_view);
     } else {
         $this->array_view['texto'] = Lang::get('controllers.error_carga_pagina');
         return View::make($this->project_name . '-error', $this->array_view);
     }
 }
Exemplo n.º 6
0
 /**
  * este metodo se encarga de pintar el html de la vista por defcto para inmueble, que es el listado.
  */
 public function index()
 {
     if (Session::get("auth")) {
         header('Location: ' . URL . 'news/');
     } else {
         //MUETRA LOS ERRORES, EN EL MEtODO INDEX ESTA EL BLOQUE errors_row
         $this->initializeTpl("pagina", "Login");
         $this->_tpl->assign('header_login', Idioma::get("header_login"));
         if (Session::get('errors')) {
             $arr_temp = Session::getAndDestroy('errors');
             foreach ($arr_temp as $value) {
                 $this->_tpl->newBlock('errors_row');
                 $this->_tpl->assign("salida", $value);
             }
         }
         $this->_tpl->printToScreen();
     }
 }
Exemplo n.º 7
0
 public static function borrarIdioma($input)
 {
     $respuesta = array();
     $reglas = array();
     $validator = Validator::make($input, $reglas);
     if ($validator->fails()) {
         $respuesta['mensaje'] = $validator;
         $respuesta['error'] = true;
     } else {
         $idioma = Idioma::find($input['id']);
         $idioma->fecha_baja = date("Y-m-d H:i:s");
         $idioma->estado = 'B';
         $idioma->usuario_id_baja = Auth::user()->id;
         $idioma->save();
         $respuesta['mensaje'] = 'Idioma eliminado.';
         $respuesta['error'] = false;
         $respuesta['data'] = $idioma;
     }
     return $respuesta;
 }
Exemplo n.º 8
0
 /**
  * Action used to set the application locale.
  * 
  */
 public function setLocale()
 {
     $mLocale = Request::segment(2, Config::get('app.locale'));
     // Get parameter from URL.
     if (in_array($mLocale, Config::get('app.languages'))) {
         App::setLocale($mLocale);
         Session::put('locale', $mLocale);
         Cookie::forever('locale', $mLocale);
     }
     if (Request::segment(3) == 'M' && is_numeric(Request::segment(4))) {
         $menu_id = Request::segment(4);
         $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
         $menu = Menu::join('menu_lang', 'menu_lang.menu_id', '=', 'menu.id')->where('menu_lang.lang_id', $lang->id)->where('menu_lang.estado', 'A')->where('menu_lang.menu_id', $menu_id)->first();
         return Redirect::to($this->array_view['prefijo'] . '/' . $menu->url);
     } elseif (Request::segment(3) == 'PC' && is_numeric(Request::segment(4))) {
         $item_id = Request::segment(4);
         $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
         $item = $item_lang = Item::join('item_lang', 'item_lang.item_id', '=', 'item.id')->where('item_lang.lang_id', $lang->id)->where('item_lang.item_id', $item_id)->first();
         return Redirect::to($this->array_view['prefijo'] . '/portfolio_completo/' . $item->url);
     } else {
         return Redirect::back();
     }
 }
Exemplo n.º 9
0
    case "INDEX":
        $idioma_name = "";
        $busqueda_value = "";
        if (isset($_GET["name_idioma"])) {
            $idioma_name = $_GET["name_idioma"];
            $busqueda_value = "name_idioma=" . $idioma_name;
        }
        $I = new Interfaz("Idiomas", true);
        $L = new Lista($busqueda_value);
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][327]);
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][28]);
        $L->Herramientas("E", "./index.php?mode=EDITAR&idioma_id=");
        include "../../lib/php/mnu_toolbar.php";
        idiomas_toolbar();
        $query = "SELECT i_idioma, if(i_estatus='1','Activo','Inactivo') as i_estatus, i_id FROM idioma WHERE i_idioma like '%" . $idioma_name . "%' ORDER BY i_id";
        $L->muestra_lista($query, 2, false, 2);
        $I->Footer();
        break;
    case "NUEVO":
        require_once "idioma_new.php";
        break;
    case "EDITAR":
        require_once "idioma_edit.php";
        break;
    case "ELIMINAR":
        $idioma_id = $_GET["idioma_id"];
        $idioma = new Idioma();
        $idioma->Delete_Idioma($idioma_id);
        header("Location: index.php");
        break;
}
Exemplo n.º 10
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $muestra = Muestra::join('muestra_lang', 'muestra_lang.muestra_id', '=', 'muestra.id')->where('muestra_lang.lang_id', $lang->id)->where('muestra.id', $this->id)->first();
     if (is_null($muestra)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $muestra = Muestra::join('muestra_lang', 'muestra_lang.muestra_id', '=', 'muestra.id')->where('muestra_lang.lang_id', $lang->id)->where('muestra.id', $this->id)->first();
     }
     return $muestra;
 }
Exemplo n.º 11
0
 /**
 * Returns the data model based on the primary key given in the GET variable.
 * If the data model is not found, an HTTP exception will be raised.
 * @param integer the ID of the model to be loaded
 */
 public function loadModel($id)
 {
     $model = Idioma::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 12
0
 public function sendEmail($assunto, Idioma $idioma = null, $vendedor = false)
 {
     if (empty($idioma)) {
         $idioma = new Idioma();
         $idioma->sigla = 'br';
     } elseif (!$idioma->getId()) {
         $idioma = new Idioma();
         $idioma->sigla = 'br';
     }
     $temE = new InterFaces(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/email-padrao.html"));
     $temEE = new InterFaces(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaPedidos/email-pedido.html"));
     $temEE->setSession($idioma->sigla);
     $temEE->trocar('lang', $idioma->sigla);
     $p = $this->getCliente();
     $endP = $p->getEndereco()->listar();
     $telP = $p->getTelefone()->listar();
     $lP = new ListaProdutos();
     $temEE->createRepeticao("repetir->PedidoItens");
     $con = BDConexao::__Abrir();
     $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "frete");
     $rs = $con->getRegistro();
     $con->executar("SELECT * FROM " . Sistema::$BDPrefixo . "pagamentos");
     $rsP = $con->getRegistro();
     $total = 0;
     $end = $this->getEndereco();
     $temEE->condicao("condicao->Alterar.Endereco.Pedido", isset($_GET['alterar-endereco']) || $end->getCep() == '' || $end->logradouro == '' || $end->numero == '' || $end->bairro == '' || $end->getCidade()->nome == '' || $end->getEstado()->uf == '');
     $temEE->condicao("condicao->tipo.Endereco.Pedido", !empty($end->tipo));
     $temEE->trocar($end->tipo . '.Endereco.Pedido', "checked=\"checked\"");
     $temEE->trocar('cep.Endereco.Pedido', $end->getCep());
     $temEE->trocar('logradouro.Endereco.Pedido', $end->logradouro);
     $temEE->trocar('ddd.Telefone.Pedido', $tel->ddd);
     $temEE->trocar('telefone.Telefone.Pedido', $tel->telefone);
     $temEE->trocar('numero.Endereco.Pedido', $end->numero);
     $temEE->trocar('complemento.Endereco.Pedido', $end->complemento);
     $temEE->trocar('bairro.Endereco.Pedido', $end->bairro);
     $temEE->trocar('cidade.Endereco.Pedido', $end->getCidade()->nome);
     $temEE->trocar('estado.Endereco.Pedido', $end->getEstado()->uf);
     $temEE->trocar("tipoPagamento.Pedido", $this->getTipoPagamento());
     $temEE->trocar("status.Pedido", $idioma->getTraducaoByConteudo($this->getStatus())->traducao);
     $recuperar = true;
     $itens = new ListaPedidoItens();
     $a[1] = array('campo' => ListaPedidoItens::IDSESSAO, 'valor' => $this->id);
     $itens->condicoes($a);
     while ($pI = $itens->listar()) {
         if ($pI) {
             $lP->condicoes('', $pI->getProdutoPai(), ListaProdutos::ID);
             if ($lP->getTotal() > 0) {
                 $produtoPai = $lP->listar();
             }
             $cat = $produtoPai ? $produtoPai->getCategorias()->listar() : $pI->getCategorias()->listar();
             $temEE->repetir();
             $temEE->enterRepeticao()->trocar("n.PedidoItem", $this->getItem()->getParametros());
             $temEE->enterRepeticao()->trocar("id.PedidoItem", $pI->getId());
             $temEE->enterRepeticao()->trocar("quantidade.PedidoItem", $pI->quantidade);
             $temEE->enterRepeticao()->trocar("nome.PedidoItem", $idioma->getTraducaoByConteudo($pI->nome)->traducao . ($pI->observacao != '' ? ' ' . $pI->observacao : ''));
             $temEE->enterRepeticao()->trocar("valor.PedidoItem", "\$ " . $pI->valor->moeda());
             $valorP = $pI->valor;
             $temEE->enterRepeticao()->trocar("valorPonto.PedidoItem", (string) Numero::__CreateNumero($valorP->formatar())->formatar());
             $total += $pI->valor->num * $pI->quantidade;
             if ($pI->getImagens()->getTotal() > 0) {
                 $temEE->enterRepeticao()->trocar("imagem.PedidoItem", $pI->getImagens()->listar("DESC", ListaImagens::DESTAQUE)->getImage()->showHTML(60, 1000));
             }
             if ($pI->quantidade > $pI->estoque) {
                 $recuperar = false;
             }
         }
     }
     $temEE->condicao('condicao->Desconto', $this->getDesconto()->num > 0);
     $temEE->trocar('desconto', "\$ " . $this->getDesconto()->moeda());
     $total -= $this->getDesconto()->num;
     $temEE->condicao("condicao->RecuperarPedido", $this->getStatus()->getStatus() == PedidoStatus::CANCELADO && $recuperar);
     $temEE->condicao("condicao->EfetivarPagamento", $this->getStatus()->getStatus() == PedidoStatus::COBRANCA);
     $temEE->trocar("linkFinalizar.Pedido", Sistema::$caminhoURL . $idioma->sigla . "/finalizar-pedido&pedido=" . $this->getId() . "&recuperar");
     $temEE->condicao("condicao->DepositoPagamento", $this->getTipoPagamento() == PagamentoDeposito::GetTipo());
     $temEE->trocar("textoDeposito", nl2br($rsP['textodeposito']));
     $temEE->condicao('condicao->ExisteFrete', $this->hasFrete() && $this->getItem()->getTotal() > 0);
     $temEE->condicao('condicao->ExistePrazo', $this->getEndereco()->prazo > 0 && $this->getItem()->getTotal() > 0);
     $temEE->condicao('condicao->ExisteFreteCorreios', $rs['ativocorreio']);
     $temEE->trocar("valor.Endereco.Cliente", $this->freeFrete() ? $idioma->getTraducaoByConteudo('Grátis')->traducao : ($end->getValor()->num > 0 ? "\$ " . $end->getValor()->moeda() : ''));
     $temEE->trocar("tipo.Endereco.Pedido", PedidoEnderecoEntrega::GetNameType($end->tipo));
     $temEE->trocar("prazo.Endereco.Pedido", $this->getEndereco()->prazo);
     $temEE->trocar("total", "\$ " . Numero::__CreateNumero($total + $end->getValor()->num)->moeda());
     $temEE->trocar("observacoes", $this->observacoes);
     $temE->trocar('texto', $temEE->concluir());
     $msg = $temE->concluir();
     EnvioEmail::$de = Sistema::$nomeEmpresa . "<" . Sistema::$emailEmpresa . ">";
     EnvioEmail::$assunto = $idioma->getTraducaoByConteudo($assunto)->traducao . "!";
     EnvioEmail::$html = true;
     EnvioEmail::$msg = $msg;
     if (!$vendedor) {
         EnvioEmail::$de = Sistema::$nomeEmpresa . "<" . Sistema::$emailEmpresa . ">";
         EnvioEmail::$para = $p->emailPrimario;
     } else {
         EnvioEmail::$de = $p->nome . "<" . $p->emailPrimario . ">";
         EnvioEmail::$para = Sistema::$emailEmpresa;
     }
     EnvioEmail::enviar();
 }
Exemplo n.º 13
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']));
Exemplo n.º 14
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $categoria = Categoria::join('categoria_lang', 'categoria_lang.categoria_id', '=', 'categoria.id')->where('categoria_lang.lang_id', $lang->id)->where('categoria_lang.estado', 'A')->where('categoria.id', $this->id)->first();
     if (is_null($categoria)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $categoria = Categoria::join('categoria_lang', 'categoria_lang.categoria_id', '=', 'categoria.id')->where('categoria_lang.lang_id', $lang->id)->where('categoria_lang.estado', 'A')->where('categoria.id', $this->id)->first();
     }
     return $categoria;
 }
Exemplo n.º 15
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $menu = Menu::join('menu_lang', 'menu_lang.menu_id', '=', 'menu.id')->where('menu_lang.lang_id', $lang->id)->where('menu_lang.estado', 'A')->where('menu.id', $this->id)->first();
     if (is_null($menu)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $menu = Menu::join('menu_lang', 'menu_lang.menu_id', '=', 'menu.id')->where('menu_lang.lang_id', $lang->id)->where('menu_lang.estado', 'A')->where('menu.id', $this->id)->first();
     }
     return $menu;
 }
Exemplo n.º 16
0
 public function vistaEditar($id)
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $menu = Menu::join('menu_lang', 'menu_lang.menu_id', '=', 'menu.id')->where('menu_lang.lang_id', $lang->id)->where('menu_lang.estado', 'A')->where('menu.id', $id)->first();
     if ($menu) {
         $this->array_view['menu'] = $menu;
         return View::make($this->folder_name . '.editar', $this->array_view);
     } else {
         $this->array_view['texto'] = Lang::get('controllers.error_carga_pagina');
         //return View::make($this->project_name . '-error', $this->array_view);
         return Redirect::to('/');
     }
 }
Exemplo n.º 17
0
?>

	<?php 
echo $form->textFieldGroup($model, 'nombre_completo', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 100))));
?>

	<?php 
echo $form->passwordFieldGroup($model, 'password', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 256))));
?>

	<?php 
//echo $form->textFieldGroup($model,'fk_idioma',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5'))));
?>

<?php 
echo $form->dropDownListGroup($model, 'fk_idioma', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => CHtml::listData(Idioma::model()->findAll(), 'id_idioma', 'idioma'), 'htmlOptions' => array('empty' => 'Seleccione su idioma', 'style' => 'border:1px solid red;'))));
?>

	<?php 
//echo $form->textFieldGroup($model,'fk_pais',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5'))));
?>


<?php 
echo $form->dropDownListGroup($model, 'fk_pais', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => CHtml::listData(Pais::model()->findAll(array('order' => 'pais')), 'id_pais', 'pais'), 'htmlOptions' => array('empty' => 'Seleccione su País'))));
?>


	<?php 
//echo $form->textFieldGroup($model,'fk_pregunta_secreta',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5'))));
?>
Exemplo n.º 18
0
 /** funcion privada para inicializar el objeto tpl de la clase. Se le pasal el titulo y demas
  *
  * @param string $str
  * @param string $titulo titlo del documetno
  */
 private function initializeTpl($str, $titulo)
 {
     $this->_tpl->assignInclude('content', $GLOBALS['tpl_theme_views'] . $GLOBALS['controlador'] . '-' . $GLOBALS['metodo'] . '.html');
     if (Session::get('errors')) {
         $this->_tpl->assignInclude('errors', $GLOBALS['tpl_theme_views'] . $GLOBALS['controlador'] . '-errors.html');
     }
     $this->_tpl->prepare();
     $this->_tpl->assign('content', '');
     $this->_tpl->gotoBlock('_ROOT');
     $this->_tpl->assign('title', TITULO . ' - ' . $titulo);
     $this->_tpl->assign('theme_url', $GLOBALS['tpl_theme_url']);
     $this->_tpl->assignGlobal('page_url', $GLOBALS['tpl_host']);
     $this->_tpl->assignGlobal('guardar', Idioma::get("guardar"));
 }
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $portfolio_completo = PortfolioCompleto::join('portfolio_completo_lang', 'portfolio_completo_lang.portfolio_completo_id', '=', 'portfolio_completo.id')->where('portfolio_completo_lang.lang_id', $lang->id)->where('portfolio_completo.id', $this->id)->first();
     if (is_null($portfolio_completo)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $portfolio_completo = PortfolioCompleto::join('portfolio_completo_lang', 'portfolio_completo_lang.portfolio_completo_id', '=', 'portfolio_completo.id')->where('portfolio_completo_lang.lang_id', $lang->id)->where('portfolio_completo.id', $this->id)->first();
     }
     return $portfolio_completo;
 }
Exemplo n.º 20
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();
 }
Exemplo n.º 21
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);
 }
Exemplo n.º 22
0
    ?>
	
				<div class="clear"></div>		
			</div>
		</div>

		<div class="clear"></div>
<!--

				<div class="content-box-header">
					
					<h3 style="cursor: s-resize; ">Seo noticia</h3>
					
					<ul class="content-box-tabs">
					<?php 
    $idiomas = new Idioma();
    $idiomas->where('activo', true)->get();
    foreach ($idiomas->all as $idioma) {
        ?>
						<li><a href="#seo_<?php 
        echo $idioma->codigo;
        ?>
" class="<?php 
        echo $idioma->codigo == 'es' ? 'default-tab current' : '';
        ?>
"><img height="24" src="<?php 
        echo site_url('images/idiomas/' . $idioma->codigo);
        ?>
.png" /></a></li> 
						<?php 
    }
Exemplo n.º 23
0
<?php

importar("Geral.Idiomas.Lista.ListaIdiomas");
$tituloPagina = 'Configurações > Idiomas > Alterar Idioma';
$iAI = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaConfiguracoes/idioma.html"));
$iAI->trocar('linkVoltar', "?p=" . $_GET['p'] . "&a=listarIdiomas");
$lI = new ListaIdiomas();
$lI->condicoes('', $_GET['id'], 'id');
if ($lI->getTotal() > 0) {
    $i = $lI->listar();
} else {
    $i = new Idioma();
}
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['nome'])) {
        $erro = "<b>Nome</b> não preenchido!<br><br>";
    }
    if (empty($_POST['sigla'])) {
        $erro = "<b>Sigla</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        $i->nome = $_POST['nome'];
        $i->sigla = $_POST['sigla'];
        if (!empty($_FILES['imagem']['name'])) {
            $i->setImagem(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem'])));
        }
        $lI = new ListaIdiomas();
        if ($i->getId() != '') {
            $lI->alterar($i);
            $javaScript .= Aviso::criar("Idioma salvo com sucesso!");
Exemplo n.º 24
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $seccion = Seccion::join('seccion_lang', 'seccion_lang.seccion_id', '=', 'seccion.id')->where('seccion_lang.lang_id', $lang->id)->where('seccion_lang.estado', 'A')->where('seccion.id', $this->id)->first();
     if (is_null($seccion)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $seccion = Seccion::join('seccion_lang', 'seccion_lang.seccion_id', '=', 'seccion.id')->where('seccion_lang.lang_id', $lang->id)->where('seccion_lang.estado', 'A')->where('seccion.id', $this->id)->first();
     }
     return $seccion;
 }
Exemplo n.º 25
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $texto = Texto::join('texto_lang', 'texto_lang.texto_id', '=', 'texto.id')->where('texto_lang.lang_id', $lang->id)->where('texto.id', $this->id)->first();
     if (is_null($texto)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $texto = Texto::join('texto_lang', 'texto_lang.texto_id', '=', 'texto.id')->where('texto_lang.lang_id', $lang->id)->where('texto.id', $this->id)->first();
     }
     return $texto;
 }
Exemplo n.º 26
0
 public function pasarItemsIdioma()
 {
     $idiomas = Idioma::where('estado', 'A')->get();
     $items_sin_idioma = Item::where('estado', 'A')->whereNotIn('id', function ($q) {
         $q->select('item_id')->from('item_lang')->where('estado', 'A');
     })->orderBy('id', 'ASC')->get();
     foreach ($items_sin_idioma as $item_sin) {
         echo "ID: " . $item_sin->id . "<br>";
         echo "Titulo: " . $item_sin->titulo . "<br>";
         echo "Descripcion: " . $item_sin->descripcion . "<br>";
         echo "URL: " . $item_sin->url . "<br><br>";
         $datos_lang = array('titulo' => $item_sin->titulo, 'descripcion' => $item_sin->descripcion, 'url' => $item_sin->url, 'estado' => 'A', 'fecha_carga' => date("Y-m-d H:i:s"), 'usuario_id_carga' => 1);
         foreach ($idiomas as $idioma) {
             /*
              if ($idioma->codigo != Config::get('app.locale')) {
              $datos_lang['url'] = $idioma->codigo . "/" . $datos_lang['url'];
             }
             * 
             */
             $item_sin->idiomas()->attach($idioma->id, $datos_lang);
         }
     }
     $imagenes_sin_idioma = Imagen::where('estado', 'A')->whereNotIn('id', function ($q) {
         $q->select('imagen_id')->from('imagen_lang')->where('estado', 'A');
     })->orderBy('id', 'ASC')->get();
     /*
      echo "CANTIDAD IMG: " . count($imagenes_sin_idioma);
      foreach ($imagenes_sin_idioma as $img_sin) {
      $datos_lang = array(
      'epigrafe' => $img_sin->epigrafe,
      'estado' => 'A',
      'fecha_carga' => date("Y-m-d H:i:s"),
      'usuario_id_carga' => 1
      );
     
      echo "ID IMG: " . $img_sin->id . "<br>";
     
      foreach ($idiomas as $idioma) {
      echo "ID IDIOMA: " . $idioma->id . "<br>";
      $img_sin->idiomas()->attach($idioma->id, $datos_lang);
      echo "PASO <br>";
      }
      }
     
      echo "LISTO";
     * 
     */
     $productos_sin_idioma = Producto::whereIn('item_id', function ($p) {
         $p->select('id')->from('item')->where('estado', 'A');
     })->whereNotIn('id', function ($q) {
         $q->select('producto_id')->from('producto_lang');
     })->orderBy('id', 'ASC')->get();
     echo "CANT PROD: " . count($productos_sin_idioma);
     foreach ($productos_sin_idioma as $prod_sin) {
         echo "ID: " . $prod_sin->id . "<br>";
         echo "Cuerpo: " . $prod_sin->cuerpo . "<br><br>";
         $datos_lang = array('cuerpo' => $prod_sin->cuerpo);
         foreach ($idiomas as $idioma) {
             $prod_sin->idiomas()->attach($idioma->id, $datos_lang);
         }
     }
 }
Exemplo n.º 27
0
<?php

importar("Geral.Idiomas.Lista.ListaIdiomas");
$tituloPagina = 'Configurções > Idiomas > Cadastrar Idioma';
$iCI = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaConfiguracoes/idioma.html"));
$iCI->trocar('linkVoltar', "?p=" . $_GET['p'] . "&a=listarIdiomas");
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['nome'])) {
        $erro = "<b>Nome</b> não preenchido!<br><br>";
    }
    if (empty($_POST['sigla'])) {
        $erro = "<b>Sigla</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        $idioma = new Idioma();
        $idioma->nome = $_POST['nome'];
        $idioma->sigla = $_POST['sigla'];
        if (!empty($_FILES['imagem']['name'])) {
            $idioma->setImagem(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem'])));
        }
        $lI = new ListaIdiomas();
        $lI->inserir($idioma);
        $pasta = dir(Sistema::$layoutCaminhoDiretorio);
        while ($a = $pasta->read()) {
            if (preg_match("!\\.html!", $a)) {
                $i = new InterFaces(new Arquivos(Sistema::$layoutCaminhoDiretorio . $a));
                $traducoes = $i->getListaTraducoes();
                foreach ($traducoes as $v) {
                    if (empty($idioma->getTraducaoByConteudo($v, '', false)->traducao)) {
                        $t = new Traducao();
Exemplo n.º 28
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $imagen = Imagen::join('imagen_lang', 'imagen_lang.imagen_id', '=', 'imagen.id')->where('imagen_lang.lang_id', $lang->id)->where('imagen_lang.estado', 'A')->where('imagen.id', $this->id)->first();
     if (is_null($imagen)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $imagen = Imagen::join('imagen_lang', 'imagen_lang.imagen_id', '=', 'imagen.id')->where('imagen_lang.lang_id', $lang->id)->where('imagen_lang.estado', 'A')->where('imagen.id', $this->id)->first();
     }
     return $imagen;
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function editIdioma($id)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["idiomas"] = Idioma::all()->lists('nombre', 'id');
             $data["niveles_idioma"] = [0 => 'Basico', 1 => 'Intermedio', 2 => 'Avanzado', 3 => 'Nulo', 4 => 'Avanzado Superior'];
             $data["formas_idioma"] = [0 => 'Estudio Internacional', 1 => 'Autodidacta', 2 => 'Software', 3 => 'Otros'];
             $data["idioma"] = PerfilIdioma::find($id);
             return View::make('rrhh.registro_perfiles.editIdioma', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
Exemplo n.º 30
0
<?php

importar("Geral.Idiomas.Lista.ListaIdiomas");
$tituloPagina = 'Configurações > Idiomas > Traduções > Cadastrar';
$iTCT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaConfiguracoes/traducao.html"));
$lI = new ListaIdiomas();
$lI->condicoes('', $_GET['idioma'], ListaIdiomas::ID);
if ($lI->getTotal() > 0) {
    $i = $lI->listar();
} else {
    $i = new Idioma();
}
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['conteudo'])) {
        $erro = "<b>Conteúdo</b> não preenchido!<br><br>";
    }
    if (empty($_POST['traducao'])) {
        $erro = "<b>Tradução</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        try {
            $tr = new Traducao();
            $tr->conteudo = $_POST['conteudo'];
            $tr->traducao = $_POST['traducao'];
            $i->addTraducao($tr);
            $_POST = '';
            $javaScript .= Aviso::criar("Tradução salva com sucesso!");
        } catch (Exception $e) {
            $javaScript .= Aviso::criar($e->getMessage());
        }