Ver Mensaje Individual
  #11 (permalink)  
Antiguo 20/07/2006, 10:43
zsamer
 
Fecha de Ingreso: noviembre-2003
Mensajes: 798
Antigüedad: 20 años, 5 meses
Puntos: 8
El problema fue con el retorno del XML, el cual no le generaba correctamente, no me quedó muy claro el porque, pero lo solucioné creando el objeto xajax y registrar sus funciones fuera de la función que muestra el detalle de las imagenes (funcion zzz).

la estructura quedó de la siguiente forma:

modulo/galeria/index.php
Código PHP:
require_once("includes/xajax/xajax.functions.php");

function 
principal(){

}

function 
xxx(){

}

function 
yyy(){

}

function 
zzz(){


$smarty -> assign('xajax_javascript',$xajax->getJavascript('includes/xajax/'));
$smarty -> assign('fotos',$fotos);
$smarty -> assign('arrays_fotos',$arrays_fotos);
$smarty -> assign('arrays_plano',$arrays_plano);
$smarty -> assign('detalles',$detalles);
$smarty -> display('modulos/mod_galeria_detalle.tpl');
}

$accion=$_REQUEST['accion'];
switch(
$accion) {
   case 
"xxx":
    
xxx();
    break;
   case 
"yyy":
    
yyy();
    break;
   case 
"zzz":
    
zzz();
    break;
    default:
    
principal();
    break;

donde el archivo
xajax.functions.php :
Código PHP:
require_once("includes/xajax/xajax.inc.php");
$xajax = new xajax();

function 
MuestraImagen($image)
{
    require_once(
"includes/xajax/xajax.inc.php");
    
// do some stuff based on $arg like query data from a database and
    // put it into a variable like $newContent
    
$newContent  "<A HREF=\"javascript:popUp('modulos/galeria/images/$image')\" TITLE=\"Ver a tamano completo\">";
    
$newContent .= '<img  border=0 src="modulos/galeria/genthumbs.php?image='.$image.'&w=225" alt="'.$txtalt.'"><br>'.$descripcion.'<br><br>';

    
// FIN IMAGEN GRANDE    
    // Instantiate the xajaxResponse object
    
$objResponse = new xajaxResponse();
    
    
// add a command to the response to assign the innerHTML attribute of
    // the element with id="SomeElementId" to whatever the new content is
    
$objResponse->addAssign("default""style.display""none");
    
$objResponse->addAssign("SomeElementId","innerHTML"$newContent);
    
ob_end_clean();
    
//return the  xajaxResponse object
    
return $objResponse;
}

$xajax->debugOn(); // Uncomment this line to turn debugging on
$xajax->statusMessagesOn();
$xajax->registerFunction("MuestraImagen");
$xajax->processRequests(); 

Última edición por zsamer; 20/07/2006 a las 11:37