* 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.
* id (PlWizard::FIRST_PAGE, PlWizard::NEXT_PAGE, PlWizard::CURRENT_PAGE
* PlWizard::PREVIOUS_PAGE, PlWizard::LAST_PAGE).
*/
* id (PlWizard::FIRST_PAGE, PlWizard::NEXT_PAGE, PlWizard::CURRENT_PAGE
* PlWizard::PREVIOUS_PAGE, PlWizard::LAST_PAGE).
*/
- public function __construct($name, $layout, $stateless = false)
+ public function __construct($name, $layout, $stateless = false, $ajax = true, $ajax_animated = 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 addUserData($name, $value)
+ {
+ $this->userdata[$name] = $value;
+ }
+
+ public function getUserData($name, $default = null)
+ {
+ return $this->userdata[$name];
+ }
+
public function set($varname, $value)
{
$_SESSION[$this->name][$varname] = $value;
public function set($varname, $value)
{
$_SESSION[$this->name][$varname] = $value;
- public function apply(PlatalPage &$smarty, $baseurl, $pgid = null)
+ public function apply(PlPage &$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];
- pl_redirect($baseurl . '/' . $this->inv_lookup[$curpage]);
+ if (isset($success) && $success) {
+ pl_redirect($baseurl . '/' . $this->inv_lookup[$curpage] . '/null/' . $success);
+ } else {
+ pl_redirect($baseurl . '/' . $this->inv_lookup[$curpage]);
+ }
- $smarty->changeTpl($this->layout);
+ if ($mode == 'ajax') {
+ pl_content_headers("text/html");
+ $smarty->changeTpl($this->layout, NO_SKIN);
+ $smarty->assign('wiz_run_ajax', true);
+ } 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('tab_width', (int)(99 / count($this->pages)));
$smarty->assign('wiz_page', $page->template());
- $smarty->assign('xorg_no_errors', true);
- $page->prepare($smarty);
+ $smarty->assign('pl_no_errors', true);
+ $page->prepare($smarty, isset($this->inv_lookup[$curpage]) ? $this->inv_lookup[$curpage] : $curpage);
+ if (isset($success) && $success) {
+ $smarty->trigSuccess($page->success());
+ }