Example #1
0
function do_page_table()
{
    global $project;
    if (!$project->pages_table_exists) {
        return;
    }
    global $relPath;
    include $relPath . '../tools/project_manager/detail_legend.inc';
    echo _("N.B. It is <b>strongly</b> recommended that you view page differentials by right-clicking on a diff link and opening the link in a new window or tab.") . "<br>\n";
    // second arg. indicates to show size of image files.
    echo_page_table($project, 1);
}
    echo "<p>";
    if (!is_null($username_for_page_selection)) {
        if (is_null($round_for_page_selection)) {
            echo sprintf(_("Showing only the pages of user '%s'."), $username_for_page_selection);
        } else {
            echo sprintf(_("Showing only the pages of user '%s' in round %s."), $username_for_page_selection, $round_for_page_selection);
        }
        $blurb = _("Show all pages instead.");
        echo "&nbsp;&nbsp;";
        echo "<a href='?project={$projectid}&show_image_size={$show_image_size}'>{$blurb}</a>";
    } else {
        $blurb = _("Show just my pages.");
        echo "<a href='?project={$projectid}&show_image_size={$show_image_size}&select_by_user'>{$blurb}</a>";
    }
    echo "</p>";
    echo_page_table($project, $show_image_size, FALSE, $username_for_page_selection, $round_for_page_selection);
} else {
    echo "<p>";
    if ($project->archived != 0) {
        echo _("The project has been archived, so page details are not available.");
    } elseif ($project->state == PROJ_DELETE) {
        echo _("The project has been deleted, so page details are not available.");
    } else {
        echo _("Page details are not available for this project.");
    }
    echo "</p>";
}
echo "<br>";
// vim: sw=4 ts=4 expandtab
?>
if (@$_REQUEST['confirmed'] == 'yes') {
    // Perform the operation.
    foreach ($selected_pages as $image => $setting) {
        // Ignore $setting, it's always 'on'.
        echo _("Image"), "={$image}:<br>\n";
        $err = $page_func($projectid, $image);
        echo $err ? $err : _("success");
        echo "<br>\n";
        echo "<br>\n";
    }
    echo "<a href='{$code_url}/project.php?id={$projectid}&amp;detail_level=4'>", _("Project Page"), "</a><br>\n";
} else {
    // Obtain confirmation
    echo _("You selected the following page(s):") . "<br>\n";
    echo "<br>\n";
    echo_page_table($project, 0, TRUE, $selected_pages);
    echo "<br>\n";
    echo "{$your_request}<br>\n";
    echo "<br>\n";
    echo "<form method='post' action='edit_pages.php'>\n";
    echo "<input type='hidden' name='projectid' value='{$projectid}'>\n";
    echo "<input type='hidden' name='operation' value='{$operation}'>\n";
    foreach ($selected_pages as $image => $setting) {
        echo "<input type='hidden' name='selected_pages[{$image}]' value='{$setting}'>\n";
    }
    echo "<input type='hidden' name='confirmed' value='yes'>\n";
    echo "<input type='submit' value='" . attr_safe(_("Do it")) . "'>\n";
    echo "<br>\n";
}
echo "<br>\n";
// vim: sw=4 ts=4 expandtab