* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
/** Process information resulting of the application of the page.
* This function must return a clue indicating the next page to show.
/** Process information resulting of the application of the page.
* This function must return a clue indicating the next page to show.
- public function __construct($name, $layout, $stateless = false)
+ public function __construct($name, $layout, $stateless = false, $ajax = true)
if (!isset($_SESSION[$this->name])) {
$_SESSION[$this->name] = array();
$_SESSION[$this->name . '_page'] = null;
if (!isset($_SESSION[$this->name])) {
$_SESSION[$this->name] = array();
$_SESSION[$this->name . '_page'] = null;
- public function apply(PlatalPage &$smarty, $baseurl, $pgid = null)
+ public function apply(PlatalPage &$smarty, $baseurl, $pgid = null, $mode = 'normal')
{
if ($this->stateless && (isset($this->lookup[$pgid]) || isset($this->pages[$pgid]))) {
$curpage = is_numeric($pgid) ? $pgid : $this->lookup[$pgid];
{
if ($this->stateless && (isset($this->lookup[$pgid]) || isset($this->pages[$pgid]))) {
$curpage = is_numeric($pgid) ? $pgid : $this->lookup[$pgid];
- $smarty->changeTpl($this->layout);
+ if ($mode == 'ajax') {
+ header('Content-Type: text/html; charset=utf-8');
+ $smarty->changeTpl($page->template(), NO_SKIN);
+ } else {
+ $smarty->changeTpl($this->layout);
+ }
$smarty->assign('pages', $this->titles);
$smarty->assign('current', $curpage);
$smarty->assign('lookup', $this->inv_lookup);
$smarty->assign('stateless', $this->stateless);
$smarty->assign('wiz_baseurl', $baseurl);
$smarty->assign('pages', $this->titles);
$smarty->assign('current', $curpage);
$smarty->assign('lookup', $this->inv_lookup);
$smarty->assign('stateless', $this->stateless);
$smarty->assign('wiz_baseurl', $baseurl);
$smarty->assign('tab_width', (int)(99 / count($this->pages)));
$smarty->assign('wiz_page', $page->template());
$smarty->assign('xorg_no_errors', true);
$smarty->assign('tab_width', (int)(99 / count($this->pages)));
$smarty->assign('wiz_page', $page->template());
$smarty->assign('xorg_no_errors', true);