owner != $S['user']->id) { return '404'; } wizard::set_configuration($S['wizard']['configuration']); if (isset($request['wizard_submit'])) { $steps=array_keys($request['wizard_submit']); $step=$steps[0]; wizard_load_step($step); debug('wizard', "processing $configuration->module step $step"); $result=$S['wizard']['step']->process(); if ($result === $step) { debug('wizard', "$configuration->module step $step not finished - staying put"); } elseif ($result === null) { debug('wizard', "$configuration->module step $step returned null - config finished"); $configuration->status=0; $configuration->write(); } else { $configuration->status=$result; $configuration->write(); wizard_load_step($result); } } elseif (isset($request['step']) && ctype_alnum($request['step'])) { wizard_load_step($request['step']); } elseif ($configuration->status > 0) { wizard_load_step($configuration->status); } } elseif (isset($request['init'])) { $S['wizard']['configuration']=new sql_configuration(); wizard::set_configuration($S['wizard']['configuration']); $configuration=&$S['wizard']['configuration']; $configuration->name=$request['name']; $mod=isset($request['mod']) && isset($conf['modules'][$request['mod']])?$conf['modules'][$request['mod']]:$conf['modules'][0]; $configuration->module=$mod; $configuration->init(); debug('wizard', "Module: $mod"); wizard_load_step(1); } if (isset($S['wizard']['step'])) { return array('title' => $S['wizard']['step']->title); } else { return array('title' => 'Create'); } } function body_configurations_wizard() { global $S, $conf; if (isset($S['wizard']['configuration'])) { $configuration=&$S['wizard']['configuration']; if ($configuration->status == 0) { echo print_success('Config finished!', '
Name (optional):
'); } else { $S['wizard']['step']->output(); } } else { echo '

Request an image built

Name of your configuration (optional):
'; if (count($conf['modules']) > 1) { echo 'Module:
'; } echo '
'; } } function &wizard_load_step($step) { global $S; if (!isset($S['wizard']['steps'][$step])) { $S['wizard']['steps'][$step]=new wizard_step($S['wizard']['configuration']->module, $step); } $S['wizard']['step']=&$S['wizard']['steps'][$step]; return $S['wizard']['steps']; } ?>