function PAGE_Solutions() { global $pageid; redirector_add_skipvar('action'); redirector_add_skipvar('id'); redirector_add_skipvar('detail'); if (!$this->GetAllowed('SOLUTIONS.MANAGE')) { return; } $this->Solutions_ActionHandler(); $this->gateway->AppendNavigation('Список решений участников олимпиады', '?page=solutions' . ($pageid != '' ? '&pageid=' . $pageid : '')); $this->CPrintLn(stencil_formo()); $this->InsertTemplate('solutions_form', array('lib' => $this, 'accDel' => $this->GetAllowed('SOLUTIONS.DELETE'))); $this->CPrintLn(stencil_formc()); }
function formc() { println(stencil_formc()); }
function PAGE_Status() { global $action, $id; $manage = $this->IsContestJudge(); $WT_contest_id = $_SESSION['WT_contest_id']; if (!WT_contest_running($WT_contest_id) && !WT_contest_finished($WT_contest_id) && !$manage) { content_unavaliable(); return; } $this->gateway->AppendNavigation('Статус по контесту', '.?page=submit'); $this->CPrintLn(stencil_formo('')); $this->InsertTemplate('status', array('lib' => $this)); $this->CPrintLn(stencil_formc()); }
function Page_Contest() { global $action, $id, $changeto, $clear; $this->AppendNavigation('Список контестов', '/?page=contest'); redirector_add_skipvar('action', 'restart'); redirector_add_skipvar('action', 'start'); redirector_add_skipvar('action', 'delete'); if ($action != 'manage') { redirector_add_skipvar('id'); } $ccnt = $this->SpawnContestContainer(); $create = $this->GetAllowed('CONTEST.CREATE'); $del = $this->GetAllowed('CONTEST.DELETE'); $manage = $this->GetAllowed('CONTEST.MANAGE'); $pageManage = $action == 'manage' && $manage; if (!isset($clear)) { if (isset($changeto)) { $this->SwitchToContest($changeto); if ($manage) { redirect('.?page=contest&action=manage&id=' . $changeto); } } if ($action == 'create' && $create) { $ccnt->CreateReceived(); redirect('SELF', array('action' => '')); } if ($action == 'delete' && $del) { $ccnt->Delete($id); redirect('SELF', array('action' => '', 'id' => '')); } if ($manage) { if ($action == 'stop' || $action == 'start' || $action == 'restart') { $ccnt->{$action}($id); } if ($action == 'save' && $manage) { $cnt = WT_spawn_new_contest_container(0); $action = 'manage'; $cnt->Save($id); } } if ($action == 'manage' && !$manage) { unset($action); unset($id); } if ($pageManage) { $this->CPrintLn('<table width="100%"><tr valign="top">' . '<td width="50%" style="padding-right: 2px;">'); } $this->CPrintLn(stencil_formo('title=Список доступных контестов;' . (!$this->GetAllowed('CONTEST.CREATE') ? 'smb=true;' : ''))); $this->InsertTemplate('contest.list', array('data' => $ccnt->GetAccessibleList(user_id()), 'current_contest' => $this->current_contest, 'accManage' => $manage, 'accDel' => $del)); $this->CPrintLn(stencil_formc()); if ($pageManage) { $this->CPrintLn('</td><td style="padding-left: 2px;">'); $this->Page_ContestManager($id); $this->CPrintLn('</td></tr></table>'); } if ($this->GetAllowed('CONTEST.CREATE')) { $this->Page_DrawContentCreate(); } } else { if ($pageManage) { $this->Page_ContestManager($id, true); } } }