Example #1
0
function boinc_preprocess_views_view(&$vars, $hook)
{
    switch ($vars['name']) {
        case 'boinc_account_computers':
            switch ($vars['display_id']) {
                case 'page_1':
                case 'panel_pane_1':
                    $vars['empty'] = boincwork_views_host_list_empty_text();
                    break;
                case 'page_2':
                    $vars['empty'] = boincwork_views_host_list_empty_text('active');
                    break;
                case 'block_1':
                    $vars['empty'] = boincwork_views_host_list_empty_text('preferences');
                    break;
                default:
            }
            break;
        case 'boinc_account_tasks_all':
            $vars['empty'] = boincwork_views_task_list_empty_text();
            break;
        case 'boinc_friends':
            if ($vars['display_id'] == 'block_1') {
                $vars['header'] = boincuser_views_friends_block_header();
            }
            break;
        case 'boinc_host_list':
            if ($vars['display_id'] == 'page_2') {
                $vars['empty'] = boincwork_views_host_list_empty_text();
            } elseif ($vars['display_id'] == 'page_1') {
                $vars['empty'] = boincwork_views_host_list_empty_text('active');
            }
            break;
        case 'boinc_task':
            // Load view object (view data is not available in header / footer); execute view query
            $view = views_get_current_view();
            $view->execute();
            $result = reset($view->result);
            // Display the stderr output in the footer
            $vars['footer'] = '<h3>' . bts('Stderr output') . '</h3>';
            $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>';
            break;
        case 'boinc_teams':
            if ($vars['display_id'] == 'panel_pane_3') {
                $team_id = arg(2);
                $vars['header'] = boincteam_manage_admins_panel_header($team_id);
            }
            break;
        case 'boinc_workunit':
            ob_start();
            // Get the workunit ID from the URL
            $result_id = arg(1);
            require_boinc(array('util', 'boinc_db'));
            $wu = BoincWorkunit::lookup_id($result_id);
            project_workunit($wu);
            // Output of project_workunit() gets caught in the buffer
            $vars['footer'] = ob_get_clean();
        default:
    }
}
Example #2
0
if ($wu->canonical_resultid) {
    row2('canonical result', '<a href="result.php?resultid=$wu->canonical_resultid">$wu->canonical_resultid</a>');
    row2("granted credit", format_credit($wu->canonical_credit));
}
// if app is using adaptive replication and no canonical result yet,
// don't show anything more
// (so that bad guys can't tell if they have an unreplicated job)
if ($app->target_nresults > 0 && !$wu->canonical_resultid) {
    row2("Tasks in progress", "suppressed pending completion");
    end_table();
} else {
    row2("minimum quorum", $wu->min_quorum);
    row2("initial replication", $wu->target_nresults);
    row2("max # of error/total/success tasks", "{$wu->max_error_results}, {$wu->max_total_results}, {$wu->max_success_results}");
    if ($wu->error_mask) {
        row2("errors", wu_error_mask_str($wu->error_mask));
    }
    if ($wu->need_validate) {
        row2("validation", "Pending");
    }
    end_table();
    project_workunit($wu);
    result_table_start(false, true, null);
    $results = BoincResult::enum("workunitid={$wuid}");
    $i = 0;
    foreach ($results as $result) {
        show_result_row($result, false, true, false, $i++);
    }
    echo "</table>\n";
}
page_tail();