Ejemplo n.º 1
0
 protected function cabecera_aplicacion()
 {
     if (toba::proyecto()->get_parametro('requiere_validacion')) {
         $mostrar_app_launcher = toba::proyecto()->get_parametro('proyecto', 'app_launcher', false);
         if (!$mostrar_app_launcher) {
             //--- Salir
             $js = toba_editor::modo_prueba() ? 'window.close()' : 'salir()';
             echo '<a href="#" class="enc-salir" title="Cerrar la sesión" onclick="javascript:' . $js . '">';
             echo toba_recurso::imagen_toba('finalizar_sesion.gif', true, null, null, 'Cerrar la sesión');
             echo '</a>';
             //--- Usuario
             $this->info_usuario();
         } else {
             //--- Usuario y aplicaciones
             $this->info_usuario_aplicaciones();
         }
     }
     $muestra = toba::proyecto()->get_parametro('proyecto', 'mostrar_resize_fuente', false);
     if (!is_null($muestra) && $muestra) {
         $this->mostrar_resize_fuente();
     }
     //--- Proyecto
     if (toba::proyecto()->es_multiproyecto()) {
         $this->cambio_proyecto();
     }
     if (toba::proyecto()->permite_cambio_perfiles()) {
         $this->cambio_perfil();
     }
     //--- Logo
     echo "<div id='enc-logo' style='height:{$this->alto_cabecera}'>";
     $this->mostrar_logo();
     echo "</div>\n";
 }
Ejemplo n.º 2
0
 function pie()
 {
     if (toba_editor::modo_prueba()) {
         echo "<br>";
         $item = toba::solicitud()->get_datos_item('item');
         $accion = toba::solicitud()->get_datos_item('item_act_accion_script');
         toba_editor::generar_zona_vinculos_item($item, $accion);
     }
     echo "</body>\n";
     echo "</html>\n";
 }
Ejemplo n.º 3
0
    /**
     *	Retorna el html que grafica el app_launcher con informacion del usuario y aplicaciones a las que tiene acceso
     *	@return string	html del app_launcher
     */
    public function get_html_app_launcher()
    {
        $js = toba_editor::modo_prueba() ? 'window.close()' : 'salir()';
        $url_js_app_launcher = toba::instalacion()->get_url() . '/js/js-app-launcher/';
        $html = '	<link rel="stylesheet" href="' . $url_js_app_launcher . 'css/font-awesome-4.4.0/css/font-awesome.min.css" type="text/css" />';
        $html .= '	<link rel="stylesheet" href="' . $url_js_app_launcher . 'css/app_launcher.css" type="text/css" />';
        $html .= toba_js::incluir($url_js_app_launcher . 'app_launcher.js');
        $html .= '	<div id="enc-usuario" class="enc-usuario">';
        $html .= '	</div>';
        $html .= '	<script>
					appLauncher.init({
						container: "#enc-usuario",
						data: ' . json_encode($this->get_app_launcher_data()) . ',
						js_salir: function() { javascript:' . $js . '},
					});
				</script>';
        return $html;
    }
Ejemplo n.º 4
0
 /**
  * Genera la cabecera de una columna
  * @ignore
  */
 protected function html_cuadro_cabecera_columna($titulo, $columna, $indice)
 {
     $salida = '';
     $eventos = $this->_cuadro->get_eventos();
     $columnas = $this->_cuadro->get_columnas();
     $objeto_js = $this->_cuadro->get_id_objeto_js();
     //--- ¿Es ordenable?
     if (isset($eventos['ordenar']) && $columnas[$indice]["no_ordenar"] != 1) {
         $sentido = array();
         $sentido[] = array('asc', 'Ordenar ascendente');
         $sentido[] = array('des', 'Ordenar descendente');
         $salida .= "<span class='ei-cuadro-orden'>";
         foreach ($sentido as $sen) {
             $sel = "";
             if ($this->_cuadro->es_sentido_ordenamiento_seleccionado($columna, $sen[0])) {
                 $sel = "_sel";
                 //orden ACTIVO
             }
             //Comunicación del evento
             $parametros = array('orden_sentido' => $sen[0], 'orden_columna' => $columna);
             $evento_js = toba_js::evento('ordenar', $eventos['ordenar'], $parametros);
             $js = "{$objeto_js}.set_evento({$evento_js});";
             $src = toba_recurso::imagen_toba("nucleo/sentido_" . $sen[0] . $sel . ".gif");
             $salida .= toba_recurso::imagen($src, null, null, $sen[1], '', "onclick=\"{$js}\"", 'cursor: pointer; cursor:hand;');
         }
         $salida .= "</span>";
     }
     //--- Nombre de la columna
     if (trim($columna) != '' || trim($columnas[$indice]["vinculo_indice"]) != "") {
         $salida .= $titulo;
     }
     //---Editor de la columna
     if (toba_editor::modo_prueba()) {
         $item_editor = "1000253";
         $param_editor = array(apex_hilo_qs_zona => implode(apex_qs_separador, $this->_cuadro->get_id()), 'columna' => $columna);
         $salida .= toba_editor::get_vinculo_subcomponente($item_editor, $param_editor);
     }
     return $salida;
 }
Ejemplo n.º 5
0
 /**
  * @ignore 
  */
 protected function generar_tabs_verticales()
 {
     echo "<div  class='ci-tabs-v-margen-sup'> </div>";
     foreach ($this->_lista_tabs as $id => $tab) {
         $editor = '';
         if (toba_editor::modo_prueba()) {
             $editor = toba_editor::get_vinculo_pantalla($this->_id, $this->_info['clase_editor_item'], $id) . "\n";
         }
         echo $tab->get_html('V', $this->_submit, $this->objeto_js, $this->_id_en_controlador == $id, $editor);
     }
     echo "<div class='ci-tabs-v-solapa' style='height:99%;'></div>";
 }
Ejemplo n.º 6
0
 /**
  * @ignore 
  */
 protected function generar_vinculo_editor($id_ef)
 {
     if (toba_editor::modo_prueba()) {
         $param_editor = array(apex_hilo_qs_zona => implode(apex_qs_separador, $this->_id), 'ef' => $id_ef);
         return toba_editor::get_vinculo_subcomponente($this->_item_editor, $param_editor);
     }
     return null;
 }
Ejemplo n.º 7
0
 /**
  * @ignore 
  */
 function get_html_barra_editor()
 {
     $salida = '';
     $servicio = toba::memoria()->get_servicio_solicitado();
     if (toba_editor::modo_prueba() && ($servicio == 'generar_html' || $servicio == 'html_parcial')) {
         $salida .= "<div class='div-editor'>";
         $salida .= toba_editor::generar_zona_vinculos_componente($this->_id, $this->_info['clase_editor_item'], $this->_info['clase'], $this->_info['subclase'] != '');
         $id_dep = $this->_id_en_controlador ? '&nbsp;<strong>' . $this->_id_en_controlador . '</strong>&nbsp;-' : '';
         $salida .= $id_dep . '&nbsp;[' . $this->_info['objeto'] . ']&nbsp;' . $this->_info["nombre"];
         $salida .= "</div>";
     }
     return $salida;
 }
Ejemplo n.º 8
0
 /**
  * @ignore 
  */
 protected function generar_formulario_encabezado()
 {
     //¿Algún EF tiene etiqueta?
     $alguno_tiene_etiqueta = false;
     foreach ($this->_lista_ef_post as $ef) {
         if ($this->_elemento_formulario[$ef]->get_etiqueta() != '') {
             $alguno_tiene_etiqueta = true;
             break;
         }
     }
     if ($alguno_tiene_etiqueta) {
         echo "<thead id='cabecera_{$this->objeto_js}'>\n";
         //------ TITULOS -----
         echo "<tr>\n";
         $primera = true;
         foreach ($this->_lista_ef_post as $ef) {
             $id_form = $this->_elemento_formulario[$ef]->get_id_form_orig();
             $extra = '';
             if ($primera) {
                 $extra = 'colspan="' . ($this->_colspan + 1) . '"';
             }
             echo "<th {$extra} id='nodo_{$id_form}' class='ei-ml-columna'>\n";
             if ($this->_elemento_formulario[$ef]->get_toggle()) {
                 $this->_hay_toggle = true;
                 $id_form_toggle = 'toggle_' . $id_form;
                 echo "<input id='{$id_form_toggle}' type='checkbox' class='ef-checkbox' onclick='{$this->objeto_js}.toggle_checkbox(\"{$ef}\")' />";
             }
             $this->generar_etiqueta_columna($ef);
             echo "</th>\n";
             $primera = false;
         }
         if ($this->_info_formulario['filas_ordenar'] && $this->_ordenar_en_linea) {
             echo "<th class='ei-ml-columna'>&nbsp;\n";
             echo "</th>\n";
         }
         //-- Eventos sobre fila
         if ($this->cant_eventos_sobre_fila() > 0) {
             foreach ($this->get_eventos_sobre_fila() as $evento) {
                 echo "<th class='ei-ml-columna ei-ml-columna-extra'>&nbsp;\n";
                 if (toba_editor::modo_prueba()) {
                     echo toba_editor::get_vinculo_evento($this->_id, $this->_info['clase_editor_item'], $evento->get_id()) . "\n";
                 }
                 echo "</th>\n";
             }
         }
         if ($this->_info_formulario['filas_agregar'] && $this->_borrar_en_linea) {
             echo "<th class='ei-ml-columna'>&nbsp;\n";
             echo "</th>\n";
         }
         echo "</tr>\n";
         echo "</thead>\n";
     }
 }
Ejemplo n.º 9
0
 /**
  *	Determina el perfil de datos del usuario actual
  */
 function get_perfil_datos()
 {
     if (toba_editor::modo_prueba() && !toba_editor::acceso_recursivo()) {
         return toba_editor::get_perfil_datos_previsualizacion();
     } else {
         return $this->usuario()->get_perfil_datos();
     }
 }
Ejemplo n.º 10
0
 /**
  * Construye un tag <img>
  *
  * @param string $src Url utilizada en el src del tag
  * @param string $ancho Ancho de la imagen (no oblig.)
  * @param string $alto Alto de la imagen (no oblig.)
  * @param string $alt Ayuda o tooltip que se muestra (por def. ninguna)
  * @param string $mapa (no oblig.)
  * @param string $js Evento js (e.g. onclick='...')
  * @param string $estilo (e.g. style='...')
  */
 static function imagen($src, $ancho = null, $alto = null, $alt = null, $mapa = null, $js = '', $estilo = '')
 {
     $wiki = false;
     $x = "";
     $y = "";
     $a = "";
     $m = "";
     if (isset($ancho)) {
         $x = " width='{$ancho}' ";
     }
     if (isset($alto)) {
         $y = " height='{$alto}' ";
     }
     if (isset($alt)) {
         $a = self::ayuda(null, $alt);
     }
     if (isset($mapa) && $mapa != '') {
         $m = " usemap='{$mapa}'";
     }
     if ($estilo != '') {
         $estilo = "style=\"{$estilo}\"";
     }
     if (toba_editor::modo_prueba()) {
         $img = "<img alt='' onerror='toba.falta_imagen(this.src)' src={$src} {$x} {$y} {$a} {$m}  {$estilo} {$js}/>";
     } else {
         $img = "<img alt=\"\" src={$src} {$x} {$y} {$a} {$m}  {$estilo} {$js}/>";
     }
     return $img;
 }
Ejemplo n.º 11
0
 /**
  * Retorna el html y js localizado de un componente y sus dependencias.
  * Pensado como respuesta a una solicitud AJAX
  */
 protected function servicio__html_parcial($objetos)
 {
     echo "[--toba--]";
     //-- Se reenvia el encabezado
     $this->tipo_pagina()->barra_superior();
     echo "</div>";
     //--- Parte superior de la zona
     if (toba::solicitud()->hay_zona() && toba::zona()->cargada()) {
         toba::zona()->generar_html_barra_superior();
     }
     //--- Se incluyen botones en la botonera de la operacion
     $this->generar_html_botonera_sup($objetos);
     echo "[--toba--]";
     $ok = true;
     try {
         //--- Se envia el HTML
         foreach ($objetos as $objeto) {
             $objeto->generar_html();
         }
     } catch (toba_error $e) {
         $ok = false;
         toba::logger()->error($e, 'toba');
         $mensaje = $e->get_mensaje();
         $mensaje_debug = null;
         if (toba::logger()->modo_debug()) {
             $mensaje_debug = $e->get_mensaje_log();
         }
         toba::notificacion()->error($mensaje, $mensaje_debug);
     }
     echo "[--toba--]";
     //-- Se envia info de debug
     if (toba_editor::modo_prueba()) {
         $item = toba::solicitud()->get_datos_item('item');
         $accion = toba::solicitud()->get_datos_item('item_act_accion_script');
         toba_editor::generar_zona_vinculos_item($item, $accion, false);
     }
     echo "[--toba--]";
     //--- Se envian los consumos js
     $consumos = array();
     foreach ($objetos as $objeto) {
         $consumos = array_merge($consumos, $objeto->get_consumo_javascript());
     }
     echo "toba.incluir(" . toba_js::arreglo($consumos, false) . ");\n";
     echo "[--toba--]";
     //--- Se envia el javascript
     //Se actualiza el vinculo del form
     $autovinculo = toba::vinculador()->get_url();
     echo "document.formulario_toba.action='{$autovinculo}'\n";
     toba::vinculador()->generar_js();
     toba_js::cargar_definiciones_runtime();
     if ($ok) {
         try {
             foreach ($objetos as $objeto) {
                 //$objeto->servicio__html_parcial();
                 $objeto_js = $objeto->generar_js();
                 echo "\nwindow.{$objeto_js}.iniciar();\n";
             }
         } catch (toba_error $e) {
             toba::logger()->error($e, 'toba');
             $mensaje_debug = null;
             if (toba::logger()->modo_debug()) {
                 $mensaje_debug = $e->get_mensaje_log();
             }
             toba::notificacion()->error($e->get_mensaje(), $mensaje_debug);
         }
     }
     toba::notificacion()->mostrar(false);
     toba::acciones_js()->generar_js();
     $this->generar_analizador_estadistico();
 }