<?php /*~ redirect.inc.php
.---------------------------------------------------------------------------.
|  Software: URL Redirection Library                                        |
|   Version: 0.1                                                            |
|   Contact: via http://www.uniwits.com/contact                             |
|      Info: http://www.uniwits.com/                                        |
|   Support: http://www.uniwits.com/support                                 |
|      Note: This library is designed for Linux and compatible systems.     |
| ------------------------------------------------------------------------- |
|     Admin: Yuxiang Mao (project admininistrator)                          |
|   Authors: Yuxiang Mao (Uniwits) contact@uniwits.com                      |
|   Founder: Yuxiang Mao                                                    |
| Copyright (c) 2010-2012, Yuxiang Mao. All Rights Reserved.                |
| ------------------------------------------------------------------------- |
|   License: Distributed under Uniwits Shareware License (USL)              |
|            http://www.uniwits.com/licenses/shareware/                     |
| This program is distributed as a part of software provided by Uniwits     |
| System WITHOUT ANY WARRANTY; without even the implied warranty of         |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                      |
| ------------------------------------------------------------------------- |
*/ function wizard_get_name() { return TGET('wizard'); } function redirect($defaulturl,$roadmap=false) { if (is_array($roadmap)) { $wizardname_cur=wizard_get_name(); $url=null; foreach ($roadmap as $wizardname=>$target) { if ($wizardname==$wizardname_cur) $url=$target; } } if (!$url) $url=$defaulturl; header("Location: ".$url); } function wizard_set_data($varname,$value,$wizardname=null) { if (!$wizardname) $wizardname=wizard_get_name(); if (!$wizardname) trigger_error("In call to 'wizard_set_data(...)', Wizard Name is empty.",E_USER_WARNING); $_SESSION['uniwits.wizard.data'][$wizardname][$varname]=$value; } function wizard_get_data($varname,$wizardname=null) { if (!$wizardname) $wizardname=wizard_get_name(); return $_SESSION['uniwits.wizard.data'][$wizardname][$varname]; } function wizard_clear($wizardname=null) { if (!$wizardname) $wizardname=wizard_get_name(); if (!$wizardname) trigger_error("In call to 'wizard_set_data(...)', Wizard Name is empty.",E_USER_WARNING); unset($_SESSION['uniwits.wizard.data'][$wizardname]); } function prepare_wizard_dataset($wizardname=false) { $dataset=array(); if (!$wizardname) $wizardname=wizard_get_name(); if ($wizardname) { $dataset['WIZARD-PARAM']='wizard='.urlencode($wizardname); $dataset['WIZARD-PARAM-DBLHYP']='-wizard-'.urlencode(dblhyp($wizardname)); $dataset['WIZARD-NAME']=$wizardname; $dataset['WIZARD-AREA-'.strtoupper($wizardname)]=array(0); $data=array(); if (is_array($_SESSION['uniwits.wizard.data'][$wizardname])) foreach ($_SESSION['uniwits.wizard.data'][$wizardname] as $k=>$v) $data[$k]=$v; $dataset['WIZARD-DATA']=array($data); } return $dataset; } ?>