/** * Seguridad programada completamente */ function evt__form__enviar($datos) { $carpeta = dirname(__FILE__); //--1- Arma el mensaje (incluyendo los headers) $this->s__echo = $datos; $clave = xml_encode($datos['clave']); $valor = xml_encode($datos['valor']); $payload = <<<XML <ns1:test xmlns:ns1="http://siu.edu.ar/toba_referencia/serv_pruebas"> \t<texto>{$clave} {$valor}</texto> </ns1:test> XML; $mensaje = new toba_servicio_web_mensaje($payload); //--2- Arma el servicio indicando certificado del server y clave privada del cliente $cert_server = ws_get_cert_from_file($carpeta . '/servidor.crt'); $clave_privada = ws_get_key_from_file($carpeta . "/cliente.pkey"); $cert_cliente = ws_get_cert_from_file($carpeta . "/cliente.crt"); $seguridad = array("sign" => true, "encrypt" => true, "algorithmSuite" => "Basic256Rsa15", "securityTokenReference" => "IssuerSerial"); $policy = new WSPolicy(array("security" => $seguridad)); $security_token = new WSSecurityToken(array("privateKey" => $clave_privada, "receiverCertificate" => $cert_server, "certificate" => $cert_cliente)); $opciones = array('to' => 'http://localhost/' . toba_recurso::url_proyecto() . '/servicios.php/serv_seguro_codigo', 'action' => 'http://siu.edu.ar/toba_referencia/serv_pruebas/test', 'policy' => $policy, 'securityToken' => $security_token); $servicio = toba::servicio_web('cli_seguro', $opciones); //-- 3 - Muestra la respuesta $respuesta = $servicio->request($mensaje); toba::notificacion()->info($respuesta->get_payload()); }
function mostrar_video($video, $ancho = 992, $alto = 487, $controlador_propio = false) { $url_base = get_url_desarrollos(true) . '/toba_referencia_trunk/videos/'; $url_js = toba_recurso::url_proyecto() . '/videos/'; $url_controller = $controlador_propio ? $url_base . $video . '-cont.swf' : $url_base . 'controller.swf'; return ' <script type="text/javascript" src="' . $url_js . 'swfobject.js"></script> <script type="text/javascript" src="' . $url_js . 'cam_embed.js"></script> <div id="flashcontent"> <div id="cs_noexpressUpdate"> <p>The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>. </p> </div> </div> <script type="text/javascript"> // <![CDATA[ var fo = new SWFObject( "' . $url_controller . '", "' . $url_controller . '", "' . $ancho . '", "' . $alto . '", "7", "#FFFFFF", false, "best" ); fo.addVariable( "csConfigFile", "' . $url_base . $video . '.xml" ); fo.addVariable( "csColor" , "FFFFFF" ); fo.addVariable( "csPreloader" , "' . $url_base . 'preload.swf" ); if( args.movie ) { fo.addVariable( "csFilesetBookmark", args.movie ); } fo.write("flashcontent"); // ]]> </script> '; }
/** * Seguridad configurada en la instalacion */ function evt__form__enviar($datos) { //--1- Arma el mensaje (incluyendo los headers) $this->s__echo = $datos; $opciones = array('action' => 'test'); $mensaje = new toba_servicio_web_mensaje($this->s__echo, $opciones); //--2- Arma el servicio $opciones = array('to' => 'http://localhost/' . toba_recurso::url_proyecto() . '/servicios.php/serv_seguro_configuracion'); $servicio = toba::servicio_web('cli_seguro_configuracion', $opciones); //-- 3 - Muestra la respuesta $respuesta = $servicio->request($mensaje); toba::notificacion()->info(print_r($respuesta->get_array(), true)); }
function test_servicio_eco() { $mensaje = xml_encode("Holá Mundo"); $payload = <<<XML <ns1:eco xmlns:ns1="http://siu.edu.ar/toba_referencia/serv_pruebas"> \t<texto>{$mensaje}</texto> </ns1:eco> XML; $opciones = array('to' => 'http://localhost/' . toba_recurso::url_proyecto($this->get_proyecto()) . '/servicios.php/serv_sin_seguridad'); $servicio = toba::servicio_web('cli_sin_seguridad', $opciones); $mensaje = $servicio->request(new toba_servicio_web_mensaje($payload)); $xml = new SimpleXMLElement($mensaje->get_payload()); $this->AssertEqual(xml_decode((string) $xml->texto), "Respuesta: Holá Mundo"); }
function get_iconos() { if (isset($this->imagen) && $this->imagen != '' && $this->imagen_origen != '') { if ($this->imagen_origen == 'apex') { $imagen = toba_recurso::imagen_toba($this->imagen, false); } else { $imagen = toba_recurso::url_proyecto($this->proyecto) . '/img/' . $this->imagen; } } if (!isset($imagen)) { $imagen = toba_recurso::imagen_toba($this->icono, false); } $iconos = array(); $iconos[] = array('imagen' => $imagen, 'ayuda' => $this->nombre_corto); return $iconos; }
function generar_layout() { $firmador = get_firmador(); $url_firmador = toba_recurso::url_proyecto() . "/firmador_pdf/firmador.jar"; $url_firmador = $firmador->get_url_base_actual() . $url_firmador; $url_descarga = toba::vinculador()->get_url(null, "30000064", array('accion' => "descargar"), array(), true); $url_descarga = $firmador->get_url_base_actual() . $url_descarga; $url_subir = toba::vinculador()->get_url(null, "30000064", array('accion' => "subir"), array(), true); $url_subir = $firmador->get_url_base_actual() . $url_subir; $url_pdf = toba::vinculador()->get_url(null, "30000064", array('accion' => "descargar"), array(), false); //No necesita url_encode $url_pdf = $firmador->get_url_base_actual() . $url_pdf; $firmador->generar_applet($url_firmador, $url_descarga, $url_subir, "Prueba"); $firmador->generar_visor_pdf(dirname($url_firmador) . '/pdfobject.min.js', $url_pdf, "800px", "400px"); echo toba_form::hidden("firmador_codigo", $firmador->generar_sesion()); }
protected static function parsear_link($id, $nombre, $proyecto = null, $resumido = false) { $url = toba_recurso::url_proyecto() . "/" . $id; $tag = "<a href={$url} target=_blank>{$nombre}</a>"; return str_replace("'", "\\'", $tag); }
static function imagen_editor($imagen, $html = false, $ancho = null, $alto = null, $tooltip = null, $mapa = null) { $src = toba_recurso::url_proyecto(self::get_id()) . "/img/" . $imagen; if ($html) { return toba_recurso::imagen($src, $ancho, $alto, $tooltip, $mapa); } else { return $src; } }
<td class='listado-tabi'> <a href="<?php echo toba::vinculador()->get_url(toba_editor::get_id(), '3357'); ?> " class="list-obj" target="<?php echo apex_frame_centro; ?> "> <?php $ayuda = '<a target=wiki href=' . get_url_desarrollos() . '/trac/toba title=\\\'Documentación WIKI\\\'>'; $ayuda .= '<img src=' . toba_recurso::url_proyecto() . '/doc/api/media/wiki-small.png ></a> '; $ayuda .= '<a target=api href=' . toba_recurso::url_proyecto() . '/doc/api/index.html title=\\\'Documentación código PHP\\\'>'; $ayuda .= '<img src=' . toba_recurso::url_proyecto() . '/doc/api/media/php-small.png></a> '; $ayuda .= '<a target=api_js href=' . toba_recurso::url_proyecto() . '/doc/api_js/index.html title=\\\'Documentación código Javascript\\\'>'; $ayuda .= '<img src=' . toba_recurso::url_proyecto() . '/doc/api/media/javascript-small.png></a>'; echo toba_recurso::imagen_toba('ayuda.png', true, null, null, $ayuda); ?> </a></td> <td class='listado-tabi'> <a title='Testing' href="<?php echo toba::vinculador()->get_url(toba_editor::get_id(), 1000270, null, array('menu' => true)); ?> " class="list-obj" target="<?php echo apex_frame_centro; ?> "><?php echo toba_recurso::imagen_toba('testing.gif', true); ?> </a>
} else { echo toba_recurso::imagen_toba($icono['img'], true, null, null, $ayuda); } } echo "</li>\n"; } } $url_trac = get_url_desarrollos(); $url_login = $url_trac . '/trac/toba/login'; $url_referencia = toba_recurso::url_proyecto('toba_referencia'); echo "\n\t<style type='text/css'>\n\t\ta {\n\t\t\ttext-decoration:none;\n\t\t\tcolor: white;\t\n\t\t}\n\t\ta:hover {\n\t\t\ttext-decoration:underline;\n\t\t}\n\t\tul { text-align: left; margin-left:30%;\n\t\t\t\n\t\t}\n\t\th2 {\n\t\t background-color: white;\n\t\t color: black;\n\t\t padding-left: 10px;\n\t\t margin-top: 20px;\n\t\t border: 1px solid black;\n\t\t\tfont-size: 16px;\n\t\t}\t\t\n\t\th2 div {\n\t\t\tfont-size: 12px;\n\t\t}\n\t\tli { \n\t\t\tlist-style-type:none;\t\n\t\t\tmargin-top: 10px;\n\t\t\tfont-size: 12px;\n\t\t}\n\t\tli img {\n\t\t\tvertical-align: middle;\n\t\t\tborder: 0;\n\t\t}\n\t</style>\n"; /** * OFFLINE */ echo "\n<h2>Offline<div>Contenido correspondiente a esta versión</div></h2>\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<a target='api' href='" . toba_recurso::url_proyecto() . "/doc/api/index.html' title='Documentación de referencia de la API PHP disponible'>\n\t\t\t\t\t<img src='" . toba_recurso::url_proyecto() . "/doc/api/media/php-small.png'>\n\t\t\t\t\t\tAPI PHP</a>\n\t\t\t\t\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a target='api_js' href='" . toba_recurso::url_proyecto() . "/doc/api_js/index.html' title='Documentación de referencia de la API Javascript disponible'>\n\t\t\t\t\t<img src='" . toba_recurso::url_proyecto() . "/doc/api/media/javascript-small.png'>\n\t\t\t\t\t\tAPI Javascript</a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a target='toba_referencia' href='{$url_referencia}/?ai=toba_referencia||1000073' title='Tutoriales con explicaciones guiadas y videos introductorios'>\n\t\t\t\t\t<img src='" . toba_recurso::imagen_proyecto('referencia_chico.png') . "'>\n\t\t\t\t\t\tTutorial</a>\n\t\t\t</li>\t\t\t\n\t\t\t<li>\n\t\t\t\t<a target='toba_referencia' href='{$url_referencia}/'>\n\t\t\t\t\t<img src='" . toba_recurso::imagen_proyecto('referencia_chico.png') . "'>\t\t\t\n\t\t\t\t\t\tProyecto Referencia</a>\n\t\t\t</li>\n\t\t</ul>"; /** * ONLINE */ echo ' <h2>Online<div>Contenido más actualizado</div></h2>'; echo "\n\t<table border=0 width=100%>\n\t<tr>\n\t<td width=50%>\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<a target='desarrollos' href='{$url_trac}/trac/toba/newticket*{$url_login}' title='Lugar central de la documentación'>\n\t\t\t\t\t<img src='" . toba_recurso::url_proyecto() . "/doc/api/media/wiki-small.png'>\n\t\t\t\t\t\tReportar un bug o mejora</a>\n\t\t\t</li>\t\t\t\t\t\n\t\t\t<li>\n\t\t\t\t<a target='desarrollos' href='{$url_trac}/trac/toba/wiki*{$url_login}' title='Lugar central de la documentación'>\n\t\t\t\t\t<img src='" . toba_recurso::url_proyecto() . "/doc/api/media/wiki-small.png'>\n\t\t\t\t\t\tWiki</a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a target='desarrollos' href='{$url_trac}/toba_editor_trunk/doc/api/index.html' title='Documentación de referencia de la API PHP disponible'>\n\t\t\t\t\t<img src='" . toba_recurso::url_proyecto() . "/doc/api/media/php-small.png'>\n\t\t\t\t\t\tAPI PHP</a>\n\t\t\t\t\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a target='desarrollos' href='{$url_trac}/toba_editor_trunk/doc/api_js/index.html' title='Documentación de referencia de la API Javascript disponible'>\n\t\t\t\t\t<img src='" . toba_recurso::url_proyecto() . "/doc/api/media/javascript-small.png'>\n\t\t\t\t\t\tAPI Javascript</a>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a target='desarrollos' href='{$url_trac}/toba_referencia_trunk/?ai=toba_referencia||1000073' title='Tutoriales con explicaciones guiadas y videos introductorios'>\t\t\t\n\t\t\t\t\t<img src='" . toba_recurso::imagen_proyecto('referencia_chico.png') . "'>\n\t\t\t\t\tTutorial</a>\n\t\t\t</li>\t\t\t\n\t\t\t<li>\n\t\t\t\t<a target='desarrollos' href='{$url_trac}/toba_referencia_trunk/'>\n\t\t\t\t\t<img src='" . toba_recurso::imagen_proyecto('referencia_chico.png') . "'>\t\t\t\n\t\t\t\t\tProyecto Referencia</a>\n\t\t\t</li>\n\t\t<ul>\n\t</td>\n\t<td>\n\t\t<ul>\t\t\n\t"; //--- LINKS $online = array(); $online[] = array('url' => array('Especificación 4.01 (esp)' => 'http://html.conclase.net/w3c/html401-es/cover.html#minitoc'), 'img' => 'botones/html80.png', 'frame' => 'html'); $online[] = array('url' => array('Manual Introductorio (esp)' => 'http://www.sidar.org/recur/desdi/mcss/manual/indice.php', 'Especificación 2.0 (esp)' => 'http://www.sidar.org/recur/desdi/traduc/es/css/cover.html', 'Compatibilidad entre navegadores (eng)' => 'http://www.westciv.com/style_master/academy/browser_support/index.html', 'Tutoriales (eng)' => 'http://css.maxdesign.com.au/', 'Posicionamiento (eng)' => 'http://www.brainjar.com/css/positioning/default.asp', 'Soporte CSS en Email (eng)' => 'http://www.campaignmonitor.com/blog/archives/2006/03/a_guide_to_css_1.html'), 'img' => 'botones/css80.png', 'frame' => 'html'); $online[] = array('url' => array('Manual (esp)' => 'http://www.php.net/manual/es/'), 'img' => 'botones/php80.png', 'frame' => 'php'); $online[] = array('url' => array('Manual 8.1 (eng)' => 'http://www.postgresql.org/docs/8.1/interactive/index.html'), 'img' => 'botones/postgres80x15.gif', 'frame' => 'postgres'); $online[] = array('url' => array('Manual 2.2 (esp)' => 'http://httpd.apache.org/docs/2.2/es/'), 'img' => 'botones/apache80.png', 'frame' => 'apache'); $online[] = array('url' => array('Libro (eng)' => 'http://svnbook.red-bean.com/nightly/en/index.html'), 'img' => 'botones/svn80.png', 'frame' => 'svn'); cuadro_ayuda('Otros', $online, true); echo '</ul></td></tr></table>';
function evt__form_excepciones__enviar($datos) { $this->s__datos_excepciones = $datos; $opciones = array('action' => 'http://siu.edu.ar/toba_referencia/serv_pruebas/enviar_excepcion', 'to' => 'http://localhost/' . toba_recurso::url_proyecto() . '/servicios.php/serv_sin_seguridad'); $servicio = toba::servicio_web('cli_sin_seguridad', $opciones); //--2- Da de alta la persona $mensaje = new toba_servicio_web_mensaje($this->s__datos_excepciones); try { $respuesta = $servicio->request($mensaje); } catch (toba_error_servicio_web $e) { toba::notificacion()->info($e->get_mensaje() . ' (codigo: "' . $e->get_codigo() . '")'); } }
function get_iconos() { $iconos = array(); $img_item = null; if (isset($this->datos['basica']['item_imagen']) && $this->datos['basica']['item_imagen'] != '' && $this->datos['basica']['item_imagen_recurso_origen'] != '') { if ($this->datos['basica']['item_imagen_recurso_origen'] == 'apex') { $img_item = toba_recurso::imagen_toba($this->datos['basica']['item_imagen']); } else { $img_item = toba_recurso::url_proyecto($this->datos['basica']['item_proyecto']) . '/img/' . $this->datos['basica']['item_imagen']; } } if ($this->es_carpeta()) { $iconos[] = array('imagen' => isset($img_item) ? $img_item : toba_recurso::imagen_toba("nucleo/carpeta.gif", false), 'ayuda' => "Carpeta que contiene operaciones."); } else { $iconos[] = array('imagen' => isset($img_item) ? $img_item : toba_recurso::imagen_toba("item.gif", false), 'ayuda' => "Una [wiki:Referencia/Operacion Operación] representa la unidad accesible por el usuario."); if ($this->es_de_consola()) { $iconos[] = array('imagen' => toba_recurso::imagen_proyecto("solic_consola.gif", false), 'ayuda' => 'Solicitud de Consola'); } elseif ($this->get_tipo_solicitud() == "wddx") { $iconos[] = array('imagen' => toba_recurso::imagen_proyecto("solic_wddx.gif", false), 'ayuda' => 'Solicitud WDDX'); } if ($this->crono()) { $iconos[] = array('imagen' => toba_recurso::imagen_toba("cronometro.gif", false), 'ayuda' => "La operación se cronometra"); } if ($this->es_publico()) { $iconos[] = array('imagen' => toba_recurso::imagen_toba("usuarios/usuario.gif", false), 'ayuda' => "Operación pública"); } if ($this->puede_redireccionar()) { $iconos[] = array('imagen' => toba_recurso::imagen_toba("refrescar.png", false), 'ayuda' => "La operación puede redireccionar hacia otra."); } if ($this->retrasa_envio_headers()) { $iconos[] = array('imagen' => toba_recurso::imagen_toba("rehacer.png", false), 'ayuda' => "La operación retrasa el envio de headers al cliente."); } if ($this->registra_solicitud() == 1) { $iconos[] = array('imagen' => toba_recurso::imagen_toba("solicitudes.gif", false), 'ayuda' => "La operación se registra en el log"); } if ($this->posee_accion_predefinida() && !$this->existe_php_accion()) { $iconos[] = array('imagen' => toba_recurso::imagen_toba("nucleo/php_inexistente.gif", false), 'ayuda' => "Existe un PHP plano asociado al item, pero el archivo no existe en el path especificado."); } if ($this->generado_con_wizard()) { $iconos[] = array('imagen' => toba_recurso::imagen_toba("wizard.png", false), 'ayuda' => "La operación fue generada con un ASISTENTE", 'vinculo' => toba::vinculador()->get_url(toba_editor::get_id(), "1000110", array("padre_p" => $this->get_proyecto(), "padre_i" => $this->get_id(), apex_hilo_qs_zona => $this->proyecto . apex_qs_separador . $this->id), array('menu' => true, 'celda_memoria' => 'central')), 'plegado' => false); } } return $iconos; }
function get_www_pers($archivo = "") { $path_real = $this->get_path_pers() . "/www/" . $archivo; $path_browser = toba_recurso::url_proyecto($this->id, true); if ($archivo != "") { $path_browser .= "/" . $archivo; } return array("path" => $path_real, "url" => $path_browser); }
/** * 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; } }
function get_url_ws($proyecto = null, $ws, $parametros = array(), $opciones = array()) { $separador = '&'; if (is_null($proyecto)) { $proyecto = toba::proyecto()->get_id(); } $disponibles = toba_info_editores::get_items_servicios_web($proyecto); $items = array(); foreach ($disponibles as $wservice) { $items[] = $wservice['item']; } if (!in_array($ws, $items)) { //Si no forma parte de los ws, null return null; } $query_str = toba_recurso::url_proyecto($proyecto); $query_str .= '/servicios.php/' . $ws; if (isset($opciones['wsdl'])) { $query_str .= '?wsdl'; } elseif (isset($opciones['wsdl2'])) { $query_str .= '?wsdl2'; } if (isset($parametros) && is_array($parametros)) { foreach ($parametros as $clave => $valor) { $query_str .= $separador . "{$clave}={$valor}"; } } if (isset($opciones['html'])) { $params = isset($opciones['texto']) ? array('texto' => $opciones['texto']) : array(); return $this->generar_html($query_str, $params); } return $query_str; }
/** * @return bool */ public function es_pedido_documentacion() { return toba_recurso::url_proyecto() . "/rest" == rtrim($_SERVER['REQUEST_URI'], '/'); }
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; }
/** * Rutea el pedido de uan imagen como si se estubiera ejecutando el proyecto */ static function url_imagen_de_origen($img, $origen) { switch ($origen) { case 'apex': return toba_recurso::imagen_toba($img); break; case 'skin': $estilo = toba::proyecto(toba_editor::get_proyecto_cargado())->get_parametro('estilo'); $proyecto = toba::proyecto(toba_editor::get_proyecto_cargado())->get_parametro('estilo_proyecto'); return toba_recurso::url_skin($estilo, $proyecto) . '/' . $img; break; case 'proyecto': return toba_recurso::url_proyecto(toba_editor::get_proyecto_cargado()) . '/img/' . $img; break; default: throw new toba_error("No esta contemplado el origen {$origen}"); } }