* @author Romain Quetiez * @author Denis Flaven * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL */ require_once("../application/webpage.class.inc.php"); class ajax_page extends WebPage { /** * Jquery style ready script * @var Hash */ protected $m_sReadyScript; /** * constructor for the web page * @param string $s_title Not used */ function __construct($s_title) { parent::__construct($s_title); $this->m_sReadyScript = ""; $this->add_header("Content-type: text/html; charset=utf-8"); $this->add_header("Cache-control: no-cache"); } /** * Echoes the content of the whole page * @return void */ public function output() { foreach($this->a_headers as $s_header) { header($s_header); } $s_captured_output = ob_get_contents(); ob_end_clean(); echo $this->s_content; if (!empty($this->m_sReadyScript)) { echo "\n"; } if (trim($s_captured_output) != "") { echo $s_captured_output; } } /** * Adds a paragraph with a smaller font into the page * NOT implemented (i.e does nothing) * @param string $sText Content of the (small) paragraph * @return void */ public function small_p($sText) { } /** * Adds a script to be executed when the DOM is ready (typical JQuery use) * NOT implemented in this version of the class. * @return void */ public function add_ready_script($sScript) { // Does nothing in ajax rendered content.. for now... // Maybe we should add this as a simple