Exemplo n.º 1
0
            }
            // if (empty($course))
        } else {
            // no data has been taken from session (wizard)
            print_error('coursenotcreated');
        }
        redirect($CFG->wwwroot . "/course/view.php?id={$course->id}");
    }
}
//class ActionProcess
$wizard = new HTML_QuickForm_Controller('courseWizard', true);
$wizard->addPage(new NewCourseBasic('page1'));
$wizard->addPage(new NewCourseTechnology('page2'));
$wizard->addPage(new NewCourseSyncAsync('page3'));
// read values from the previous step
$wizard->setDefaults($wizard->exportValues());
$wizard->addAction('display', new ActionDisplay());
$wizard->addAction('process', new ActionProcess());
// generate heading
$site = get_site();
$streditcoursesettings = get_string("editcoursesettings");
$straddnewcourse = get_string("addnewcourse");
$stradministration = get_string("administration");
$strcategories = get_string("categories");
$navlinks = array();
$navlinks[] = array('name' => $stradministration, 'link' => "{$CFG->wwwroot}/{$CFG->admin}/index.php", 'type' => 'misc');
$navlinks[] = array('name' => $strcategories, 'link' => 'index.php', 'type' => 'misc');
$navlinks[] = array('name' => $straddnewcourse, 'link' => null, 'type' => 'misc');
print_header("{$site->shortname}: {$straddnewcourse}", $site->fullname, build_navigation($navlinks), "", "", true, print_course_search("", true, "navbar"));
print_heading(get_string("heading.newcourse", "samouk"));
$wizard->run();
Exemplo n.º 2
0
$authplugin = get_auth_plugin($CFG->registerauth);
if (!$authplugin->can_signup()) {
    error("Sorry, you may not use this page.");
}
//HTTPS is potentially required in this page
httpsrequired();
$mform_signup = new HTML_QuickForm_Controller('newuserWizard', true);
$mform_signup->addPage(new WizardStepOne());
$mform_signup->addPage(new WizardStepTwo());
$mform_signup->addPage(new WizardStepThree());
$mform_signup->addPage(new WizardStepFour());
$mform_signup->addPage(new WizardStepFive());
$mform_signup->addPage(new WizardStepSix());
$mform_signup->addPage(new WizardStepSeven());
// read values from the previous step
$mform_signup->setDefaults($mform_signup->exportValues());
$mform_signup->addAction('display', new ActionDisplay());
$mform_signup->addAction('process', new ActionProcess());
//    if ($mform_signup->is_cancelled()) {
//        redirect($CFG->httpswwwroot.'/login/index.php');
//
//    } else if ($user = $mform_signup->get_data()) {
//        $user->confirmed   = 0;
//        $user->lang        = current_language();
//        $user->firstaccess = time();
//        $user->mnethostid  = $CFG->mnet_localhost_id;
//        $user->secret      = random_string(15);
//        $user->auth        = $CFG->registerauth;
//
//        $authplugin->user_signup($user, true); // prints notice and link to login/index.php
//        exit; //never reached