Ejemplo n.º 1
0
 function get_input()
 {
     //-- Si tiene un estado, ponerlo como única opción
     $this->opciones = array();
     if (isset($this->descripcion_estado)) {
         $this->opciones[$this->estado] = $this->descripcion_estado;
     }
     $html = "";
     //El estado que puede contener muchos datos debe ir en un unico string
     $estado = $this->get_estado_para_input();
     if ($this->es_solo_lectura()) {
         $html .= toba_form::select("", $estado, $this->opciones, $this->clase_css, "disabled");
         $html .= toba_form::hidden($this->id_form, $estado);
         return $html;
     } else {
         $tab = $this->padre->get_tab_index();
         $extra = " tabindex='{$tab}'";
         $js = '';
         if ($this->cuando_cambia_valor != '') {
             $js = "onchange=\"{$this->get_cuando_cambia_valor()}\"";
         }
         $html .= toba_form::select($this->id_form, $estado, $this->opciones, 'ef-combo', $js . $this->input_extra . $extra, $this->categorias);
     }
     $html .= $this->get_html_iconos_utilerias();
     return $html;
 }
Ejemplo n.º 2
0
 static function generar_zona_vinculos_item($item, $accion, $enviar_div_wrapper = true)
 {
     if (!self::acceso_recursivo()) {
         toba::solicitud()->set_cronometrar(true);
     }
     toba_js::cargar_consumos_globales(array('utilidades/toba_editor'));
     $html_ayuda_editor = toba_recurso::ayuda(null, 'Presionando la tecla CTRL se pueden ver los enlaces hacia los editores de los distintos componentes de esta página');
     $html_ayuda_cronometro = toba_recurso::ayuda(null, 'Ver los tiempos de ejecución en la generación de esta página');
     $html_ayuda_ajax = toba_recurso::ayuda(null, 'Activar/Desactivar navegación interna de la operación via AJAX');
     $html_ayuda_editor = toba_recurso::ayuda(null, 'Volver al editor de toba');
     $solicitud = toba::solicitud()->get_id();
     $link_cronometro = toba::vinculador()->get_url('toba_editor', '1000263', null, array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $link_analizador_sql = toba::vinculador()->get_url('toba_editor', '30000030', null, array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $link_logger = toba::vinculador()->get_url('toba_editor', '1000003', null, array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $link_archivos = toba::vinculador()->get_url('toba_editor', '30000029', null, array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $estilo = toba::proyecto()->get_parametro('estilo');
     if ($enviar_div_wrapper) {
         echo "<div id='editor_previsualizacion'>";
         /*echo "<div id='editor_previsualizacion_colap'><img style='cursor:pointer;_cursor:hand;' title='Ocultar la barra'
         		src='".toba_recurso::imagen_toba('nucleo/expandir_izq.gif', false)."'
         		onclick='toggle_nodo(\$\$(\"editor_previsualizacion_cont\"))'/></div>";*/
     }
     echo "<span id='editor_previsualizacion_cont'>";
     echo "<span id='editor_previsualizacion_vis'>";
     //Logger
     list($log_nivel, $log_cant) = toba::logger()->get_mensajes_minimo_nivel();
     $niveles = toba::logger()->get_niveles();
     $niveles[0] = 'INFO';
     $img = self::imagen_editor('logger/' . strtolower($niveles[$log_nivel]) . '.gif', true);
     $html_ayuda_logger = toba_recurso::ayuda(null, 'Visor de logs');
     echo "<a href='{$link_logger}' target='logger' {$html_ayuda_logger} >" . $img . " {$log_cant}</a>\n";
     //Cronometro
     toba::cronometro()->marcar('Resumen toba_editor');
     echo "<a href='{$link_cronometro}' target='logger' {$html_ayuda_cronometro} >\n" . toba_recurso::imagen_toba('clock.png', true) . ' ' . round(toba::cronometro()->tiempo_acumulado(), 2) . ' seg' . "</a> ";
     //Memoria
     if (function_exists('memory_get_peak_usage')) {
         $memoria_pico = memory_get_peak_usage();
         echo toba_recurso::imagen_toba('memory.png', true, 16, 16, 'Pico máximo de memoria que ha consumido el script actual');
         echo ' ' . file_size($memoria_pico, 0) . ' ';
     }
     //Base de datos
     $fuente = toba_admin_fuentes::instancia()->get_fuente_predeterminada(false, toba_editor::get_proyecto_cargado());
     if ($fuente) {
         try {
             $base = toba_admin_fuentes::instancia()->get_fuente($fuente, toba_editor::get_proyecto_cargado())->get_db();
             $info_db = $base->get_info_debug();
             $total = 0;
             foreach ($info_db as $info) {
                 if (isset($info['fin'])) {
                     $total += $info['fin'] - $info['inicio'];
                 }
             }
             $rol = toba::db()->get_rol_actual();
             toba::memoria()->set_dato_instancia('previsualizacion_consultas', array('fuente' => $fuente, 'datos' => $info_db));
             echo "<a href='{$link_analizador_sql}' target='logger'>" . toba_recurso::imagen_toba('objetos/datos_relacion.gif', true, 16, 16, 'Ver detalles de las consultas y comandos ejecutados en este pedido de página') . count($info_db) . " ({$rol})</a>";
         } catch (toba_error $e) {
             //Si no se tiene acceso a la base no se hace nada
         }
     }
     //Archivos
     $archivos = self::get_archivos_incluidos();
     $total = 0;
     foreach ($archivos as $arch) {
         $total += filesize($arch);
     }
     toba::memoria()->set_dato_instancia('previsualizacion_archivos', $archivos);
     echo "<a href='{$link_archivos}' target='logger'>" . toba_recurso::imagen_toba('nucleo/php.gif', true, 16, 16, 'Ver detalle de archivos .php del proyecto incluidos en este pedido de página') . ' ' . count($archivos) . " arch. (" . file_size($total, 0) . ')</a>';
     //Session
     $tamano = file_size(strlen(serialize($_SESSION)), 0);
     echo toba_recurso::imagen_toba('sesion.png', true, 16, 16, 'Tamaño de la sesión') . " {$tamano}  ";
     echo "</span>";
     //-- ACCIONES
     echo "<span id='editor_previsualizacion_acc'>";
     $perfiles = array(apex_ef_no_seteado => '-- Todos --');
     foreach (toba::manejador_sesiones()->get_perfiles_funcionales() as $perfil) {
         $perfiles[$perfil] = $perfil;
     }
     $actuales = toba::manejador_sesiones()->get_perfiles_funcionales_activos();
     $actual = null;
     if (count($actuales) == 1) {
         $actual = current($actuales);
     }
     $js = "title='Cambia el perfil actual del usuario' onchange=\"location.href = toba_prefijo_vinculo + '&perfil_activo=' + this.value\"";
     echo "Perfiles: " . toba_form::select('cambiar_perfiles', $actual, $perfiles, 'ef-combo', $js);
     //Usuario de la base
     $hay_limitado = false;
     if (!isset(self::$fuentes)) {
         self::$fuentes = toba_info_editores::get_fuentes_datos(toba_editor::get_proyecto_cargado());
     }
     foreach (self::$fuentes as $fuente) {
         if ($fuente['permisos_por_tabla']) {
             $hay_limitado = true;
         }
     }
     if ($hay_limitado) {
         $actual = self::$memoria['conexion_limitada'] ? 'limitado' : 'normal';
         $datos = array("normal" => "Normal", "limitado" => "Limitados");
         $js = "title='Cambia temporalmente el usuario de conexión a la base' onchange=\"location.href = toba_prefijo_vinculo + '&usuario_conexion=' + this.value\"";
         echo "Permisos DB: " . toba_form::select('cambiar_rol', $actual, $datos, 'ef-combo', $js);
     }
     //Skin
     $skins = rs_convertir_asociativo(toba_info_editores::get_lista_skins(), array('estilo', 'proyecto'), 'descripcion');
     $js = "title='Cambia temporalmente el skin de la aplicación' onchange=\"location.href = toba_prefijo_vinculo + '&skin=' + this.value\"";
     $defecto = toba::proyecto()->get_parametro('estilo') . apex_qs_separador . toba::proyecto()->get_parametro('estilo_proyecto');
     echo "Skin: " . toba_form::select('cambiar_skin', $defecto, $skins, 'ef-combo', $js);
     //AJAX
     echo "<a id='editor_ajax' href='javascript: editor_cambiar_ajax()' {$html_ayuda_ajax}>" . toba_recurso::imagen_toba('objetos/ajax_off.png', true) . "</a>\n";
     //Edicion
     echo "<a href='javascript: editor_cambiar_vinculos()' {$html_ayuda_editor} >" . toba_recurso::imagen_toba('edicion_chico.png', true) . "</a>\n";
     //Arbol
     $vinculos = self::get_vinculos_item($item, $accion);
     if (isset($vinculos[1])) {
         self::mostrar_vinculo($vinculos[1]);
     }
     //Editor
     echo "<a href='#' onclick='return toba_invocar_editor()' {$html_ayuda_editor}>" . toba_recurso::imagen_toba('icono_16.png', true) . "</a>\n";
     echo "</span>";
     echo "</span>";
     echo "<div class='div-editor' style='position:fixed; top: 85px; left: 1px;'>";
     foreach (self::get_vinculos_item($item, $accion) as $vinculo) {
         self::mostrar_vinculo($vinculo);
     }
     echo "</div>";
     if ($enviar_div_wrapper) {
         echo "</div>";
     }
 }
Ejemplo n.º 3
0
echo "<td class='listado-barra-superior-tabi' title='Recarga el Proyecto en el Editor'>";
$js_cambio = "onclick='document.cambiar_proyecto.submit()'";
echo "<a href='#' {$js_cambio}>";
echo toba_recurso::imagen_toba('refrescar.png', true);
echo '</a>';
echo '</td>';
echo "<td class='listado-barra-superior-tabi2'>";
$actual = toba_editor::get_proyecto_cargado();
$instancia = toba_modelo_catalogo::instanciacion()->get_instancia(toba_editor::get_id_instancia_activa(), new toba_mock_proceso_gui());
$proyectos = array();
foreach ($instancia->get_lista_proyectos_vinculados() as $proy) {
    $extra = toba_personalizacion::get_personalizacion_iniciada($proy) ? " (personalizado) " : "";
    $proyectos[$proy] = $proy . $extra;
}
$js_cambio = "onchange='document.cambiar_proyecto.submit()'";
echo toba_form::select('admin_proyecto', $actual, $proyectos, 'ef-combo', $js_cambio);
echo '</td>';
echo "<td class='listado-barra-superior-tabi'>";
$img = toba_recurso::imagen_toba('instanciar.png', true);
echo "<a title='Previsualiza el proyecto' href='javascript: top.frame_control.editor.previsualizar()'>{$img}</a>";
echo '</td>';
?>

		<td><?php 
echo gif_nulo(10, 1);
?>
</td>
		<td><div class='tabla-0 listado-tabc'><table class='tabla-0'>
		<td class='listado-tabi'>
		<a title="Administración de Usuarios" href="#" class="list-obj" onclick='javascript:abrir_toba_instancia();return false;'><?php 
echo toba_recurso::imagen_toba('usuarios/usuario.gif', true);
Ejemplo n.º 4
0
 function generar_html_fs()
 {
     if (!$this->controlador->existe_archivo_log()) {
         echo ei_mensaje('No hay logs registrados para el proyecto ' . "<strong>{$this->controlador->get_proyecto()}</strong>");
         return;
     }
     $seleccion = $this->controlador->s__seleccion;
     $niveles = toba::logger()->get_niveles();
     $niveles = array_reverse($niveles);
     $res = $this->controlador->get_analizador()->get_pedido($seleccion);
     $encabezado = $this->controlador->get_analizador()->analizar_encabezado($res);
     ///CON ESTO PUEDO SACAR OPERACION, PROYECTO, IP, USUARIO ETC
     //--- Opciones
     $selec = $seleccion == 'ultima' ? 'Última solicitud' : "Solicitud {$seleccion}";
     echo '<div>';
     echo "<span class='logger-proyecto' title='{$this->controlador->get_analizador()->get_archivo_nombre()}' style='text-align:right;'>";
     echo ucfirst($this->controlador->get_proyecto());
     echo "<span class='logger-selec'>{$selec}</span>";
     //--- Botones anterior/siguiente
     if ($seleccion != 1) {
         $this->generar_boton('anterior');
     }
     if ($seleccion != 'ultima') {
         $this->generar_boton('siguiente');
         $this->generar_boton('ultima');
     }
     echo '</span>';
     echo "<br><div id='logger_info_operacion'>";
     echo $this->generar_html_info_operacion($res);
     echo '</div>';
     $valor_check = 0;
     if ($this->controlador->get_estado_encabezados() === true) {
         $valor_check = 1;
     }
     $check = toba_form::checkbox('con_encabezados', $valor_check, 1, 'ef-checkbox', " onclick=\"{$this->objeto_js}.evt__con_encabezados__click(this)\" ");
     echo "<label>{$check} Ver Encabezados</label><br>";
     echo "</div><hr style='clear:both' />";
     echo "<div style='clear:both;width:100%;overflow:auto;'>\n";
     list($detalle, $cant_por_nivel) = $this->generar_html_detalles($res);
     $display_encabezados = 'none';
     if ($this->controlador->get_estado_encabezados() === true) {
         $display_encabezados = '';
     }
     //--- Encabezado
     echo "<ul id='logger_encabezados' style='display:{$display_encabezados};list-style-type: none;padding: 0;margin: 0'>";
     echo $this->generar_html_encabezado($res);
     echo '</ul>';
     //---- Niveles
     echo "<div style='clear:both;float:right;margin-left:10px;text-align:center;'>";
     echo '<strong>Niveles</strong>';
     echo "<ul class='logger-opciones'>";
     foreach ($niveles as $nivel) {
         $img = toba_recurso::imagen_proyecto('logger/' . strtolower($nivel) . '.gif', true, null, null, "Filtrar el nivel: {$nivel}");
         $cant = $cant_por_nivel[$nivel] != 0 ? "[{$cant_por_nivel[$nivel]}]" : '';
         echo "<li id='nivel_{$nivel}'><a href='#' onclick='mostrar_nivel(\"{$nivel}\")'>{$img}</a> ";
         echo "<span id='nivel_cant_{$nivel}'>{$cant}</span></li>\n";
     }
     echo '</ul>';
     echo '</div>';
     $proyecto_actual = $this->controlador->get_proyecto();
     $mostrar = $this->controlador->get_seleccion_modo_detalle();
     $lista_valida = array($proyecto_actual => ucfirst($proyecto_actual), 'toba' => 'Nucleo', 'no_seteado' => 'Todos');
     //echo toba_recurso::imagen_proyecto('logger/ver_texto.gif', true, 16, 16, "Ver el texto original del log");
     echo "<div style='clear:both;float:right;margin-left:10px;text-align:center;'><br>";
     echo '<strong>Mostrar mensajes</strong>';
     echo "<ul id='logger_proyectos' class='logger-opciones'>";
     echo '<li>' . toba_form::select('opciones_proyectos', $mostrar, $lista_valida, null, "onchange='{$this->objeto_js}.mostrar_proyecto()'") . '</li>';
     echo '</ul>';
     echo '</div>';
     //--- Detalles
     echo "<ol id='logger_detalle' style='list-style-type:none;padding:0;margin:0;margin-top:10px;'>";
     echo $detalle;
     echo "</ol>\n";
     echo '</div>';
 }
Ejemplo n.º 5
0
 function get_input()
 {
     $html = "";
     //El estado que puede contener muchos datos debe ir en un unico string
     $estado = $this->get_estado_para_input();
     if ($this->es_solo_lectura()) {
         $clase = $this->clase_css . ' ef-input-solo-lectura';
         $html .= toba_form::select("", $estado, $this->opciones, $clase, "disabled");
         $html .= toba_form::hidden($this->id_form, $estado);
     } else {
         $tab = $this->padre->get_tab_index();
         $extra = " tabindex='{$tab}'";
         $js = '';
         if ($this->cuando_cambia_valor != '') {
             $js = "onchange=\"{$this->get_cuando_cambia_valor()}\"";
         }
         $html .= toba_form::select($this->id_form, $estado, $this->opciones, $this->clase_css, $js . $this->input_extra . $extra, $this->categorias);
     }
     $html .= $this->get_html_iconos_utilerias();
     return $html;
 }
Ejemplo n.º 6
0
 /**
  * Genera el HTML de la botonera de agregar/quitar/ordenar filas
  */
 protected function get_botonera_manejo_filas()
 {
     $salida = '';
     $salida = "<div class='ei-filtro-botonera' id='botonera_{$this->objeto_js}'>";
     $texto = toba_recurso::imagen_toba('nucleo/agregar.gif', true);
     $opciones = array(apex_ef_no_seteado => '');
     foreach ($this->_columnas as $columna) {
         $opciones[$columna->get_nombre()] = $columna->get_etiqueta();
     }
     $salida .= 'Agregar filtro ';
     $onchange = "onchange='{$this->objeto_js}.crear_fila()'";
     $salida .= toba_form::select("{$this->objeto_js}_nuevo", null, $opciones, 'ef-combo', $onchange);
     $salida .= "</div>\n";
     return $salida;
 }
Ejemplo n.º 7
0
 function cambio_perfil()
 {
     $perfiles = toba::instancia()->get_datos_perfiles_funcionales_usuario_proyecto(toba::usuario()->get_id(), toba::proyecto()->get_id());
     if (count($perfiles) > 1) {
         //-- Si hay al menos dos perfiles funcionales
         echo '<div class="enc-cambio-proy">';
         $perfiles[] = array('grupo_acceso' => apex_ef_no_seteado, 'nombre' => ' Todos ');
         $datos = rs_convertir_asociativo($perfiles, array('grupo_acceso'), 'nombre');
         $actual = toba::memoria()->get_dato('usuario_perfil_funcional_seleccionado');
         if (is_null($actual)) {
             $actual = apex_ef_no_seteado;
         }
         echo toba_form::abrir('chng_profile', toba::vinculador()->get_url());
         echo toba_form::select(apex_sesion_qs_cambio_pf, $actual, $datos, 'ef-combo', 'onchange="submit();"');
         echo toba_form::cerrar();
         echo '</div>';
     }
 }