Example #1
0
 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>";
     }
 }
    /**
     * 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();
        }
    }
Example #3
0
function cuadro_ayuda($titulo, $iconos, $origen_proyecto = false)
{
    foreach ($iconos as $icono) {
        echo '<li>';
        if (count($icono['url']) == 1) {
            foreach ($icono['url'] as $ayuda => $url) {
                echo "<a href='{$url}' target='{$icono['frame']}'>";
                if ($origen_proyecto) {
                    echo toba_recurso::imagen_proyecto($icono['img'], true, null, null, $ayuda);
                } else {
                    echo toba_recurso::imagen_toba($icono['img'], true, null, null, $ayuda);
                }
                echo '</a>';
            }
        } else {
            $ayuda = '<ul>';
            foreach ($icono['url'] as $desc => $url) {
                $ayuda .= "<li><a href={$url} target={$icono['frame']}>{$desc}";
                $ayuda .= '</a></li>';
            }
            $ayuda .= '</ul>';
            if ($origen_proyecto) {
                echo toba_recurso::imagen_proyecto($icono['img'], true, null, null, $ayuda);
            } else {
                echo toba_recurso::imagen_toba($icono['img'], true, null, null, $ayuda);
            }
        }
        echo "</li>\n";
    }
}
Example #4
0
 function pre_contenido()
 {
     echo "<div class='login-titulo'>" . toba_recurso::imagen_proyecto("logo.gif", true);
     echo "<div>versión " . toba::proyecto()->get_version() . "</div>";
     echo "</div>";
     echo "\n<div align='center' class='cuerpo'>\n";
 }
Example #5
0
 function post_contenido()
 {
     echo "</div>";
     echo "<div class='login-pie'>";
     echo "<div style='font-size:12px;'>Desarrollado por <strong><a href='http://sti.uncoma.edu.ar/' style='text-decoration: none' target='_blank'>" . toba_recurso::imagen_proyecto('logo_sti_sin.png', true, '30', '30') . "</a></strong><br>Universidad Nacional del Comahue</div>\r\n\t\t<div >2014-" . date('Y') . "</div>";
     echo "</div>";
 }
 function extender_objeto_js()
 {
     parent::extender_objeto_js();
     $id_js = $this->objeto_js;
     $id_gral = $this->_submit;
     $img_acceso = toba_recurso::imagen_toba('aplicar.png', false);
     $img_sin_acceso = toba_recurso::imagen_toba('prohibido.png', false);
     //Busco el estado de cada uno de los hijos involucrados en el pedido de pagina
     $estado = array('activos' => array(), 'inactivos' => array());
     if (isset($this->_nodos_inicial) && !empty($this->_nodos_inicial)) {
         $raiz = $this->_nodos_inicial[0];
         if ($raiz->tiene_hijos_cargados()) {
             foreach ($raiz->get_hijos() as $nodo) {
                 $aux = $nodo->recuperar_estado_recursivo();
                 $estado['activos'] = array_merge($estado['activos'], $aux['activos']);
                 $estado['inactivos'] = array_merge($estado['inactivos'], $aux['inactivos']);
             }
         }
     }
     //Genero un par de arreglos que van a servir como lista en js
     $ids_activos = !empty($estado['activos']) ? array_fill_keys($estado['activos'], true) : array();
     $ids_desactivados = !empty($estado['inactivos']) ? array_fill_keys($estado['inactivos'], true) : array();
     echo ' var ' . $id_js . '_items_activos = ' . toba_js::arreglo($ids_activos, true) . "; \n";
     echo ' var ' . $id_js . '_items_desactivados = ' . toba_js::arreglo($ids_desactivados, true) . "; \n";
     echo "\t\t\t\n\t\t\t{$id_js}.cambiar_acceso = function(id_input)\n\t\t\t{\n\t\t\t\tvar id_elemento = '{$id_gral}' + '_' + id_input; \t\t\t\t\t\n\t\t\t\tif (isset({$this->objeto_js}_items_activos[id_input])) {\t\t\t//Esta visible, hay que ocultarlo\t\t\t\t\t\n\t\t\t\t\tdelete({$this->objeto_js}_items_activos[id_input]);\n\t\t\t\t\t{$this->objeto_js}_items_desactivados[id_input] = true;\n\t\t\t\t\t\$\$(id_elemento + '_acceso_img').src = '{$img_sin_acceso}';\t\t\t\t\t\t\n\t\t\t\t} else if (isset({$this->objeto_js}_items_desactivados[id_input])) {\t\t//Esta oculto, hay que mostrarlo\t\t\t\t\t\n\t\t\t\t\tdelete({$this->objeto_js}_items_desactivados[id_input]);\n\t\t\t\t\t{$this->objeto_js}_items_activos[id_input] = true;\n\t\t\t\t\t\$\$(id_elemento + '_acceso_img').src = '{$img_acceso}';\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t{$id_js}.marcar = function(id_input, valor)\n\t\t\t{\t\t\t\t\n\t\t\t\tvar id_final = '{$id_gral}' + '_' + id_input + '_carpeta';\n\t\t\t\tvar padre = \$\$(id_final).parentNode.parentNode;\t\t\n\t\t\t\tvar nodo = this.buscar_primer_marca(padre, 'UL');\n\t\t\t\tif (nodo) {\t\t\n\t\t\t\t\tfor (var i=0; i < nodo.childNodes.length; i++) {\n\t\t\t\t\t\tvar hijo = nodo.childNodes[i];\n\t\t\t\t\t\tif (hijo.tagName && (hijo.tagName == 'LI')) {\n\t\t\t\t\t\t\tif (! this.buscar_primer_marca(hijo, 'UL')) {\n\t\t\t\t\t\t\t\tthis.cambiar_estado_acceso(hijo, valor);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.marcar_recursivo(hijo, valor);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t{$id_js}.marcar_recursivo = function(carpeta, valor) \n\t\t\t{\n\t\t\t\tvar marca_carpeta = this.buscar_primer_marca(carpeta, 'SPAN');\n\t\t\t\tif (marca_carpeta) {\n\t\t\t\t\tfor (var i=0; i < marca_carpeta.childNodes.length; i++) {\n\t\t\t\t\t\tvar hc = marca_carpeta.childNodes[i];\n\t\t\t\t\t\tif (hc.tagName && (hc.tagName == 'INPUT')) {\n\t\t\t\t\t\t\t\$\$(hc.id).value = valor;\n\t\t\t\t\t\t\t\$\$(hc.id).checked = (valor == 0) ? true : false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar nodo = this.buscar_primer_marca(carpeta, 'UL');\t\t\n\t\t\t\tfor (var i=0; i < nodo.childNodes.length; i++) {\n\t\t\t\t\tvar hijo = nodo.childNodes[i];\n\t\t\t\t\tif (hijo.tagName && (hijo.tagName == 'LI')) {\n\t\t\t\t\t\tif (!this.buscar_primer_marca(hijo, 'UL')) {\n\t\t\t\t\t\t\tthis.cambiar_estado_acceso(hijo, valor);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.marcar_recursivo(hijo, valor);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t{$id_js}.cambiar_estado_acceso = function(nodo, valor)\n\t\t\t{\n\t\t\t\tfor (var i=0; i < nodo.childNodes.length; i++) {\n\t\t\t\t\tif (nodo.childNodes[i].tagName == 'SPAN') {\n\t\t\t\t\t\tvar hijo = nodo.childNodes[i];\n\t\t\t\t\t\tfor (var j=0; j < hijo.childNodes.length; j++) {\n\t\t\t\t\t\t\tif (hijo.childNodes[j].tagName == 'IMG') {\t\n\t\t\t\t\t\t\t\thijo.childNodes[j].onclick();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t{$id_js}.buscar_primer_marca = function (nodo, marca) {\n\t\t\t\tfor (var i=0; i < nodo.childNodes.length; i++) {\n\t\t\t\t\tif (nodo.childNodes[i].tagName == marca) {\n\t\t\t\t\t\treturn nodo.childNodes[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t{$id_js}.submit = function()\n\t\t\t{\t\t\t\t\n\t\t\t\tvar padre_esta_en_proceso = this.controlador && !this.controlador.en_submit();\n\t\t\t\tif (padre_esta_en_proceso) {\n\t\t\t\t\treturn this.controlador.submit();\n\t\t\t\t}\n\t\t\t\tif (this._evento) {\n\t\t\t\t\t//Si es la selección de una semana marco la semana\n\t\t\t\t\tif (this._evento.id == 'ver_propiedades') {\n\t\t\t\t\t\tdocument.getElementById(this._input_submit + '__seleccion').value = this._evento.parametros;\n\t\t\t\t\t}\n\t\t\t\t\t//Marco la ejecucion del evento para que la clase PHP lo reconozca\n\t\t\t\t\tdocument.getElementById(this._input_submit).value = this._evento.id;\t\t\t\n\t\t\t\t}\n\t\t\t\tdocument.getElementById(this._input_submit + '__apertura_datos').value = this.datos_apertura();\t\t\t\t\n\n\t\t\t\t//Agrego como lista los nodos seleccionados y deseleccionados\n\t\t\t\tvar claves = [];\n\t\t\t\tfor (var i in {$id_js}_items_activos) {\n\t\t\t\t\tclaves.push(i);\n\t\t\t\t}\n\t\t\t\tdocument.getElementById('{$id_gral}__nodos_seleccionados').value = claves.join(toba_hilo_separador_interno);\n\n\t\t\t\tvar claves = [];\t\t\t\t\n\t\t\t\tfor (var i in {$id_js}_items_desactivados) {\n\t\t\t\t\tclaves.push(i);\n\t\t\t\t}\n\t\t\t\tdocument.getElementById('{$id_gral}__nodos_deseleccionados').value = claves.join(toba_hilo_separador_interno);\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t";
 }
 function get_utilerias($icono_nuevo = true)
 {
     //ei_arbol($this->datos);
     $iconos = array();
     if ($icono_nuevo) {
         $iconos[] = array('imagen' => toba_recurso::imagen_toba("objetos/objeto_nuevo.gif", false), 'ayuda' => "Crear una nueva tabla asociada a la relación", 'vinculo' => toba::vinculador()->get_url(toba_editor::get_id(), "1000247", array('destino_tipo' => 'toba_datos_relacion', 'destino_proyecto' => $this->proyecto, 'destino_id' => $this->id), array('menu' => true, 'celda_memoria' => 'central')), 'plegado' => true);
     }
     //--- Mejora para el caso de que la query sea una unica
     if (isset($this->datos['_info']['punto_montaje'])) {
         $this->datos['_info_estructura']['punto_montaje'] = $this->datos['_info']['punto_montaje'];
     }
     if (isset($this->datos['_info']['ap_clase'])) {
         $this->datos['_info_estructura']['ap_clase'] = $this->datos['_info']['ap_clase'];
     }
     if (isset($this->datos['_info']['ap_archivo'])) {
         $this->datos['_info_estructura']['ap_archivo'] = $this->datos['_info']['ap_archivo'];
     }
     if (isset($this->datos['_info_estructura']['ap_clase'])) {
         // Hay PHP asociado
         if (admin_util::existe_archivo_subclase($this->datos['_info_estructura']['ap_archivo'], $this->datos['_info_estructura']['punto_montaje'])) {
             $iconos[] = toba_componente_info::get_utileria_editor_abrir_php(array('proyecto' => $this->proyecto, 'componente' => $this->id), 'ap', 'reflexion/abrir_ap.gif');
             $iconos[] = toba_componente_info::get_utileria_editor_ver_php(array('proyecto' => $this->proyecto, 'componente' => $this->id), 'ap', 'nucleo/php_ap.gif');
         } else {
             $iconos[] = toba_componente_info::get_utileria_editor_ver_php(array('proyecto' => $this->proyecto, 'componente' => $this->id), 'ap', 'nucleo/php_ap_inexistente.gif', false);
         }
     }
     return array_merge($iconos, parent::get_utilerias());
 }
Example #8
0
 function get_html(toba_ef $ef)
 {
     $objeto_js = $ef->objeto_js();
     if ($this->es_abrir) {
         $img = toba_recurso::imagen_proyecto('reflexion/abrir.gif', true);
     } else {
         $img = toba_recurso::imagen_toba('nucleo/php.gif', true);
     }
     if (!$this->_sin_archivo) {
         $salida = "<a href='#' onclick=\"if ({$objeto_js}.get_estado() == ''){return;}\n\t\t\t\t\t\t\t\t\t\t\tvinculador.agregar_parametros({$this->id_vinculo}, {archivo: {$objeto_js}.get_estado()});\n\t\t\t\t\t\t\t\t\t\t\tvinculador.invocar({$this->id_vinculo})\">{$img}</a>";
     } else {
         if (!$ef->tiene_estado()) {
             $img = toba_recurso::imagen_toba('nucleo/extender.gif', true);
             $objeto_js = $ef->controlador()->get_id_objeto_js();
             //Imita el metodo de modificacion de vinculos usado por los eis
             $nombre = 'modificar_vinculo__ef_' . $ef->get_id();
             //de otro modo se hace imposible agregarle parametros en runtime
             $codigo = " if (!existe_funcion({$objeto_js}, '{$nombre}')){return;}\n\t\t\t\t\t\t\t{$objeto_js}.{$nombre}({$this->id_vinculo});\n\t\t\t\t\t\t\tvinculador.invocar({$this->id_vinculo});";
             $salida = "<a href='#' onclick=\"{$codigo}\">{$img}</a>";
         } else {
             $salida = "<a href='#' onclick=\"vinculador.invocar({$this->id_vinculo})\">{$img}</a>";
         }
     }
     return $salida;
 }
Example #9
0
 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\">Más información</a><br>";
         }
         if ($info) {
             $info = "Versión: <strong>{$version}</strong><br>" . $info;
             $info = toba_recurso::ayuda(null, $info, 'enc-version');
         } else {
             $info = "class='enc-version'";
         }
         echo "<div {$info} >";
         echo 'Versión <strong>' . $version . '</strong>';
         echo '</div>';
     }
 }
Example #10
0
 function set_abrir_nueva_ventana($imagen = 'nucleo/abrir_nueva_ventana.gif')
 {
     if (toba::memoria()->get_celda_memoria_actual_id() != $this->celda_memoria) {
         $this->abrir_nueva_ventana = true;
         $this->imagen_nueva_ventana = toba_recurso::imagen_toba($imagen, false);
     }
 }
 function extender_objeto_js()
 {
     $img_oculto = toba_recurso::imagen_toba('no-visible.png', false);
     $img_visible = toba_recurso::imagen_toba('visible.png', false);
     $img_solo_lectura = toba_recurso::imagen_toba('no-editable.gif', false);
     $img_editable = toba_recurso::imagen_toba('editable.gif', false);
     echo "\n\t\t\tfunction cambiar_oculto(id_input) {\n\t\t\t\tvar valor_actual = \$(id_input).value;\n\t\t\t\tif (valor_actual == 1) {\n\t\t\t\t\t//Esta oculto, hay que mostrarlo\n\t\t\t\t\t\$\$(id_input + '_img').src = '{$img_visible}';\n\t\t\t\t\t\$\$(id_input).value = 0;\n\t\t\t\t} else {\n\t\t\t\t\t//Esta visible, hay que ocultarlo\n\t\t\t\t\t\$\$(id_input + '_img').src = '{$img_oculto}';\n\t\t\t\t\t\$\$(id_input).value = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunction cambiar_editable(id_input) {\n\t\t\t\tvar valor_actual = \$\$(id_input).value;\n\t\t\t\tif (valor_actual == 1) {\n\t\t\t\t\t//Esta oculto, hay que mostrarlo\n\t\t\t\t\t\$\$(id_input + '_img').src = '{$img_editable}';\n\t\t\t\t\t\$\$(id_input).value = 0;\n\t\t\t\t} else {\n\t\t\t\t\t//Esta visible, hay que ocultarlo\n\t\t\t\t\t\$\$(id_input + '_img').src = '{$img_solo_lectura}';\n\t\t\t\t\t\$\$(id_input).value = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t";
 }
Example #12
0
 protected function comienzo_cuerpo()
 {
     $this->cabecera_aplicacion();
     $wait = toba_recurso::imagen_toba('wait.gif');
     echo "<div id='div_toba_esperar' class='div-esperar' style='display:none'>";
     echo "<img src='{$wait}' style='vertical-align: middle;' alt='' /> Procesando...";
     echo "</div>\n";
 }
Example #13
0
 function generar_layout()
 {
     $operacion = toba_recurso::imagen_proyecto('tutorial/abms-operacion.png');
     $arbol = toba_recurso::imagen_proyecto('tutorial/abms-arbol.png');
     echo "\n\t\t\t<p>\n\t\t\t\tYa se han presentado los componentes principales en forma individual, resta\n\t\t\t\tmostrar cómo integrarlos para formar una operación completa. El tipo de operación\n\t\t\t\tque se va a usar de ejemplo es de los llamados ABMs (Altas-Bajas y Modificaciones de una o varias\n\t\t\t\tentidades), comenzando por los llamados <strong>simples</strong>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\tUn ABM simple contiene las operaciones de alta, baja y modificación de una única tabla.\n\t\t\t\tLa idea es utilizar un <strong>cuadro</strong> para listar los datos existentes en la tabla y un\n\t\t\t\t<strong>formulario</strong> para poder agregar, modificar o eliminar los registros individualmente.\n\t\t\t\tEstos dos componentes se encontrarán en una <strong>pantalla</strong> de un <strong>ci</strong>. Finalmente\n\t\t\t\tpara transaccionar con la base de datos se utilizará un <strong>datos_tabla</strong>.\n\t\t\t</p>\n\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=top><img src='{$arbol}'><br>\n\t\t\t\t\t\t<span class='caption'>Arbol de componentes en el editor</span></td>\n\t\t\t\t\t<td> </td>\n\t\t\t\t\t<td><img src='{$operacion}'><br>\n\t\t\t\t\t<span class='caption'>Captura de la operación en ejecución</span></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t";
     $vinculo = toba::vinculador()->get_url(null, 2654, array(), array('celda_memoria' => 'ejemplo'));
     echo "<p style='font-size:150%;text-align:center;'>\n\t\t\t\t<a target='_blank' href='{$vinculo}'>Ejecutar Operación</a></p>";
 }
Example #14
0
 function generar_layout()
 {
     echo toba_recurso::link_css('tree');
     $param = array('ajax-metodo' => 'get_estructura_arbol', 'ajax-modo' => 'D');
     $opciones = array('servicio' => 'ajax', 'objetos_destino' => array($this->controlador()->get_id()));
     $this->url = toba::vinculador()->get_url(null, null, $param, $opciones, true);
     echo "<ul id='desc_tree' class=\"easyui-tree\"></ul>";
 }
Example #15
0
 function generar_layout()
 {
     $estilo = $this->menu->plantilla_css();
     if ($estilo != '') {
         echo toba_recurso::link_css($estilo, 'screen', false);
     }
     $this->menu->mostrar();
 }
Example #16
0
 function get_html(toba_ef $ef)
 {
     $objeto_js = $ef->objeto_js();
     $javascript = "{$objeto_js}.resetear_estado();";
     $salida = "<a class='icono-utileria' href='#' onclick=\"{$javascript}\">";
     $salida .= toba_recurso::imagen_toba('limpiar.png', true, null, null, "Resetear estado actual del campo");
     $salida .= "</a>";
     return $salida;
 }
Example #17
0
 function generar_layout()
 {
     echo "<p>\n\t\t\t\tUna vez creado un ítem podemos asociarle comportamientos:\n\t\t\t\t<ul>\n\t\t\t\t <li><em>Con Componentes</em>: Es la forma recomendada para la mayoría de las operaciones, se ve más adelante en el tutorial.</li>\n\t\t\t\t <li><em>Programando su comportamiento</em>: Para casos de operaciones de consola, en lote o que tengan una salida gráfica totalmente irregular\n\t\t\t\t \t\t en donde el esquema de componentes no alcanza.</li>\n\t\t\t\t </ul>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\tLa <strong>ejecución de PHP Plano</strong> cubre el caso de comportamiento totalmente programado o <em>ad-hoc</em>. \n\t\t\tEn este caso se asocia al ítem un archivo en el sistema de archivos y en él se programa la operación de la forma tradicional en PHP. \n\t\t\t</p>\n\t\t\t\n\t\t\t<p>Se puede definir el archivo en las propiedades básica de la operación\n\t\t\t</p>\n\t\t\t";
     echo "<div style='text-align: center'>";
     echo toba_recurso::imagen_proyecto('tutorial/item-php-plano.png', true);
     echo "</div>";
     $vinculo = toba::vinculador()->get_url(null, 1000077);
     echo "<p>\n\t\t\t\tEl código puede contener referencias a todo el API de toba, exceptuando a los componentes.\n\t\t\t\t<a href='{$vinculo}' target='_blank'>Ver ejemplo</a>\n\t\t\t</p>";
 }
 function get_html(toba_ef $ef)
 {
     $objeto_js = $ef->objeto_js();
     $javascript = "alert('Estado actual: ' + {$objeto_js}.get_estado());";
     $salida = "<a class='icono-utileria' href='formato_archivo.html' onclick=\"{$javascript}\">";
     $salida .= toba_recurso::imagen_toba('descripcion.gif', true, null, null, "Debe ser un archivo txt");
     $salida .= "</a>";
     return $salida;
 }
Example #19
0
 static function generar_input_ef($origen, $img, $objeto_js, $fila = '')
 {
     $predeterminada = toba_recurso::imagen_toba('image-missing-16.png', false);
     if ($img != '') {
         $actual = admin_util::url_imagen_de_origen($img, $origen);
     } else {
         $actual = $predeterminada;
     }
     echo "<img nohack='1' title='Elegir la imagen desde un listado' onclick='{$objeto_js}.elegir_imagen({$fila})'\n\t\t\t\t\tid='editor_imagen_src{$fila}' src='{$actual}' onError='this.src=\"{$predeterminada}\"'/>";
 }
Example #20
0
 function get_html(toba_ef $ef)
 {
     $editable = toba_recurso::imagen_toba('objetos/editar.gif', false);
     $objeto_js = $ef->objeto_js();
     echo "<script>\n\t\t\tfunction toggle_editable() {\n\t\t\t\tvar ef = {$objeto_js}\n\t\t\t\tif (!ef.input().disabled) {\n\t\t\t\t\tef.input().disabled = true;\n\t\t\t\t\t\$\$('utileria_identificador').src = '{$editable}';\n\t\t\t\t\t\$\$('utileria_identificador').title = 'Editar Identificador';\n\t\t\t\t} else {\n\t\t\t\t\tef.input().disabled = false;\t\t\t\t\n\t\t\t\t\t\$\$('utileria_identificador').src = '{$editable}';\n\t\t\t\t\t\$\$('utileria_identificador').title = 'Resetar Identificador';\n\t\t\t\t\tef.seleccionar();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t</script>";
     $salida = "<a class='icono-utileria' href='#' onclick=\"toggle_editable(); return false\">";
     $salida .= "<img id='utileria_identificador' src='{$editable}' title='Editar Identificador'>";
     $salida .= '</a>';
     return $salida;
 }
Example #21
0
 function generar_layout()
 {
     //--- Barra SVN
     echo "<div class='editor-vista-previa'>" . $this->controlador()->get_info_archivo();
     echo '<div>';
     $this->generar_botones_eventos(true);
     echo '</div></div>';
     //--- Barra de convenciones
     $mensajes_linea = array();
     $modelo = toba_editor::get_modelo_proyecto();
     $estandar = $modelo->get_estandar_convenciones();
     $path = $this->controlador()->get_path_archivo();
     if (file_exists($path)) {
         $resultado = $estandar->validar(array($path));
         $titulo = '<strong>Convenciones</strong>';
         $cant_errores = $resultado['totals']['errors'];
         $cant_warnings = $resultado['totals']['warnings'];
         $extra = '';
         if ($cant_errores === 0 && $cant_warnings === 0) {
             $nivel = 'info';
             $salida = 'Ok!';
         } else {
             $nivel = $cant_errores !== 0 ? 'error' : 'warning';
             $salida = "{$cant_errores} ";
             $salida .= $cant_errores !== 1 ? 'errores' : 'error';
             $salida .= " / {$cant_warnings} ";
             $salida .= $cant_warnings !== 1 ? 'avisos' : 'aviso';
             foreach ($resultado['files'][$path]['messages'] as $linea => $columnas) {
                 $textos = array();
                 foreach ($columnas as $column => $mensajes) {
                     foreach ($mensajes as $mensaje) {
                         //$extra .= "<strong>$linea</strong>:{$mensaje['message']}";
                         $imagen = $mensaje['type'] == 'ERROR' ? 'error.gif' : 'warning.gif';
                         $textos[] = $estandar->parsear_mensaje($mensaje['message']);
                         //Cambia el id de la convencion por una url
                     }
                 }
                 $ayuda = implode('<br><br>', $textos);
                 $ayuda = str_replace("'", "`", $ayuda);
                 $mensajes_linea[$linea] = toba_recurso::imagen_toba($imagen, true, null, null, $ayuda);
             }
         }
         $this->generar_html_descripcion("{$titulo}: {$salida} {$extra}", $nivel);
     }
     //-- Vista previa
     echo "<div class='editor-vista-previa-codigo'>";
     $codigo = $this->controlador()->get_previsualizacion();
     require_once toba_dir() . '/php/3ros/PHP_Highlight.php';
     $h = new PHP_Highlight(false);
     $h->loadString($codigo);
     $formato_linea = "<span class='editor-linea-codigo'>%02d</span>&nbsp;&nbsp;";
     echo @$h->toHtml(true, true, $formato_linea, true, $mensajes_linea);
     echo '</div>';
 }
Example #22
0
    protected function estilos_css()
    {
        parent::estilos_css();
        ?>
		<style type="text/css">
			.codigo {
				padding: 10px; 
				margin-top: 5px;
				margin-bottom: 5px;
				border: 1px solid black; 
				background-color:#EEEAEE;		
			}
			.ci-cuerpo, .ci-wiz-cont {
				border: none;
				background-color: white;
				font-size: 12px;
			}
			.ci-wiz-enc {
				border: 0;
			}
			.ci-wiz-titulo, h2 {
				font-size: 1.5em; 
			}
			.lista-separada {
				list-style-image: url('<?php 
        echo toba_recurso::imagen_toba('nucleo/carpeta.gif');
        ?>
');
			}
			.lista-separada li {
				margin-top: 10px;
			}	
			.lista-separada .proyectos {
				background-color: #EEEAEE;
				border: 1px solid gray;
			}
			li {
				margin-bottom: 4px;
			}
			.caption {
				text-align: left;
				margin-left: 10px;
				margin-right: 10px;
				font-size:80%;
				font-style: italic;
				display:block;
			}
			.img-ef {
				background-color: #D5CECD;
				border: 1px solid gray;
			}			
		</style>			
		<?php 
    }
Example #23
0
 function __construct()
 {
     parent::__construct('Grupos de Acceso');
     foreach (toba_info_permisos::get_grupos_acceso() as $grupo) {
         $hijos[] = new catalogo_perfiles_grupo($this, $grupo['usuario_grupo_acc'], $grupo['nombre']);
     }
     $this->set_hijos($hijos);
     $this->agregar_icono(array('imagen' => toba_recurso::imagen_toba('nucleo/preferencias.gif', false), 'ayuda' => 'Administrar GRUPOS de ACCESO'));
     $opciones['menu'] = true;
     $opciones['celda_memoria'] = 'central';
     $this->agregar_utileria(array('imagen' => toba_recurso::imagen_toba('nucleo/agregar.gif', false), 'ayuda' => 'Crear un nuevo grupo de acceso', 'vinculo' => toba::vinculador()->get_url(toba_editor::get_id(), 1000261, null, $opciones), 'target' => apex_frame_centro));
 }
Example #24
0
 protected function get_imagen($nodo)
 {
     $img = '';
     if (isset($this->items[$nodo]['imagen'])) {
         $url_img = toba_recurso::imagen_de_origen($this->items[$nodo]['imagen'], $this->items[$nodo]['imagen_recurso_origen']);
         $img .= "<img src='{$url_img}' border=0 alt='' /> ";
     } else {
         //$url_img = toba_recurso::imagen_toba('nulo.gif');
         //$img .= "<img src='$url_img' width=1 height=16 border=0 alt='' />";
     }
     return $img;
 }
Example #25
0
 function get_input($id)
 {
     $html = '';
     $id_js = $this->id_js_arbol;
     $id_input = $id . '_carpeta';
     if ($this->comunicacion_elemento_input) {
         $img_marcar = toba_recurso::imagen_toba('aplicar.png', false);
         $html .= "<img src='{$img_marcar}' id='" . $id_input . "_img' onclick='{$id_js}.marcar(\"{$this->get_id()}\")' />";
     }
     $html .= "<input type='checkbox' value='1' id='{$id_input}' name='{$id_input}' onclick='{$id_js}.marcar(\"{$this->get_id()}\", this.value)' />";
     return $html;
 }
Example #26
0
 function __construct($padre, $id, $nombre)
 {
     parent::__construct($nombre, $padre);
     $this->id = $id;
     $this->nombre_largo = $nombre;
     $this->agregar_icono(array('imagen' => toba_recurso::imagen_toba('usuarios/usuario.gif', false), 'ayuda' => null));
     $opciones['menu'] = true;
     $opciones['celda_memoria'] = 'central';
     $parametros = array(apex_hilo_qs_zona => toba_editor::get_proyecto_cargado() . apex_qs_separador . $this->id);
     $this->agregar_utileria(array('imagen' => toba_recurso::imagen_toba('usuarios/permisos.gif', false), 'ayuda' => 'Editar DERECHOS del grupo de acceso', 'vinculo' => toba::vinculador()->get_url(toba_editor::get_id(), '3278', $parametros, $opciones), 'target' => apex_frame_centro));
     $this->agregar_utileria(array('imagen' => toba_recurso::imagen_toba('usuarios/grupo.gif', false), 'ayuda' => 'Editar el acceso a ITEMs del grupo de acceso', 'vinculo' => toba::vinculador()->get_url(toba_editor::get_id(), '3288', $parametros, $opciones), 'target' => apex_frame_centro));
     $this->agregar_utileria(array('imagen' => toba_recurso::imagen_toba('objetos/editar.gif', false), 'ayuda' => 'Editar GRUPO de ACCESO', 'vinculo' => toba::vinculador()->get_url(toba_editor::get_id(), 1000261, $parametros, $opciones), 'target' => apex_frame_centro));
 }
Example #27
0
 /**
  * Metodo que retorna los datos para cargar el app_launcher, se obtienen del usuario y de la clase de autenticacion
  */
 private function cargar_app_launcher_data()
 {
     // datos por defecto
     $appLauncherDataDefault = array('usuario_id' => toba::usuario()->get_id(), 'usuario_nombre' => toba::usuario()->get_nombre(), 'usuario_foto' => toba_recurso::imagen_toba('usuarios/foto_perfil_defecto.png'), 'aplicaciones' => array());
     // datos provenientes de la autenticacion
     $atributos_usuario = toba::manejador_sesiones()->get_autenticacion()->get_atributos_usuario();
     if (isset($atributos_usuario['appLauncherData']) && !empty($atributos_usuario['appLauncherData'])) {
         $appLauncherData = json_decode(current($atributos_usuario['appLauncherData']), true);
     } else {
         $appLauncherData = array();
     }
     // mergeo entre los datos por defecto y los datos de la autenticacion
     return array_merge($appLauncherDataDefault, $appLauncherData);
 }
Example #28
0
    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");
    }
Example #29
0
 function post_configurar()
 {
     parent::post_configurar();
     $img = toba_recurso::imagen_toba('nucleo/php.gif', true);
     $cliente = 'servicios/seguro_configuracion/ci_cliente.php';
     $url_cliente = toba::vinculador()->get_url('toba_editor', '30000014', array('archivo' => $cliente), array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $url_servicio = toba::vinculador()->get_url('toba_editor', '30000014', array('archivo' => $this->path_servicio), array('prefijo' => toba_editor::get_punto_acceso_editor()));
     $html = "<div style='float:right; background-color:white; padding: 10px'><a target='logger' href='{$url_cliente}'>{$img} Ver .php del Cliente</a>";
     $html .= "<br><a target='logger' href='{$url_servicio}'>{$img} Ver .php del Servicio</a>";
     $url_ejemplos = 'http://repositorio.siu.edu.ar/trac/toba/wiki/Referencia/ServiciosWeb';
     $html .= "<br>Documentación de <a target='_blank' href='{$url_ejemplos}'>servicios web en toba</a></div>";
     $html .= $this->pantalla()->get_descripcion();
     $this->pantalla()->set_descripcion($html);
 }
Example #30
0
 protected function generar_html_encabezado()
 {
     echo "<html><head>";
     $estilo = toba::proyecto()->get_parametro('estilo');
     echo toba_recurso::link_css("toba_impr", 'screen');
     echo toba_recurso::link_css("toba_impr", 'print');
     echo "<style type='text/css' media='print'>\n\t\t\t.barra-impresion {\n\t\t\t\tdisplay: none;\t\t\t\t\n\t\t\t}\n\t\t\t</style>\n";
     toba_js::cargar_consumos_basicos();
     echo "</head><body>\n";
     echo "<div class='barra-impresion'>";
     echo "<button onclick='window.print()'>" . toba_recurso::imagen_toba('impresora.gif', true, null, null) . "    Imprimir</button>";
     echo "</div>";
     echo $this->encabezado();
 }