protected function info_version() { $version = toba::proyecto()->get_parametro('version'); if ($version && !(toba::proyecto()->get_id() == 'toba_editor')) { $info = ''; $version_fecha = toba::proyecto()->get_parametro('version_fecha'); if ($version_fecha) { $info .= "Lanzamiento: <strong>{$version_fecha}</strong> <br />"; } $version_detalle = toba::proyecto()->get_parametro('version_detalle'); if ($version_detalle) { $info .= "<hr />{$version_detalle}<br>"; } $version_link = toba::proyecto()->get_parametro('version_link'); if ($version_link) { $info .= "<hr /><a href=\\'http://{$version_link}\\' target=\"_bank\">Mas informacion</a><br>"; } if ($info) { $info = "Version: <strong>{$version}</strong><br>" . $info; $info = toba_recurso::ayuda(null, $info, 'enc-version'); } else { $info = "class='enc-version'"; } echo "<div {$info} >"; echo 'Version <strong>' . $version . '</strong>'; echo '</div>'; } }
static function get_icono_abrir_php($archivo) { $parametros = array('archivo' => $archivo); $opciones = array('servicio' => 'ejecutar', 'celda_memoria' => 'ajax', 'validar' => false, 'menu' => true); $vinculo = toba::vinculador()->get_url(toba_editor::get_id(), 3463, $parametros, $opciones); $js = "toba.comunicar_vinculo('{$vinculo}')"; $ayuda = toba_recurso::ayuda(null, 'Abrir la [wiki:Referencia/Objetos/Extension extensión PHP] en el editor del escritorio.' . '<br>Ver [wiki:Referencia/AbrirPhp Configuración]'); return "<img style='cursor:pointer' onclick=\"{$js}\" src='" . toba_recurso::imagen_proyecto('reflexion/abrir.gif', false) . "' {$ayuda}>"; }
function barra_superior() { echo "<div id='barra-superior' class='barra-superior barra-superior-tit barra-popup'>\n"; $info = toba::solicitud()->get_datos_item(); echo "<div class='item-barra'>"; if (trim($info['item_descripcion']) != '') { $desc = toba_parser_ayuda::parsear(trim($info['item_descripcion'])); $ayuda = toba_recurso::ayuda(null, $desc, 'item-barra-ayuda', 0); echo "<div {$ayuda}>"; echo toba_recurso::imagen_toba("ayuda_grande.gif", true); echo "</div>"; } echo "<div class='item-barra-tit'>" . $this->titulo_item() . "</div>"; echo "</div>\n\n"; }
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>"; } }
//ei_arbol($_SESSION, 'SESION', null, true); //--- VERSION echo "<style type='text/css'>\n\t#overlay_contenido {\n\t\twidth: 90%;\n\t}\n\t.overlay-mensaje {\n\t\tmax-height: 100%;\n\t\toverflow: visible;\n\t}\n\tli {\n\t\tpadding-top: 5px;\n\t}\n</style>"; $url_trac = get_url_desarrollos(); $url_login = $url_trac . '/trac/toba/login'; if (isset($_GET['phpinfo'])) { phpinfo(); //} elseif (isset($_POST['chequeo'])) { } else { /*echo toba_form::abrir('toba', toba::vinculador()->get_url()); echo toba_form::submit('chequeo', "Chequear compatibilidad extensiones"); echo toba_form::cerrar();*/ $version = toba_modelo_instalacion::get_version_actual(); $cambios = "{$url_trac}/trac/toba/wiki/Versiones/" . ($version->get_release('.') . '.0'); echo "<div class='logo-inicio'>"; echo toba_recurso::imagen_proyecto('logo.gif', true); echo '<br><br>Editando proyecto <strong>' . toba_editor::get_proyecto_cargado() . '</strong> en la instancia <strong>' . toba_editor::get_id_instancia_activa() . '</strong>.<br>'; $ayuda = toba_recurso::ayuda(null, 'Ver log de cambios introducidos en esta versión'); echo "<a target='wiki' style='text-decoration:none; font-size: 16px; font-weight: bold;margin-top: 25px;float:left' href='{$cambios}' {$ayuda}>Versión "; echo $version->__toString() . '</a>'; $vinc = toba::vinculador()->get_url(null, null, array('phpinfo' => 1)); echo "<a style='text-decoration:none; float:right; text-align: center; ' href='{$vinc}' title='Ver información acerca de la instalación PHP de este servidor'>"; echo toba_recurso::imagen_proyecto('php-med-trans.png', true); echo '<br>' . phpversion(); echo '</a>'; if (!toba_manejador_archivos::es_windows()) { //Por ahora este mécanismo sólo funciona en linux controlar_usuario(); } echo '</div>'; }
static function button_html($nombre, $html, $extra = "", $tab = null, $tecla = null, $tip = '', $tipo = 'button', $valor = '', $clase = "ei-boton", $con_id = true, $estilo_inline = null, $habilitado = true) { $acceso = toba_recurso::ayuda($tecla, $tip, $clase); $tab = isset($tab) && $tab != 0 ? "tabindex='{$tab}'" : ""; $id = $con_id ? "id='{$nombre}'" : ''; $estilo_inline = isset($estilo_inline) ? "style='" . $estilo_inline . "'" : ''; $habilitado = $habilitado ? '' : 'DISABLED'; return "<button type='{$tipo}' name='{$nombre}' {$id} value='{$valor}' {$tab} {$acceso} {$extra} {$estilo_inline} {$habilitado}>" . "<span>{$html}</span></button>\n"; }
/** * @ignore */ public function mostrar_nodo(toba_nodo_arbol $nodo, $es_visible) { $salida = $this->mostrar_utilerias($nodo); $salida .= $this->mostrar_cambio_expansion($nodo, $es_visible); $salida .= $this->mostrar_iconos($nodo); //Nombre y ayuda $corto = $this->acortar_nombre($nodo->get_nombre_corto()); $id = $nodo->get_id(); $largo = $nodo->get_nombre_largo(); $extra = $nodo->get_info_extra(); if ($this->_mostrar_ayuda && ($largo || $id || $extra)) { $title = "<b>Nombre</b>: {$largo}<br /><b>Id</b>: {$id}"; if ($extra != '') { $title .= "<hr />{$extra}"; } $ayuda = toba_recurso::ayuda(null, $title, 'ei-arbol-nombre'); if (get_class($nodo) == 'toba_ci_pantalla_info') { $nombre = "<span {$ayuda}>{$id}</span>"; } else { $nombre = "<span {$ayuda}>{$corto}</span>"; } } else { $nombre = $corto; } if ($this->_mostrar_propiedades_nodos && $nodo->tiene_propiedades()) { $salida .= "<a href='#' onclick='{$this->objeto_js}.ver_propiedades(\"" . $nodo->get_id() . "\");' " . "class='ei-arbol-ver-prop'>{$nombre}</a>"; } else { $salida .= $nombre; } return $salida; }
/** * Retorna el HTML del tab * * @param string $tipo 'V' para vertical o 'H' para horizontal * @param string $id_submit Id. unico del contenedor (utilizado para formar el id del tab) * @param string $id_componente Id. de js del componente contenedor * @param boolean $seleccionado * @param string $editor */ function get_html($tipo, $id_submit, $id_componente, $seleccionado, $editor = '') { if ($this->anulado) { return null; } if ($tipo != 'V' && $tipo != 'H') { throw new toba_error_def("Los tipos validos de TABS son 'V' y 'H'."); } static $id_tab = 1; $evento = $this->datos['identificador']; $contenido = ''; $tab_order = toba_manejador_tabs::instancia()->siguiente(); $img = $this->get_imagen(); if (!isset($img) && $tipo == 'H') { $img = gif_nulo(1, 16); } $contenido .= $img . ' '; $tip = $this->datos['ayuda']; $acceso = tecla_acceso($this->datos['etiqueta']); $contenido .= $acceso[0]; $tecla = $acceso[1]; if (!isset($tecla) && $id_tab < 10) { $tecla = $id_tab; } $tip = str_replace("'", "\\'", $tip); $acceso = toba_recurso::ayuda($tecla, $tip); $id = $id_submit . '_cambiar_tab_' . $evento; $js = "onclick=\"{$id_componente}.ir_a_pantalla('{$evento}');return false;\""; $js_extra = ''; if ($this->activado) { $clase_boton = ''; } else { $clase_boton = 'ci-tabs-boton-desact'; } if ($tipo == 'H') { //********************* TABs HORIZONTALES ********************** if ($seleccionado) { // -- Tab ACTUAL -- $estilo_li = 'background:url("' . toba_recurso::imagen_skin('tabs/left_on.gif') . '") no-repeat left top;'; $estilo_a = 'background:url("' . toba_recurso::imagen_skin('tabs/right_on.gif') . '") no-repeat right top;'; $html = "<li class='ci-tabs-h-solapa-sel'>{$editor}"; $html .= "<a href='#' id='{$id}' {$acceso}>{$contenido}</a>"; $html .= "</li>"; } else { $oculto = $this->oculto ? '; display: none' : ''; $estilo_li = 'background:url("' . toba_recurso::imagen_skin('tabs/left.gif') . '") no-repeat left top;'; $estilo_a = 'background:url("' . toba_recurso::imagen_skin('tabs/right.gif') . '") no-repeat right top;'; $html = "<li class='ci-tabs-h-solapa' style='{$oculto}'>{$editor}"; $html .= "<a href='#' id='{$id}' class='{$clase_boton}' {$acceso} {$js}>{$contenido}</a>"; $html .= "</li>"; $html .= $js_extra; } } else { // ********************* TABs VERTICALES ************************ if ($seleccionado) { // -- Tab ACTUAL -- $html = "<div class='ci-tabs-v-solapa-sel'><div class='ci-tabs-v-boton-sel'>{$editor} "; $html .= "<div id='{$id}'>{$contenido}</div>"; $html .= "</div></div>"; } else { $clase_extra = ''; if (!$this->activado) { $clase_extra = 'ci-tabs-v-desactivado'; } $oculto = $this->oculto ? "style='display: none'" : ''; $html = "<div class='ci-tabs-v-solapa {$clase_extra}' {$oculto} >{$editor} "; $html .= "<a href='#' id='{$id}' {$clase_extra} {$acceso} {$js}>{$contenido}</a>"; $html .= "</div>"; $html .= $js_extra; } } $id_tab++; return $html; }