Beispiel #1
0
 /**
  * Registers a handler for a specific action.
  *
  * @param      string    $actionName  name of the action
  * @param      object    $action      the handler for the action
  * @return     void
  * @access     public
  * @since      2.1.0
  */
 function addAction($actionName, &$action)
 {
     $this->_act[$actionName] = get_class($action);
     parent::addAction($actionName, $action);
 }
Beispiel #2
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();
print_footer($course);
<input type="hidden" name="os0" value="">
<input type="hidden" name="on1" value="Reference No: <?php 
        echo 'M09-' . $last_id;
        ?>
 ">
<input type="hidden" name="os1" value="">
<br>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynow_LG.gif">
</form>
<?php 
        echo htmlentities(T_("Note:")) . " " . htmlentities(T_("Your registration is only valid as soon as we received your payment.")) . "<br>\n";
        echo htmlentities(T_("You have to pay within 2 weeks of completing your registration (this is now), otherwise the system will delete your registration automatically")) . "<br>\n";
        session_destroy();
    }
}
// Neue Formular-Objekte mit eindeutigem Namen ableiten
$seite1 = new Form_Personal('seite1');
$seite2 = new Form_Motivation('seite2');
$seite4 = new Form_Bankdaten('seite4');
// Neues Controller-Objekt ableiten
$controller = new HTML_QuickForm_Controller('mnformular', true);
// Formularseiten hinzufuegen
$controller->addPage($seite1);
$controller->addPage($seite2);
$controller->addPage($seite4);
// add the actions
$controller->addAction('display', new ActionDisplay());
$controller->addAction('process', new ActionProcess());
// Controller ausfuehren
$controller->run();
$mdb2->disconnect();
Beispiel #4
0
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
//    }