/** * Generación de salida HTML para el contenedor de gadgets. */ function generar_html() { if (!empty($this->gadgets)) { $this->configurar_consumos_globales_js(); echo toba_recurso::link_css('gadgets', 'screen'); echo "<div id='gadgets-container' class='gadgets-container'>"; $this->generar_html_gadgets(); echo '</div>'; echo toba_js::abrir(); echo ' var gc = document.getElementById("gadgets-container"); var e; if(document.getElementsByClassName) { e = document.getElementsByClassName("encabezado")[0]; } else { var divs = document.getElementsByTagName("div"); for(var i in divs) { if(divs[i].className == "encabezado") { e = divs[i]; break; } } } gc.style.top = (e.clientHeight + 5)+"px"; '; echo toba_js::cerrar(); } }
protected function preparar_arbol() { if (toba::memoria()->get_celda_memoria_actual_id() != 'paralela') { $this->arbol .= toba_js::abrir(); $this->arbol .= ' function on_menu_set_popup_on(e) { var id = (window.event) ? event.keyCode : e.keyCode; if (id == 16) { toba.set_menu_popup(true); } } function on_menu_set_popup_off(e) { var id = (window.event) ? event.keyCode : e.keyCode; if (id == 16) { toba.set_menu_popup(false); } } agregarEvento(document, "keyup", on_menu_set_popup_off); agregarEvento(document, "keydown", on_menu_set_popup_on); '; $this->arbol .= toba_js::cerrar(); } $id_tag = $this->modo_prueba ? 'prueba' : 'id_menu'; $this->arbol .= "\n<div class='m_m' id='{$id_tag}' style=''>\n"; $this->buscar_raiz(); $this->arbol .= "</div>"; }
static function redireccionar_a_editor_objeto($proyecto, $objeto) { $clave = array('componente' => $objeto, 'proyecto' => $proyecto); $vinculo = toba_constructor::get_info($clave)->vinculo_editor(); admin_util::refrescar_editor_item(); echo toba_js::abrir(); echo "window.location.href='{$vinculo}'\n"; echo toba_js::cerrar(); }
function generar_html() { $orden = $this->get_orden(); $url = $this->get_gadget_url(); $titulo = $this->get_titulo(); echo "<div id='gadget-chrome-{$orden}' class='gadgets-gadget-chrome'></div>\n"; echo toba_js::abrir(); echo "\n\t\t\tvar gadget{$orden} = gadgets.container.createGadget({specUrl: '{$url}', title: '{$titulo}', elim: " . ($this->es_eliminable() ? 'true' : 'false') . "});\n\t\t\tgadgets.container.addGadget(gadget{$orden});\n\n\t\t\tif (typeof gadgets.container.layoutManager.gadgetChromeIds_ == 'undefined') {\n\t\t\t\tgadgets.container.layoutManager.gadgetChromeIds_ = [];\n\t\t\t}\n\t\t\tgadgets.container.layoutManager.gadgetChromeIds_.push('gadget-chrome-{$orden}');\n\n\t\t\tgadgets.container.renderGadget(gadget{$orden});\n\t\t"; echo toba_js::cerrar(); }
function servicio__ejecutar() { toba::memoria()->desactivar_reciclado(); $id_nodo = toba::memoria()->get_parametro('id_nodo'); $nodo = $this->reportar_evento_interno('cargar_nodo', $id_nodo); if (isset($nodo) && $nodo !== apex_ei_evt_sin_rpta) { $html = $this->recorrer_hijos(current($nodo), 0); $html .= '[--toba--]'; $html .= toba_js::abrir(); $html .= $this->actualizar_estado_js(current($nodo)); $html .= toba_js::cerrar(); $html .= '[--toba--]'; echo $html; } else { toba::logger()->warning("toba_ei_arbol: No se pudo obtener el nodo que representa al ID {$id_nodo}"); } }
function generar_layout() { $tipos_rs = toba_info_editores::get_lista_tipo_molde(); $tipos = array(); foreach ($tipos_rs as $tipo) { $tipos[$tipo['operacion_tipo']] = array('descripcion' => $tipo['descripcion'], 'vista_previa' => toba_recurso::imagen_proyecto($tipo['vista_previa'], false)); } echo toba_js::abrir(); echo 'var tipos_operacion = ' . toba_js::arreglo($tipos, true, true) . "\n"; echo toba_js::cerrar(); $this->dep('form_tipo_operacion')->generar_html(); //$this->generar_botones(); //$this->generar_boton('siguiente_editar'); echo "<div style='background-color: #808080;padding-bottom: 15px;margin-top: 5px; color: white; text-align:center; font-size:12px; font-weight: bold;'><hr>"; echo "<div id='operacion_descripcion'></div>"; echo "<div id='operacion_vista_previa' style='display:none; padding-top:10px;'></div>"; echo '</div>'; }
protected function preparar_arbol() { if (toba::memoria()->get_celda_memoria_actual_id() != 'paralela') { $this->arbol .= toba_js::abrir(); $this->arbol .= ' function on_menu_set_popup_on(e) { var id = (window.event) ? event.keyCode : e.keyCode; if (id == 16) { toba.set_menu_popup(true); } } function on_menu_set_popup_off(e) { var id = (window.event) ? event.keyCode : e.keyCode; if (id == 16) { toba.set_menu_popup(false); } } agregarEvento(document, "keyup", on_menu_set_popup_off); agregarEvento(document, "keydown", on_menu_set_popup_on); '; $this->arbol .= toba_js::cerrar(); } $this->arbol .= ' <style type="text/css"> ul.horizontal .carpeta { background-repeat: no-repeat; background-position: center right; background-image: url("' . $this->imagen_nodo . '"); } </style> <!--[if IE 7]> <style type="text/css"> ul.horizontal ul ul { margin-left: 200px; } </style> <![endif]--> '; $id_tag = $this->modo_prueba ? 'prueba' : 'menu-h'; $this->arbol .= "\n<ul id='{$id_tag}' class='horizontal'>\n"; //-- Recorro para encontrar la raiz $this->buscar_raiz(); $this->arbol .= "</ul>"; }
function mostrar() { $this->preparar_arbol(); echo $this->arbol; if ($this->hay_algun_item) { $consumos = array('yui/yahoo/yahoo-min', 'yui/dom/dom-min', 'yui/event/event-min', 'yui/container/container-min', 'yui/menu/menu-min'); toba_js::cargar_consumos_globales($consumos); echo toba_js::abrir(); echo ' // "load" event handler for the window YAHOO.example.onWindowLoad = function(p_oEvent) { // "click" event handler for each item in the root MenuBar instance function onMenuBarItemClick(p_sType, p_aArguments) { this.parent.hasFocus = true; var oActiveItem = this.parent.activeItem; // Hide any other submenus that might be visible if(oActiveItem && oActiveItem != this) { this.parent.clearActiveItem(); } // Select and focus the current MenuItem instance this.cfg.setProperty("selected", true); this.focus(); // Show the submenu for this instance var oSubmenu = this.cfg.getProperty("submenu"); if(oSubmenu) { if(oSubmenu.cfg.getProperty("visible")) { oSubmenu.hide(); } else { oSubmenu.show(); } } } // "mouseover" event handler for each item in the root MenuBar instance function onMenuBarItemMouseOver(p_sType, p_aArguments) { var oActiveItem = this.parent.activeItem; // Hide any other submenus that might be visible if(oActiveItem && oActiveItem != this) { this.parent.clearActiveItem(); } // Select and focus the current MenuItem instance this.cfg.setProperty("selected", true); this.focus(); if(this.parent.hasFocus) { // Show the submenu for this instance var oSubmenu = this.cfg.getProperty("submenu"); if(oSubmenu) { if( oSubmenu.cfg.getProperty("visible") && oSubmenu != oActiveItem.cfg.getProperty("submenu") ) { oSubmenu.hide(); } else { oSubmenu.show(); } } } } var oMenuBar = new YAHOO.widget.MenuBar("menu_principal", {width:"80%"}); oMenuBar.render(); /* Add a "click" and "mouseover" event handler to each item in the root MenuBar instnace */ var i = oMenuBar.getItemGroups()[0].length - 1, oMenuBarItem; do { oMenuBarItem = oMenuBar.getItem(i); if(oMenuBarItem) { oMenuBarItem.clickEvent.subscribe( onMenuBarItemClick, oMenuBarItem, true ); oMenuBarItem.mouseOverEvent.subscribe( onMenuBarItemMouseOver, oMenuBarItem, true ); } } while(i--); // "click" event handler for the document function onDocumentClick(p_oEvent) { var oTarget = YAHOO.util.Event.getTarget(p_oEvent); if( oTarget != oMenuBar.element && !YAHOO.util.Dom.isAncestor(oMenuBar.element, oTarget) ) { oMenuBar.hasFocus = false; if(oMenuBar.activeItem) { var oSubmenu = oMenuBar.activeItem.cfg.getProperty("submenu"); if(oSubmenu) { oSubmenu.hide(); } oMenuBar.clearActiveItem(); oMenuBar.activeItem.blur(); } } } // Add a "click" handler for the document YAHOO.util.Event.addListener( document, "click", onDocumentClick ); } // Add a "load" handler for the window YAHOO.util.Event.addListener(window, "load", YAHOO.example.onWindowLoad); '; echo toba_js::cerrar(); } }
/** * @ignore */ protected function generar_utilidades_impresion_html() { $id_frame = "{$this->_submit}_print"; echo "<iframe style='position:absolute;width: 0px; height: 0px; border-style: none;' " . "name='{$id_frame}' id='{$id_frame}' src='about:blank'></iframe>"; echo toba_js::abrir(); echo "\n\t\tfunction imprimir_html( url, forzar_popup )\n\t\t{\n\t\t\tvar usar_popup = (forzar_popup) ? true : false ;\n\t\t\tvar f = window.frames.{$id_frame}.document;\n\t\t\tif ( f && !usar_popup ) {\n\t\t\t var html = '';\n\t\t\t html += '<html>';\n\t\t\t html += '<body onload=\"parent.printFrame(window.frames.urlToPrint);\">';\n\t\t\t html += '<iframe name=\"urlToPrint\" src=\"' + url + '\"><\\/iframe>';\n\t\t\t html += '<\\/body><\\/html>';\n\t\t\t f.open();\n\t\t\t f.write(html);\n\t\t\t f.close();\n\t\t\t} else {\n\t\t\t\tsolicitar_item_popup( url, 650, 500, 'yes', 'yes');\n\t\t\t}\n\t\t}\n\t\tfunction printFrame (frame) {\n\t\t if (frame.print) {\n\t\t frame.focus();\n\t\t frame.print();\n\t\t }\n\t\t}\n\t\t"; echo toba_js::cerrar(); }
/** * Genera el tag HTML necesario para incluir el archivo generado por GrahpViz * @param string $url * @param string $formato * @param string $ancho * @param string $alto */ static function generar_sentencia_incrustacion($url, $formato, $ancho = null, $alto = null, $incluir_mapa = null, $objeto_js = null) { if (!$incluir_mapa || !($ancho && $alto)) { $ancho = isset($ancho) ? "width='{$ancho}'" : ""; $alto = isset($alto) ? "height='{$alto}'" : ""; switch ($formato) { case 'png': case 'gif': echo "<img src='{$url}' {$ancho} {$alto} border='0'>"; break; case 'svg': /*toba_js::cargar_consumos_globales(array("utilidades/svglib")); echo toba_js::abrir(); echo "//aviso_instalacion_svg()"; echo toba_js::cerrar(); */ echo "<embed src='{$url}' type='image/svg+xml' {$ancho} {$alto} palette='foreground' pluginspage='http://www.adobe.com/svg/viewer/install/auto'>\n"; echo "</embed>"; break; } } else { //Sacamos el ratio (el lado mas largo del mapa tendrá 100px) /* $ratio = ($ancho>$alto)?100/$ancho:100/$alto; $alto_mapa = $alto*$ratio; $ancho_mapa = $ancho*$ratio;*/ if (substr($alto, -2) == 'px') { $alto = substr($alto, 0, -2); } if (substr($ancho, -2) == 'px') { $ancho = substr($ancho, 0, -2); } switch ($formato) { case 'png': case 'gif': $imagen_real = "<img id='imagen_real_{$objeto_js}' src='{$url}' border='0'>"; $imagen_mapa = "<img id='imagen_mapa_{$objeto_js}' src='{$url}' border='0'>"; break; case 'svg': /*toba_js::cargar_consumos_globales(array("utilidades/svglib")); echo toba_js::abrir(); echo "//aviso_instalacion_svg()"; echo toba_js::cerrar(); */ $imagen_real = "<embed id='imagen_real_{$objeto_js}' src='{$url}' type='image/svg+xml' palette='foreground' pluginspage='http://www.adobe.com/svg/viewer/install/auto'></embed>"; $imagen_mapa = "<embed id='imagen_mapa_{$objeto_js}' src='{$url}' type='image/svg+xml' palette='foreground' pluginspage='http://www.adobe.com/svg/viewer/install/auto'></embed>"; break; } echo "\n\t\t\t<div class='ei-barra-sup ci-barra-sup ei-barra-sup-sin-botonera' style='height: 20px; width: {$ancho}px; color: white; position: relative'>\n\t\t\t\t<span id='colapsado_mapa_{$objeto_js}' style='position: absolute; width: 16px; height: 16px; left: 0px; text-align: center; padding: 2px'>" . toba_recurso::imagen_toba('colapsado.gif', true) . "</span>\n\t\t\t\t<div style='height: 20px;position: absolute; left: 20px; width: " . ($ancho - 20) . "px'> \n\t\t\t\t\t<span id='escala_mapa_{$objeto_js}' style='position: absolute; width: 16px; height: 16px; right: 0px; text-align: center; padding: 2px; border-right: 1px solid black'>" . toba_recurso::imagen_toba('transform-move.png', true) . "</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style='height: {$alto}px; width: {$ancho}px; position: relative'>\n\t\t\t\t<div id='marco_{$objeto_js}' style='height: {$alto}px; width: {$ancho}px; overflow: hidden; position: absolute; top: 0: left: 0;'>\n\t\t\t\t\t{$imagen_real}\n\t\t\t\t</div>\n\t\t\t\t<div id='mapa_{$objeto_js}' style='position: absolute; top: 0; left: 0; border: 1px solid black; overflow: hidden'>\n\t\t\t\t\t<div id='lupa_{$objeto_js}' style='position: absolute; top: 0: left: 0; border: 1px solid red'></div>\n\t\t\t\t\t{$imagen_mapa}\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>"; $tam_mapa = ''; if (substr($incluir_mapa, -1) == '%') { $tam_mapa = ($alto < $ancho ? $alto : $ancho) * (int) substr($incluir_mapa, 0, -1) / 100; } elseif (strtolower(substr($incluir_mapa, -2)) == 'px') { $tam_mapa = substr($incluir_mapa, 0, -2); } else { $tam_mapa = $incluir_mapa; } echo toba_js::incluir(toba_recurso::js('basicos/jquery-1.9.1.min.js')); echo toba_js::incluir(toba_recurso::js('utilidades/jquery-ui-1.10.1.custom.min.js')); echo toba_js::abrir(); echo "\n\t\t\tdocument.readyFunc = function(e) {\n\t\t\t\t\n\t\t\t\tvar img_real = document.getElementById('imagen_real_{$objeto_js}');\n\t\t\t\tif (img_real.clientHeight > 0 && img_real.clientWidth > 0) {\n\t\t\t\t\n\t\t\t\t\tvar marco = document.getElementById('marco_{$objeto_js}');\n\t\t\t\t\tvar mapa = document.getElementById('mapa_{$objeto_js}');\n\t\t\t\t\tvar escala = document.getElementById('escala_mapa_{$objeto_js}');\n\t\t\t\t\tvar colapsado = document.getElementById('colapsado_mapa_{$objeto_js}');\n\t\t\t\t\tvar lupa = document.getElementById('lupa_{$objeto_js}');\n\t\t\t\t\tvar img_mapa = document.getElementById('imagen_mapa_{$objeto_js}');\n\t\t\t\t\tvar ancho_mapa = 200 > marco.clientHeight?marco.clientHeight:200;\n\t\t\t\t\tvar ratio;\n\t\t\t\t\tvar alto_mapa;\n\t\t\t\t\tif(marco.clientHeight > img_real.clientHeight && marco.clientWidth > img_real.clientWidth) {\n\t\t\t\t\t\tescala.style.display = 'none';\n\t\t\t\t\t\tmapa.style.display = 'none';\n\t\t\t\t\t}\n\t\t\t\t\tvar escalar_{$objeto_js} = function(skipImg) {\n\t\t\t\t\t\tratio = ancho_mapa/img_real.clientWidth;\n\t\t\t\t\t\talto_mapa = img_real.clientHeight*ratio;\n\t\t\t\t\t\tif(alto_mapa > marco.clientHeight) {\n\t\t\t\t\t\t\tratio = marco.clientHeight/img_real.clientHeight;\n\t\t\t\t\t\t\talto_mapa = img_real.clientHeight*ratio;\n\t\t\t\t\t\t\tancho_mapa = img_real.clientWidth*ratio;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmapa.style.height= alto_mapa+'px';\n\t\t\t\t\t\tmapa.style.width= ancho_mapa+'px';\n\t\t\t\t\t\tescala.style.left= (ancho_mapa-39)+'px';\n\t\t\t\t\t\tif(!skipImg) {\n\t\t\t\t\t\t\timg_mapa.style.height= alto_mapa+'px';\n\t\t\t\t\t\t\timg_mapa.style.width= ancho_mapa+'px';\n\t\t\t\t\t\t\tlupa.style.height=((marco.clientHeight*ratio)-2)+'px';//-2: Hay que tener en cuenta el borde\n\t\t\t\t\t\t\tlupa.style.width=((marco.clientWidth*ratio)-2)+'px';\n\t\t\t\t\t\t\tlupa.style.top=(marco.scrollTop*ratio)+'px';\n\t\t\t\t\t\t\tlupa.style.left=(marco.scrollLeft*ratio)+'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tescalar_{$objeto_js}();\n\t\t\t\t\t\n\t\t\t\t\tlupa.date = new Date();\n\t\t\t\t\t\$(lupa).draggable({\n\t\t\t\t\t\tcontainment: 'parent',\n\t\t\t\t\t\t/*drag: function() {\n\t\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t\t\tif(d.getTime() - lupa.date.getTime() > 100) {\n\t\t\t\t\t\t\t\tvar t = parseInt(lupa.style.top.substr(0, lupa.style.top.length-2))/ratio; \n\t\t\t\t\t\t\t\tvar l = parseInt(lupa.style.left.substr(0, lupa.style.left.length-2))/ratio;\n\t\t\t\t\t\t\t\tmarco.scrollTop = t;\n\t\t\t\t\t\t\t\tmarco.scrollLeft = l;\n\t\t\t\t\t\t\t\tlupa.date = d;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t},*/ \n\t\t\t\t\t\tstop: function() {\n\t\t\t\t\t\t\tvar t = parseInt(lupa.style.top.substr(0, lupa.style.top.length-2))/ratio; \n\t\t\t\t\t\t\tvar l = parseInt(lupa.style.left.substr(0, lupa.style.left.length-2))/ratio;\n\t\t\t\t\t\t\tmarco.scrollTop = t;\n\t\t\t\t\t\t\tmarco.scrollLeft = l;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\$(colapsado).click(function() {\n\t\t\t\t\t\t\$(mapa).slideToggle('slow', function() {\n\t\t\t\t\t\t\tescala.style.display = this.style.display;\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\t\$(escala).draggable({\n\t\t\t\t\t\tcontainment: 'parent', \n\t\t\t\t\t\taxis: 'x',\n\t\t\t\t\t\tdrag: function() {\n\t\t\t\t\t\t\tvar left = escala.style.left;\n\t\t\t\t\t\t\tancho_mapa = parseInt(left.substr(0, left.length - 2))+39;\n\t\t\t\t\t\t\tescalar_{$objeto_js}(true);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstop: function() {\n\t\t\t\t\t\t\tescalar_{$objeto_js}();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\$(img_mapa).click(function(event) {\n\t\t\t\t\t\tvar x = event.offsetX?event.offsetX:event.layerX;\n\t\t\t\t\t\tvar y = event.offsetY?event.offsetY:event.layerY;\n\t\t\t\t\t\tvar lh = parseInt(lupa.style.height.substr(0, lupa.style.height.length-2)); \n\t\t\t\t\t\tvar lw = parseInt(lupa.style.width.substr(0, lupa.style.width.length-2));\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar l = x - (lw/2) - 1; //-1: Hay que tener en cuenta el borde \n\t\t\t\t\t\tvar t = y - (lh/2) - 1; \n\t\t\t\t\t\tif(l < 0) {\n\t\t\t\t\t\t\tl = 0;\n\t\t\t\t\t\t} else if (l + lw + 2 > ancho_mapa) {\n\t\t\t\t\t\t\tl = ancho_mapa - lw - 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(t < 0) {\n\t\t\t\t\t\t\tt = 0;\n\t\t\t\t\t\t} else if (t + lh + 2 > alto_mapa) {\n\t\t\t\t\t\t\tt = alto_mapa - lh - 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlupa.style.top = t+'px';\n\t\t\t\t\t\tlupa.style.left = l+'px';\n\t\t\t\t\t\tmarco.scrollTop = t/ratio;\n\t\t\t\t\t\tmarco.scrollLeft = l/ratio;\n\t\t\t\t\t});\n\t\t\t\t} else { \n\t\t\t\t\tsetTimeout('\$(document).ready(document.readyFunc)', 100);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\$(document).ready(document.readyFunc);\n\t\t\t"; echo toba_js::cerrar(); } }
/** * Servicio común de generación html */ protected function servicio__generar_html($objetos) { //--- 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 "</div>"; //---- Se finaliza aqui el div de la barra superior echo '<div style="clear:both;"></div>'; echo "</div>"; //-- Se finaliza aqui el div del encabezado, por la optimizacion del pre-servicio.. $this->tipo_pagina()->pre_contenido(); //--- Abre el formulario $accion = $this->info['basica']['item_act_accion_script']; if ($accion == '') { $extra = "onsubmit='return false;'"; if (!$this->autocomplete) { $extra .= " autocomplete='off'"; } echo toba_form::abrir("formulario_toba", toba::vinculador()->get_url(), $extra); toba_manejador_sesiones::enviar_csrf_hidden(); //HTML foreach ($objetos as $obj) { //-- Librerias JS necesarias toba_js::cargar_consumos_globales($obj->get_consumo_javascript()); //-- HTML propio del objeto $obj->generar_html(); } //Javascript echo toba_js::abrir(); try { toba_js::cargar_definiciones_runtime(); foreach ($objetos as $obj) { $objeto_js = $obj->generar_js(); echo "\n{$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); } echo toba_js::cerrar(); //--- Fin del form y parte inferior del tipo de página echo toba_form::cerrar(); } else { echo toba_js::abrir(); toba_js::cargar_definiciones_runtime(); echo toba_js::cerrar(); include $accion; } $this->tipo_pagina()->post_contenido(); // Carga de componentes JS genericos echo toba_js::abrir(); toba::vinculador()->generar_js(); toba::notificacion()->mostrar(false); toba::acciones_js()->generar_js(); $this->generar_analizador_estadistico(); echo toba_js::cerrar(); //--- Parte inferior de la zona if ($this->hay_zona() && $this->zona->cargada()) { $this->zona->generar_html_barra_inferior(); } $this->tipo_pagina()->pie(); }
/** * @ignore */ protected function dump_esquema_relaciones($nodo) { $datos = $nodo->getData(); $diagrama = ''; foreach ($nodo->getNeighbours() as $nodo_vecino) { $datos_vecino = $nodo_vecino->getData(); //Busco los toba_relacion_entre_tablas correspondientes $hijo_id = $datos_vecino['identificador']; $padre_id = $datos['identificador']; $relacion = $this->_relaciones[$padre_id . "-" . $hijo_id]; $mapeo = $relacion->get_mapeo_filas(); //Incluyo el mapeo en JS para poder dumpearlo $var_mapeo = $padre_id . "_" . $hijo_id . self::$debug_pasadas; echo toba_js::abrir(); echo "var {$var_mapeo} = " . toba_js::arreglo($mapeo, true) . ";\n"; echo toba_js::cerrar(); //Calculo la cantidad de filas padres e hijas involucradas en la relación $cant_padres = 0; $cant_hijos = 0; $mapeo_hijos = array(); foreach ($mapeo as $padre => $hijos) { if (count($hijos) > 0) { $cant_padres++; } $mapeo_hijos = array_merge($mapeo_hijos, $hijos); } $cant_hijos = count(array_unique($mapeo_hijos)); //Incluyo la relación $diagrama .= $padre_id . " -> " . $hijo_id . " [fontsize=6,color=gray, label=\"{$cant_padres} - {$cant_hijos}\"" . ",URL=\"javascript: padre=(window.parent.var_dump)? window.parent : window;padre.var_dump(padre.{$var_mapeo})\"];\n"; } return $diagrama; }
/** * Incluye una serie de librerías o consumos javascript * @param array $consumos Lista de consumos, un consumo es el path relativo a www/js, sin la ext. js */ static function cargar_consumos_globales($consumos) { $consumos = array_unique($consumos); foreach ($consumos as $consumo) { //Esto asegura que sólo se puede cargar una vez if (!in_array($consumo, self::$cargados)) { self::$cargados[] = $consumo; switch ($consumo) { //--> Expresiones regulares movidas a basico.js case 'ereg_nulo': case 'ereg_numero': break; ///--> Excepciones a la validacion del cuit, al ser dinamicas no se pueden meter en un .js ///--> Excepciones a la validacion del cuit, al ser dinamicas no se pueden meter en un .js case 'ef_cuit_excepciones': $excepciones = toba_ef_cuit::get_excepciones(); echo toba_js::abrir(); echo 'var ef_cuit_excepciones =' . toba_js::arreglo($excepciones, false); echo toba_js::cerrar(); break; //--> Por defecto carga el archivo del consumo //--> Por defecto carga el archivo del consumo default: $instalacion = toba_instalacion::instancia(); if (!$instalacion->es_js_comprimido()) { echo toba_js::incluir(toba_recurso::js("{$consumo}.js")); } else { //-- ¿Es algo comprimido? $comprimido = false; foreach (self::$consumos_compr as $compr) { if (strpos($consumo, $compr) !== false) { $comprimido = true; break; } } if (!$comprimido) { echo toba_js::incluir(toba_recurso::js("{$consumo}.js")); } elseif (!self::$comprimido_cargado) { //--- Es el comprimido y nunca se cargo, entonces cargarlo $archivo = 'toba_' . $instalacion->get_numero_version() . '.js'; echo toba_js::incluir(toba_recurso::js($archivo)); self::$comprimido_cargado = true; } } break; } } } }
/** * Muestra una confirmación antes de navegar a cualquier opción del menú * * @param string $mensaje Mensaje que se utiliza para la confirmación * @param boolean $forzar Si es verdadero siempre muestra la confirmación, sino depende de si algún ef de algún formulario fue modificado */ function set_modo_confirmacion($mensaje, $forzar = true) { if ($this->menu_enviado) { echo toba_js::abrir(); if ($forzar) { $confirmar = "var confirmar = true;"; } else { $confirmar = "\n\t\t\t\t\t\t\tvar confirmar = toba.hay_cambios();\n\t\t\t\t\t\t"; } echo "\n\t\t\t\t\t\tfunction confirmar_cambios(proyecto, operacion, url, es_popup) {\n\t\t\t\t\t\t\tif (! es_popup || typeof(es_popup) == 'undefined') {\n\t\t\t\t\t\t\t\t{$confirmar}\n\t\t\t\t\t\t\t\tif (confirmar) {\n\t\t\t\t\t\t\t\t\treturn confirm('{$mensaje}');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttoba.set_callback_menu(confirmar_cambios);\n\t\t\t\t\t"; echo toba_js::cerrar(); } }
/** * Muestra toda la lista de notificaciones almacenadas * Esto tiene que hacerse una única vez por página, y por lo generar el framework * es el encargado de hacerlo */ function mostrar($incluir_comsumos = true) { if ($incluir_comsumos) { toba_js::cargar_consumos_basicos(); //Por si no se cargaron antes toba_js::cargar_consumos_globales(array("basicos/notificacion")); echo toba_js::abrir(); } foreach ($this->mensajes as $mensaje) { $texto = toba_parser_ayuda::parsear($mensaje[0]); $texto = str_replace("'", '"', $texto); $texto = toba_js::string($texto); //Mensaje para debug if (isset($mensaje[2]) && trim($mensaje[2]) != '') { $texto_debug = toba_parser_ayuda::parsear($mensaje[2]); $texto_debug = str_replace("'", '"', $texto_debug); $texto_debug = toba_js::string($texto_debug); echo "notificacion.agregar('{$texto}' + '\\n', '{$mensaje[1]}', undefined, '{$texto_debug}');\n"; } else { echo "notificacion.agregar('{$texto}' + '\\n', '{$mensaje[1]}');\n"; } } if (isset($this->titulo)) { echo "notificacion.set_titulo_ventana('{$this->titulo}');\n"; } echo "notificacion.mostrar();\n"; if ($incluir_comsumos) { echo toba_js::cerrar(); } }
/** * Genera un salto de javascript directo a una pagina * * @param string $item_proyecto Proyecto al que pertenece el ítem destino (por defecto el actual) * @param string $item ID. del ítem destino (por defecto el actual) * @param array $parametros Parametros pasados a la OPERACION (Array asociativo de strings) * @param boolean $zona Activa la propagacion automatica del editable de la ZONA * @param boolean $cronometrar Indica si la solicitud generada por este vinculo debe cronometrarse * @return string Comando JS que contiene el salto de página */ function navegar_a($item_proyecto = "", $item = "", $parametros = null, $zona = false, $cronometrar = false) { echo toba_js::abrir(); echo "document.location.href='" . $this->get_url($item_proyecto, $item, $parametros, array('zona' => $zona, 'cronometrar' => $cronometrar)) . "'\n"; echo toba_js::cerrar(); }
<?php $js_cambiar_color_1 = " onmouseover=\"this.className='listado-tabn-m';\" " . " onmouseout=\"this.className='listado-tabn';\""; $js_cambiar_color_2 = " onmouseover=\"this.className='listado-barra-superior-tabn-m';\" " . " onmouseout=\"this.className='listado-barra-superior-tabn';\""; if (isset($_POST['admin_proyecto'])) { toba_editor::set_proyecto_cargado($_POST['admin_proyecto']); toba::memoria()->set_dato_instancia('proyecto', $_POST['admin_proyecto']); $opciones = array('validar' => false); $vinculo = toba::vinculador()->get_url(toba_editor::get_id(), 1000231, array(), $opciones); //-- Fuerza a recargar los datos de instalacion e instancia toba_manejador_sesiones::recargar_info_instalacion(); toba_manejador_sesiones::recargar_info_instancia(); //--- Refresca los otros frames echo toba_js::abrir(); echo "top.location.href = '{$vinculo}';"; echo toba_js::cerrar(); } echo toba_form::abrir('cambiar_proyecto', ''); toba::manejador_sesiones()->enviar_csrf_hidden(); ?> <style type='text/css'> .ci-tabs-h-lista a { padding: 5px 10px 2px 3px; min-height: 20px; } #barra_superior { display:none; } </style> <script type="text/javascript" language='javascript'>
/** * Genera el HTML que posibilita cambiar entre procesos * @ventana */ protected function cambio_proyecto() { $proyectos = toba::instancia()->get_proyectos_accesibles(); $actual = toba::proyecto()->get_id(); if (count($proyectos) > 1) { //-- Si hay al menos dos proyectos echo '<div class="enc-cambio-proy">'; echo '<a href="#" title="Ir a la inicio" onclick="vinculador.ir_a_proyecto(\'' . $actual . '\');">' . toba_recurso::imagen_toba("home.png", true) . '</a>'; $datos = rs_convertir_asociativo($proyectos, array(0), 1); echo toba_form::select(apex_sesion_qs_cambio_proyecto, $actual, $datos, 'ef-combo', 'onchange="vinculador.ir_a_proyecto(this.value)"'); echo toba_js::abrir(); echo 'var url_proyectos = ' . toba_js::arreglo(toba::instancia()->get_url_proyectos(array_keys($datos)), true); echo toba_js::cerrar(); echo '</div>'; } }