<?php
/**
*
* @author Benjamin Gillissen <hide@address.com>
*
* **************************************************************
Copyright (C) 2009 Benjamin Gillissen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details at:
http://www.gnu.org/copyleft/gpl.html
* **************************************************************
*/
class ajx_contentrefresh extends ajax {
public static function contentrefresh(){
parent::$CB = __FUNCTION__;
//FIXME ADD support for other pagegen build method...
$pid = browsing::get_active();
$obj = pages::get_conf( $pid );
$class = 'pg_'.$obj;
if ( FALSE === class_exists($class) ){
errors::raise("The object defined to build this page was not found.", CORE_LOG_ALERT,'PGEN');return;
}
parent::addAssign('events', 'innerHTML', '');
$pgobj = new $class($pid, browsing::getargs() );
ob_start();
$pgobj->send_content("");
$content = ob_get_contents();
$content = langs::recode($content, langs::charset(), 'UTF-8');
ob_end_clean();
parent::addAssign("content", "innerHTML", $content);
return parent::getReply();
}
}