function generar_applet() { $sesion = $this->generar_sesion(); $cookie = session_name() . "=" . session_id(); $url_jar = toba_recurso::url_toba() . "/firmador_pdf/firmador.jar"; $destino = array($this->_id); $url_enviar = $this->get_url_enviar_pdf(true); $url_base = $this->get_url_base_actual(); $url_recibir = toba::vinculador()->get_url(null, null, array('accion' => 'recibir'), array('servicio' => 'ejecutar', 'objetos_destino' => $destino), true); $url_recibir = $url_base . $url_recibir; echo "<applet id='AppletFirmador' code='ar/gob/onti/firmador/view/FirmaApplet' scriptable='true''\n\t\t\t\tarchive='{$url_jar}' width='{$this->_ancho}' height='{$this->_alto}' >\n"; if (!$this->_multiple) { echo "<param name='URL_DESCARGA'\t value='{$url_enviar}' />\n"; } else { echo "<param name='MULTIPLE'\t value='true' />\n"; } echo "<param name='URL_SUBIR'\tvalue='{$url_recibir}' />\n\t\t\t <param name='MOTIVO' value='{$this->_motivo_firma}' />\n\t\t\t <param name='CODIGO' value='{$sesion}' />\n\t\t\t <param name='PREGUNTAS' value='{ \"preguntasRespuestas\": []}' />\n\t\t\t <param name='COOKIE' value='{$cookie}' />\n\t\t\t <param name='classloader_cache' value='false' />\n\t\t\t <param name='codebase_lookup' value='false' />\t\t\t \n </applet>\n\t\t"; if ($this->_mostrar_pdf) { $this->_url_pdf_embebido = $this->get_url_enviar_pdf(false); $this->_url_pdf_embebido .= '&codigo=' . $sesion; if ($this->_multiple) { $texto_alternativo = 'Haga click en los documentos para visualizarlos.'; } else { $texto_alternativo = "Parece que no tiene Adobe Reader o soporte PDF en este navegador.</br>Para configurar correctamente instale Adobe Reader y siga <a href='http://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html'>estas instrucciones</a>."; } echo "<div id='pdf' style='display: none; height: {$this->_pdf_altura}; text-align: center'><div style='margin-top: 40px; color: gray'>{$texto_alternativo}</div></div>"; } }
protected function estilos_css() { if (toba::proyecto()->get_parametro('es_css3')) { echo "<link rel='stylesheet' href='" . toba_recurso::url_toba() . "/js/formalize/stylesheets/formalize.css' />"; } else { echo "\n\t\t\t\t<style type='text/css'>\n\t #overlay, #capa_espera {\n\t background-image:url('" . toba_recurso::imagen_toba('nucleo/overlay.gif') . "'); \n\t }\n\t .barra-superior {\n\t background: url('" . toba_recurso::imagen_skin('barra-sup.gif') . "') repeat-x top;\n\t }\n\t .ei-cuadro-col-tit, .ei-ml-columna, .ei-filtro-columna {\n\t background: url('" . toba_recurso::imagen_skin('cuadro-col-titulo.gif') . "') repeat-x top;\n\t }\n\t .ei-barra-sup, .ci-botonera {\n\t background: url('" . toba_recurso::imagen_skin('barra-sup.gif') . "') repeat-x top;\n\t }\n\t .ci-tabs-h-lista {\n\t \tbackground: url('" . toba_recurso::imagen_skin('tabs/bg.gif') . "') repeat-x bottom;\n\t }\n\t .ci-tabs-h-solapa {\n\t\t\t\t\tbackground:url('" . toba_recurso::imagen_skin('tabs/left.gif') . "') no-repeat left top;\t \n\t }\n\t .ci-tabs-h-solapa a {\t\t\t\t\n\t \tbackground:url('" . toba_recurso::imagen_skin('tabs/right.gif') . "') no-repeat right top;\n\t }\t \n\t .ci-tabs-h-solapa-sel {\n\t\t\t\t\tbackground:url('" . toba_recurso::imagen_skin('tabs/left_on.gif') . "') no-repeat left top;\t \n\t }\n\t .ci-tabs-h-solapa-sel a {\t\t\t\t\n\t \tbackground:url('" . toba_recurso::imagen_skin('tabs/right_on.gif') . "') no-repeat right top;\n\t }\n\t\t\t\t</style>\n\t\t\t"; } echo "\n\t\t<style type='text/css'>\n\t\t\t#overlay, #capa_espera {\n\t\t\t\tbackground-image:url('" . toba_recurso::imagen_toba('nucleo/overlay.gif') . "'); \t\t\t\n\t\t\t}\n\t\t\t#barra_superior {\n\t\t\t\tdisplay:none;\n\t\t\t}\n\t\t</style>\t\t\t\n\t\t"; }
/** * Retorna el objeto fckeditor para poder modificarlo según su propia API * @param mixed valor a pasarle al editor * @return fckeditor */ function get_editor($valor) { if (!isset($this->fckeditor)) { require_once toba_dir() . '/www/js/ckeditor/ckeditor_php5.php'; $url = toba_recurso::url_toba() . '/js/ckeditor/'; $this->fckeditor = new CKeditor($url); } $opciones = array(); $opciones['width'] = $this->ancho; $opciones['height'] = $this->alto; $opciones['toolbar'] = $this->botonera; $opciones['skin'] = 'kama'; if (isset($this->templates_ck)) { $opciones['templates_files'] = $this->templates_ck; } $this->fckeditor->returnOutput = true; //Reinicializo variable para que no haga el echo del html $editor = $this->fckeditor->editor($this->id_form, $valor, $opciones, array(), false); $this->js_config = $this->fckeditor->encoded_config($opciones, array()); return $editor; }
protected function rederigir_a_swagger() { $swagger_ui = toba_recurso::url_toba() . '/swagger/index.html'; $proy = toba_rest::url_api_doc(); header('Location: ' . $swagger_ui . '?url=' . $proy); }
/** * Incluye los consumos globales básicos para utilizar el framework */ static function cargar_consumos_basicos() { if (!self::$basicos_cargados) { self::$consumos_basicos[] = 'basicos/jquery-1.9.1.min'; if (toba::proyecto()->get_parametro('es_css3')) { self::$consumos_basicos[] = 'formalize/javascripts/jquery.formalize.min'; } $imagenes = array('error' => toba_recurso::imagen_toba('error.gif', false), 'info' => toba_recurso::imagen_toba('info_chico.gif', false), 'warning' => toba_recurso::imagen_toba('warning.gif', false), 'maximizar' => toba_recurso::imagen_toba('nucleo/sentido_des_sel.gif', false), 'minimizar' => toba_recurso::imagen_toba('nucleo/sentido_asc_sel.gif', false), 'expandir' => toba_recurso::imagen_skin('expandir_vert.gif', false), 'contraer' => toba_recurso::imagen_skin('contraer_vert.gif', false), 'expandir_nodo' => toba_recurso::imagen_toba('nucleo/expandir.gif', false), 'contraer_nodo' => toba_recurso::imagen_toba('nucleo/contraer.gif', false), 'esperar' => toba_recurso::imagen_toba('wait.gif', false), 'cerrar' => toba_recurso::imagen_toba('nucleo/cerrar_ventana.gif', false)); echo toba_js::abrir(); echo "var toba_alias='" . toba_recurso::url_toba() . "';\n"; echo "var toba_proyecto_alias='" . toba_recurso::url_proyecto() . "';\n"; if (toba_editor::activado()) { echo 'var toba_proyecto_editado_alias = "' . toba_editor::get_url_previsualizacion() . "\";\n"; } echo "var toba_prefijo_vinculo = \"" . toba::vinculador()->get_url() . "\";\n"; echo "var toba_hilo_qs='" . apex_hilo_qs_item . "'\n"; echo "var toba_hilo_separador='" . apex_qs_separador . "'\n"; echo "var toba_hilo_separador_interno='" . apex_qs_sep_interno . "'\n"; echo "var toba_hilo_qs_servicio='" . apex_hilo_qs_servicio . "'\n"; echo "var toba_hilo_qs_menu='" . apex_hilo_qs_menu . "'\n"; echo "var apex_hilo_qs_celda_memoria='" . apex_hilo_qs_celda_memoria . "'\n"; echo "var toba_hilo_qs_objetos_destino='" . apex_hilo_qs_objetos_destino . "'\n"; echo "var lista_imagenes=" . toba_js::arreglo($imagenes, true) . ";"; echo "var apex_solicitud_tipo='" . toba::solicitud()->get_tipo() . "'\n"; $espera = toba::proyecto()->get_parametro('tiempo_espera_ms'); if (!isset($espera)) { $espera = 0; //No hay espera } echo "var toba_espera={$espera};\n"; //-------------- Incluyo funcionalidad para la respuesta del popup --------------- $ef_popup = toba::memoria()->get_parametro('ef_popup'); if (is_null($ef_popup)) { $ef_popup = toba::memoria()->get_dato_sincronizado('ef_popup'); } if (!is_null($ef_popup)) { toba::memoria()->set_dato_sincronizado('ef_popup', $ef_popup); echo "\n\t\t\t\tfunction seleccionar(clave, descripcion) {\n\t\t\t\t\twindow.opener.popup_callback('" . $ef_popup . "', clave, descripcion);\n\t\t\t\t\twindow.close();\n\t\t\t\t}\n\t\t\t\tfunction respuesta_ef_popup(parametros) {\n\t\t\t\t\tvar seleccion = parametros.split('||');\n\t\t\t\t\tseleccionar(seleccion[0], seleccion[1]);\n\t\t\t\t}\n\n\t\t\t\tfunction iniciar_respuesta_popup(objeto, parametros)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tvar posicion = objeto.id.ultima_ocurrencia('_');\n\t\t\t\t\tvar nombre = objeto.id.substr(0, posicion) + '_descripcion';\n\t\t\t\t\tvar descripcion = \$\$(nombre).value;\n\t\t\t\t\tseleccionar(parametros, descripcion);\n\t\t\t\t}"; } //----------------------------------------------------------------------------------------------------- echo toba_js::cerrar(); //Incluyo el javascript STANDART self::cargar_consumos_globales(self::$consumos_basicos); if (toba::instalacion()->arreglo_png_ie()) { ///---Arreglo PNGs IE $url = toba_recurso::js("utilidades/pngbehavior.htc"); echo "<!--[if lt IE 7]>\n\t\t\t\t\t<style type='text/css'>\n\t\t\t\t\t\timg {\n\t\t\t\t\t\t\tbehavior: url('{$url}');\n\t\t\t\t\t\t}\n\t\t\t\t\t</style>\n\t\t\t\t\t<![endif]-->\n"; } $url = toba_recurso::js('basicos/html5shiv.js'); echo "\t<!--[if lt IE 9]>\n\t\t\t\t\t\t<script src='{$url}'></script>\n\t\t\t\t\t<![endif]-->\n"; self::$basicos_cargados = true; } }
<?php $url = toba_recurso::url_toba() . '/js/jsunit/testRunner.html?autorun=true&showTestFrame=50&testPage='; $path = toba::instalacion()->get_path() . '/www/js/testing/'; $casos = glob($path . '*.html'); echo '<ul>'; if (is_array($casos)) { foreach ($casos as $caso) { $nombre = basename($caso); $direccion = $url . substr(toba_recurso::url_toba() . "/js/testing/{$nombre}", 7); //Para sacar el protocolo echo "<li><a href='#' onclick=\"solicitar_item_popup('{$direccion}', 700, 600, 'yes', 'yes');\">"; echo substr($nombre, 0, -5); echo '</a></li>'; } } echo '</ul>';
static function link_css($archivo = 'toba', $rol = 'screen', $buscar_en_proyecto = true) { $link = ''; $version = toba::memoria()->get_dato_instancia('toba_revision_recursos_cliente'); $agregado_url = !is_null($version) ? "?av={$version}" : ''; //--- Incluye primero el del nucleo $url = toba_recurso::url_toba() . "/css/{$archivo}.css{$agregado_url}"; $link .= "<link href='{$url}' rel='stylesheet' type='text/css' media='{$rol}'/>\n"; //--- Incluye el del skin si es el estandar if ($archivo == 'toba') { $url = toba_recurso::url_skin() . "/toba.css{$agregado_url}"; $link .= "<link href='{$url}' rel='stylesheet' type='text/css' media='{$rol}'/>\n"; } //--- Incluye el del proyecto, si existe if ($buscar_en_proyecto) { $version = toba::memoria()->get_dato_instancia('proyecto_revision_recursos_cliente'); $agregado_url = !is_null($version) ? "?av={$version}" : ''; $proyecto = toba_proyecto::get_id(); $path = toba::instancia()->get_path_proyecto($proyecto) . "/www/css/{$archivo}.css"; if (file_exists($path)) { $url = toba_recurso::url_proyecto($proyecto) . "/css/{$archivo}.css{$agregado_url}"; $link .= "<link href='{$url}' rel='stylesheet' type='text/css' media='{$rol}'/>\n"; } if (toba::proyecto()->personalizacion_activa()) { $www = toba::proyecto()->get_www_pers("css/{$archivo}.css"); if (file_exists($www['path'])) { $url = $www['url'] . $agregado_url; $link .= "<link href='{$url}' rel='stylesheet' type='text/css' media='{$rol}'/>\n"; } } $path = toba::instancia()->get_path_proyecto($proyecto) . "/www/css/" . $archivo . "_hack_ie.css"; if (file_exists($path)) { $url = toba_recurso::url_proyecto($proyecto) . "/css/" . $archivo . "_hack_ie.css"; $link .= "<!--[if lt IE 8]>\n"; $link .= "<link href='{$url}' rel='stylesheet' type='text/css' media='{$rol}'/>\n\n"; $link .= "<![endif]-->\n"; } } return $link; }