예제 #1
0
 /**
  *  Envia la botonera del selector
  */
 private function html_botonera_selector()
 {
     $objeto_js = $this->_cuadro->get_id_objeto_js();
     //Saco la botonera para subir/bajar filas
     echo "<div id='botonera_selector' class='ei-ml-botonera'>";
     echo toba_form::button_html("{$objeto_js}_subir", toba_recurso::imagen_toba('nucleo/orden_subir.gif', true), "onclick='{$objeto_js}.subir_fila_selector();'", 0, '<', 'Sube una posición la fila seleccionada');
     echo toba_form::button_html("{$objeto_js}_bajar", toba_recurso::imagen_toba('nucleo/orden_bajar.gif', true), "onclick='{$objeto_js}.bajar_fila_selector();' ", 0, '>', 'Baja una posición la fila seleccionada');
     echo '</div>';
 }
예제 #2
0
 protected function generar_formulario_cuerpo()
 {
     echo '<tbody>';
     if ($this->_registro_nuevo !== false) {
         $template = is_array($this->_registro_nuevo) ? $this->_registro_nuevo : array();
         $this->agregar_registro($template);
     }
     //------ FILAS ------
     $this->_filas_enviadas = array();
     if (!isset($this->_ordenes)) {
         $this->_ordenes = array();
     }
     //Se recorre una fila más para insertar una nueva fila 'modelo' para agregar en js
     if ($this->_info_formulario['filas_agregar'] && $this->_info_formulario['filas_agregar_online']) {
         $this->_datos['__fila__'] = array();
         $this->_ordenes[] = '__fila__';
     }
     $a = 0;
     foreach ($this->_ordenes as $fila) {
         $dato = $this->_datos[$fila];
         //Si la fila es el template ocultarla
         if ($fila !== '__fila__') {
             $this->_filas_enviadas[] = $fila;
             $estilo_fila = '';
             $es_fila_modelo = false;
         } else {
             $estilo_fila = "style='display:none;'";
             $es_fila_modelo = true;
         }
         //Determinar el estilo de la fila
         if (isset($this->_clave_seleccionada) && $fila == $this->_clave_seleccionada) {
             $this->estilo_celda_actual = 'ei-ml-fila-selec';
         } else {
             $this->estilo_celda_actual = 'ei-ml-fila';
         }
         $this->cargar_registro_a_ef($fila, $dato);
         //--- Se cargan las opciones de los efs de esta fila
         $this->_carga_opciones_ef->cargar();
         //--- Ventana para poder configurar una fila especifica
         $callback_configurar_fila_contenedor = 'conf_fila__' . $this->_parametros['id'];
         if (method_exists($this->controlador, $callback_configurar_fila_contenedor)) {
             $this->controlador->{$callback_configurar_fila_contenedor}($fila);
         }
         //-- Inicio html de la fila
         echo "\n<!-- FILA {$fila} -->\n\n";
         echo "<tr {$estilo_fila} id='{$this->objeto_js}_fila{$fila}' onclick='{$this->objeto_js}.seleccionar({$fila})'>";
         if ($this->_info_formulario['filas_numerar']) {
             echo "<td class='{$this->estilo_celda_actual} ei-ml-fila-numero'>\n<span id='{$this->objeto_js}_numerofila{$fila}'>" . ($a + 1);
             echo "</span></td>\n";
         }
         //--Layout de las filas
         $this->generar_layout_fila($fila);
         //--Numeración de las filas
         if ($this->_info_formulario['filas_ordenar'] && $this->_ordenar_en_linea) {
             echo "<td class='{$this->estilo_celda_actual} ei-ml-fila-ordenar'>\n";
             echo "<a href='javascript: {$this->objeto_js}.subir_seleccionada();' id='{$this->objeto_js}_subir{$fila}' style='visibility:hidden' title='Subir la fila'>" . toba_recurso::imagen_toba('nucleo/orden_subir.gif', true) . '</a>';
             echo "<a href='javascript: {$this->objeto_js}.bajar_seleccionada();' id='{$this->objeto_js}_bajar{$fila}' style='visibility:hidden' title='Bajar la fila'>" . toba_recurso::imagen_toba('nucleo/orden_bajar.gif', true) . '</a>';
             echo "</td>\n";
         }
         //--Creo los EVENTOS de la FILA
         $this->generar_eventos_fila($fila);
         //-- Borrar a nivel de fila
         if ($this->_info_formulario['filas_agregar'] && $this->_borrar_en_linea && $es_fila_modelo) {
             //Si no es la fila modelo, evito que se pueda eliminar
             echo "<td class='{$this->estilo_celda_actual} ei-ml-columna-evt ei-ml-fila-borrar'>";
             echo toba_form::button_html("{$this->objeto_js}_eliminar{$fila}", toba_recurso::imagen_toba('borrar.gif', true), "onclick='{$this->objeto_js}.seleccionar({$fila});{$this->objeto_js}.eliminar_seleccionada();'", $this->_rango_tabs[0]++, null, 'Elimina la fila');
             echo "</td>\n";
         }
         echo "</tr>\n";
         $a++;
     }
     echo "</tbody>\n";
 }
예제 #3
0
파일: toba_form.php 프로젝트: emma5021/toba
 static function button($nombre, $valor, $extra = "", $clase = "ei-boton", $tecla = null)
 {
     if ($tecla === null) {
         return "<INPUT type='button' name='{$nombre}' id='{$nombre}' value='{$valor}' class='{$clase}' {$extra} />\n";
     } else {
         return toba_form::button_html($nombre, $valor, $extra, 0, $tecla, '', 'button', '', $clase);
     }
 }
예제 #4
0
 /**
  *	Genera el HTML del BOTON
  */
 function get_html($id_submit, $objeto_js, $id_componente)
 {
     if ($this->anulado) {
         return null;
     }
     $tab_order = toba_manejador_tabs::instancia()->siguiente();
     $tip = '';
     if (isset($this->datos['ayuda'])) {
         $tip = $this->datos['ayuda'];
     }
     $acceso = tecla_acceso($this->datos['etiqueta']);
     if (!$this->es_seleccion_multiple()) {
         $clase_predeterminada = $this->esta_sobre_fila() ? 'ei-boton-fila' : 'ei-boton';
         $clase = isset($this->datos['estilo']) && trim($this->datos['estilo']) != "" ? $this->datos['estilo'] : $clase_predeterminada;
         $tipo_boton = 'button';
         if (!$this->esta_sobre_fila() && isset($this->datos['defecto']) && $this->datos['defecto']) {
             $tipo_boton = 'submit';
             $clase .= '  ei-boton-defecto';
         }
         $estilo_inline = $this->oculto ? 'display: none' : null;
         $html = '';
         $html .= $this->get_imagen();
         $html .= $acceso[0];
         $tecla = $acceso[1];
         $js = $this->get_invocacion_js($objeto_js, $id_componente);
         if (isset($js)) {
             $js = 'onclick="' . $js . '"';
             return toba_form::button_html($id_submit . "_" . $this->get_id(), $html, $js, $tab_order, $tecla, $tip, $tipo_boton, '', $clase, true, $estilo_inline, $this->activado);
         }
     } else {
         $js = $this->get_invocacion_js($objeto_js, $id_componente);
         $html = '<label>';
         $html .= $this->get_imagen();
         if (isset($js)) {
             $extra = 'onclick="' . $js . '"';
             $extra .= " title='{$tip}'";
             $extra .= $this->activado ? '' : ' disabled';
             $valor_actual = $this->es_check_activo ? $this->parametros : null;
             $html .= toba_form::checkbox($id_submit . "_" . $this->get_id(), $valor_actual, $this->parametros, '', $extra);
         }
         $html .= '</label>';
         return $html;
     }
 }
예제 #5
0
 /**
  * Genera el HTML de la botonera de agregar/quitar/ordenar filas
  */
 protected function generar_botonera_manejo_filas()
 {
     $agregar = $this->_info_formulario['filas_agregar'] && (!$this->_modo_agregar[0] || !$this->_borrar_en_linea);
     $ordenar = $this->_info_formulario['filas_ordenar'];
     if ($agregar || $ordenar && !$this->_ordenar_en_linea) {
         echo "<div class='ei-ml-botonera'>";
         if ($agregar) {
             if ($this->_mostrar_agregar) {
                 if (!$this->_modo_agregar[0]) {
                     $img = toba_recurso::imagen_toba('nucleo/agregar.gif', false);
                     if ($this->_modo_agregar[1] != '') {
                         $texto = "<img src='{$img}' style='vertical-align: middle;' /> " . $this->_modo_agregar[1];
                     } else {
                         $texto = toba_recurso::imagen_toba('nucleo/agregar.gif', true);
                     }
                     echo toba_form::button_html("{$this->objeto_js}_agregar", $texto, "onclick='{$this->objeto_js}.crear_fila();'", $this->_rango_tabs[0]++, '+', 'Crea una nueva fila');
                 }
             }
             if (!$this->_borrar_en_linea) {
                 echo toba_form::button_html("{$this->objeto_js}_eliminar", toba_recurso::imagen_toba('nucleo/borrar.gif', true), "onclick='{$this->objeto_js}.eliminar_seleccionada();' disabled", $this->_rango_tabs[0]++, '-', 'Elimina la fila seleccionada');
             }
         }
         if ($this->_info_formulario['filas_agregar']) {
             //Si se pueden agregar o quitar filas, el deshacer debe estar
             $html = toba_recurso::imagen_toba('nucleo/deshacer.gif', true) . "<span id='{$this->objeto_js}_deshacer_cant'  style='font-size: 8px;'></span>";
             echo toba_form::button_html("{$this->objeto_js}_deshacer", $html, " onclick='{$this->objeto_js}.deshacer();' disabled", $this->_rango_tabs[0]++, 'z', 'Deshace la última eliminación');
             echo "&nbsp;";
         }
         if ($ordenar && !$this->_ordenar_en_linea) {
             echo toba_form::button_html("{$this->objeto_js}_subir", toba_recurso::imagen_toba('nucleo/orden_subir.gif', true), "onclick='{$this->objeto_js}.subir_seleccionada();' disabled", $this->_rango_tabs[0]++, '<', 'Sube una posición la fila seleccionada');
             echo toba_form::button_html("{$this->objeto_js}_bajar", toba_recurso::imagen_toba('nucleo/orden_bajar.gif', true), "onclick='{$this->objeto_js}.bajar_seleccionada();' disabled", $this->_rango_tabs[0]++, '>', 'Baja una posición la fila seleccionada');
         }
         echo "</div>\n";
     }
 }
예제 #6
0
 /**
  * @ignore 
  */
 protected function generar_formulario_cuerpo()
 {
     echo "<tbody>";
     $estilo_celda = "ei-filtro-fila";
     foreach ($this->_columnas as $nombre_col => $columna) {
         $this->analizar_visualizacion_columna($columna);
         if ($columna->es_visible()) {
             $estilo_fila = "";
         } else {
             $estilo_fila = "style='display:none;'";
         }
         echo "\n<!-- FILA {$nombre_col} -->\n\n";
         echo "<tr {$estilo_fila} id='{$this->objeto_js}_fila{$nombre_col}' onclick='{$this->objeto_js}.seleccionar(\"{$nombre_col}\")'>";
         echo "<td class='{$estilo_celda} ei-filtro-col'>";
         echo $this->generar_vinculo_editor($nombre_col);
         echo $columna->get_html_etiqueta();
         echo "</td>\n";
         //-- Condición
         echo "<td class='{$estilo_celda} ei-filtro-cond'>";
         echo $columna->get_html_condicion();
         echo "</td>\n";
         //-- Valor
         echo "<td class='{$estilo_celda} ei-filtro-valor'>";
         $columna->get_html_valor();
         echo "</td>\n";
         //-- Borrar a nivel de fila
         echo "<td class='{$estilo_celda} ei-filtro-borrar'>";
         //Si es obligatoria no se puede borrar
         if (!$columna->es_solo_lectura() && !$columna->es_obligatorio()) {
             echo toba_form::button_html("{$this->objeto_js}_eliminar{$nombre_col}", toba_recurso::imagen_toba('borrar.gif', true), "onclick='{$this->objeto_js}.seleccionar(\"{$nombre_col}\");{$this->objeto_js}.eliminar_seleccionada();'", $this->_rango_tabs[0]++, null, 'Elimina la fila');
         } else {
             echo '&nbsp;';
         }
         echo "</td>\n";
         echo "</tr>\n";
     }
     echo "</tbody>\n";
 }