foreach ($widgets as $widget) {
        if (@$widget->can_be_multiple) {
            if ($widget->type == 'text') {
                $help = _('list ok');
            } elseif ($widget->type == 'select') {
                $help = _('multi-select');
            }
            $help = "<br>({$help})";
        } else {
            $help = '';
        }
        echo "\n            <tr>\n                <td align='right'>{$widget->label}{$help}</td>\n                <td>" . $widget->get_html_control() . "</td>\n            </tr>\n        ";
    }
    echo "\n        <tr>\n            <td></td>\n            <td>\n                <table width='100%'>\n                <tr>\n                    <td align='left'><input type='submit' value='", attr_safe(_("Search")), "'></td>\n                    <td align='right'><input type='reset' value='", attr_safe(_("Clear form")), "'></td>\n                </tr>\n                </table>\n            </td>\n        </tr>\n        </table>\n        </form>\n        " . _("For terms that you type in, matching is case-insensitive and unanchored; so, for instance, 'jim' matches both 'Jimmy Olsen' and 'piggyjimjams'. This doesn't apply to PG etext numbers, for which you should type in the complete number.") . "\n        <br><br>\n        " . _('"(list ok)": You can search by multiple ProjectIDs or PG etext numbers at once: enter the list of ProjectIDs or PG etext numbers, separated by commas, semicolons, or spaces.') . "\n        <br><br>\n        " . _('"(multi-select)": If desired, you should be able to select multiple values for Language, Difficulty, Special Day, or State (e.g., by holding down Ctrl).') . "\n        </center>\n    ";
} else {
    echo_manager_header();
    // Construct and submit the search query.
    if ($_GET['show'] == 'search') {
        $condition = '1';
        foreach ($widgets as $widget) {
            $contribution = $widget->get_sql_contribution();
            if ($contribution == '') {
                continue;
            }
            if ($widget->q_part == 'WHERE') {
                $condition .= "\nAND {$contribution}";
            } else {
                if ($widget->q_part == 'LIMIT') {
                    // n_results_per_page is handled below
                } else {
                    assert(FALSE);
Example #2
0
function do_pm_header()
{
    global $project;
    if (!$project->can_be_managed_by_current_user) {
        return;
    }
    echo_manager_header();
}