Beispiel #1
0
 foreach ($Pset->runners as $r) {
     if ($Me->can_view_run($Pset, $r, $User)) {
         if ($Me->can_run($Pset, $r, $User)) {
             $b = Ht::button("run", htmlspecialchars($r->title), array("value" => $r->name, "class" => "runner61", "style" => "font-weight:bold", "onclick" => "run61(this)", "loadgrade61" => isset($r->eval) ? "true" : null));
             $runnerbuttons[] = ($last_run ? "  " : "") . $b;
             $last_run = true;
         } else {
             $runnerbuttons[] = Ht::hidden("run", $r->name, array("class" => "runner61"));
         }
     }
 }
 if (count($runnerbuttons) && $Me->isPC && $Me != $User && $last_run) {
     $runnerbuttons[] = "  " . Ht::button("define", "+", array("class" => "runner61", "style" => "font-weight:bold", "onclick" => "runsetting61.add()"));
 }
 if ($Me->isPC && $Me != $User || $Info->grading_hash() && !$Info->is_grading_commit() || !$Info->grading_hash() && $Pset->grades_visible) {
     ContactView::add_regrades($Info);
     $already_requested = isset($Info->regrades[$Info->commit_hash()]);
     $runnerbuttons[] = ($last_run ? ' <span style="padding:0 1em"></span>' : "") . Ht::button("reqgrade", $already_requested ? "Regrade Requested" : "Request Regrade", array("style" => "font-weight:bold" . ($already_requested ? ";font-style:italic" : ""), "onclick" => "reqregrade61(this)"));
 }
 if (count($runnerbuttons)) {
     echo Ht::form($Info->hoturl_post("run")), '<div class="f-contain">';
     ContactView::echo_group("", join("", $runnerbuttons));
     echo "</div></form>\n";
     if ($Me->isPC && $Me != $User) {
         echo Ht::form($Info->hoturl_post("pset", array("saverunsettings" => 1, "ajax" => 1))), '<div class="f-contain"><div id="runsettings61"></div></div></form>', "\n";
         // XXX always using grading commit's settings?
         if ($runsettings = $Info->commit_info("runsettings")) {
             echo '<script>runsetting61.load(', json_encode($runsettings), ')</script>';
         }
     }
     $Conf->footerScript("jQuery('button.runner61').prop('disabled',false)");