MDL-32235 improving the allocation results rendering

The new renderable class workshop_allocation_result provides a cleaner
interface between the allocator's init() method and the allocation.php
script.
This commit is contained in:
David Mudrak
2012-04-13 04:49:45 +02:00
parent 0ee608e99d
commit 31cea236af
5 changed files with 168 additions and 81 deletions
+6 -5
View File
@@ -74,13 +74,14 @@ if (!empty($allocators)) {
$tabs[] = $row;
print_tabs($tabs, $currenttab, $inactive, $activated);
if (!empty($initresult)) {
echo $output->container_start('allocator-init-results');
echo $output->render(new workshop_allocation_init_result($initresult, $workshop->allocation_url($method)));
echo $output->container_end();
} else {
if (is_null($initresult->get_status()) or $initresult->get_status() == workshop_allocation_result::STATUS_VOID) {
echo $output->container_start('allocator-ui');
echo $allocator->ui();
echo $output->container_end();
} else {
echo $output->container_start('allocator-init-results');
echo $output->render($initresult);
echo $output->continue_button($workshop->allocation_url($method));
echo $output->container_end();
}
echo $output->footer();