Exemple #1
0
 /**
  * Muestra toda la lista de notificaciones almacenadas
  * Esto tiene que hacerse una única vez por página, y por lo generar el framework 
  * es el encargado de hacerlo
  */
 function mostrar($incluir_comsumos = true)
 {
     if ($incluir_comsumos) {
         toba_js::cargar_consumos_basicos();
         //Por si no se cargaron antes
         toba_js::cargar_consumos_globales(array("basicos/notificacion"));
         echo toba_js::abrir();
     }
     foreach ($this->mensajes as $mensaje) {
         $texto = toba_parser_ayuda::parsear($mensaje[0]);
         $texto = str_replace("'", '"', $texto);
         $texto = toba_js::string($texto);
         //Mensaje para debug
         if (isset($mensaje[2]) && trim($mensaje[2]) != '') {
             $texto_debug = toba_parser_ayuda::parsear($mensaje[2]);
             $texto_debug = str_replace("'", '"', $texto_debug);
             $texto_debug = toba_js::string($texto_debug);
             echo "notificacion.agregar('{$texto}' + '\\n', '{$mensaje[1]}', undefined, '{$texto_debug}');\n";
         } else {
             echo "notificacion.agregar('{$texto}' + '\\n', '{$mensaje[1]}');\n";
         }
     }
     if (isset($this->titulo)) {
         echo "notificacion.set_titulo_ventana('{$this->titulo}');\n";
     }
     echo "notificacion.mostrar();\n";
     if ($incluir_comsumos) {
         echo toba_js::cerrar();
     }
 }