Пример #1
0
$PAGE->set_url($teamwork->allocation_url($method));
require_login($course, false, $cm);
$context = $PAGE->context;
require_capability('mod/teamwork:allocate', $context);
$PAGE->set_title($teamwork->name);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add(get_string('allocation', 'teamwork'));
$allocator = $teamwork->allocator_instance($method);
$initresult = $allocator->init();
//
// Output starts here
//
$output = $PAGE->get_renderer('mod_teamwork');
echo $output->header();
echo $OUTPUT->heading(format_string($teamwork->name));
$allocators = teamwork::installed_allocators();
if (!empty($allocators)) {
    $tabs = array();
    $row = array();
    $inactive = array();
    $activated = array();
    foreach ($allocators as $methodid => $methodname) {
        $row[] = new tabobject($methodid, $teamwork->allocation_url($methodid)->out(), $methodname);
        if ($methodid == $method) {
            $currenttab = $methodid;
        }
    }
}
$tabs[] = $row;
print_tabs($tabs, $currenttab, $inactive, $activated);
if (is_null($initresult->get_status()) or $initresult->get_status() == teamwork_allocation_result::STATUS_VOID) {