Example #1
0
 function evt__mostrar()
 {
     //-- Cual es el mensaje a mostrar?
     $mensaje = null;
     switch ($this->s__opciones['origen']) {
         case 'mensaje_manual':
             $mensaje = $this->s__opciones['texto'];
             $pepe = null;
             break;
         case 'mensaje_componente':
             //Mensaje propio del componente
             $mensaje = $this->get_mensaje('info_local', array('uno', 'dos', 'tres'));
             break;
         case 'mensaje_global':
             $mensaje = toba::mensajes()->get('info_global', array('primer', date('d/M/Y')));
             break;
     }
     switch ($this->s__opciones['componente']) {
         case 'modal':
             toba::notificacion()->agregar($mensaje, $this->s__opciones['nivel']);
             break;
         case 'pantalla':
             $this->pantalla()->agregar_notificacion($mensaje, $this->s__opciones['nivel']);
             break;
         case 'formulario':
             $this->dep('opciones')->agregar_notificacion($mensaje, $this->s__opciones['nivel']);
             break;
     }
 }
Example #2
0
 function conf__inicial()
 {
     require_once 'php_referencia.php';
     //toba::menu()->set_abrir_nueva_ventana();
     toba::db()->set_parser_errores(new toba_parser_error_db_postgres7());
     toba::mensajes()->set_fuente_ini(toba::proyecto()->get_path() . '/mensajes.ini');
     //Autenticacion personalizada
     /*$autentificacion = new toba_autenticacion_ldap('ldap-test.siu.edu.ar', "dc=ldap,dc=siu,dc=edu,dc=ar");
     		toba::manejador_sesiones()->set_autenticacion($autentificacion);*/
 }
Example #3
0
 protected function generar_ayuda()
 {
     $mensaje = toba::mensajes()->get_operacion_actual();
     if (isset($mensaje)) {
         if (strpos($mensaje, ' ') !== false) {
             //Detecta si es una url o un mensaje completo
             $desc = toba_parser_ayuda::parsear($mensaje);
             $ayuda = toba_recurso::ayuda(null, $desc, 'item-barra-ayuda', 0);
             echo "<div {$ayuda}>";
             echo toba_recurso::imagen_toba("ayuda_grande.gif", true);
             echo "</div>";
         } else {
             if (!toba_parser_ayuda::es_texto_plano($mensaje)) {
                 $mensaje = toba_parser_ayuda::parsear($mensaje, true);
                 //Version resumida
             }
             $js = "abrir_popup('ayuda', '{$mensaje}', {width: 800, height: 600, scrollbars: 1})";
             echo "<a class='barra-superior-ayuda' href='#' onclick=\"{$js}\" title='Abrir ayuda'>" . toba_recurso::imagen_toba("ayuda_grande.gif", true) . "</a>";
         }
     }
 }
Example #4
0
 /**
  * Agrega un mensaje a mostrar al usuario, el mensaje se obtiene con 
  * toba::mensajes()->get($indice, $parametros)
  *
  * @param string $nivel Determina el estilo del mensaje, 'error' o 'info' 
  * @see toba_mensajes
  */
 function agregar_id($indice, $parametros = null, $nivel = 'error')
 {
     $this->agregar(toba::mensajes()->get($indice, $parametros), $nivel);
 }
Example #5
0
 /**
  * Retorna un mensaje asociado al componente
  *
  * @param mixed $indice Indice del mensaje en el componente
  * @param mixed $parametros Parámetros posicionales a ser reemplazados en el mensaje (puede ser uno solo o un array)
  * @return string Mensaje parseado
  * @see toba_mensajes
  */
 function get_mensaje($indice, $parametros = null)
 {
     //Busco el mensaje del OBJETO
     if ($mensaje = toba::mensajes()->get_componente($this->_id[1], $indice, $parametros)) {
         return $mensaje;
     } else {
         //El objeto no tiene un mensaje con el indice solicitado,
         //Busco el INDICE global
         return toba::mensajes()->get($indice, $parametros);
     }
 }
Example #6
0
 /**
  * Obtiene los mensajes del proyecto definidos en el editor, útiles para evitar fijar los mensajes del usuario en el código
  * @return toba_mensajes
  */
 static function mensajes()
 {
     if (!isset(self::$mensajes)) {
         self::$mensajes = new toba_mensajes();
     }
     return self::$mensajes;
 }