Example #1
0
function bindings_to_us_browser()
{
    global $c, $page_elements, $id, $editor;
    $browser = new Browser(translate('Bindings to this Principal\'s Collections'));
    $browser->AddColumn('bind_id', translate('ID'), '', '');
    $browser->AddHidden('b.dav_owner_id');
    $browser->AddHidden('p.principal_id');
    $browser->AddColumn('dav_name', translate('Collection'), '', '<td style="white-space:nowrap;">%s</td>', 'c.dav_name');
    $browser->AddColumn('bound_as', translate('Bound As'), '', '<td style="white-space:nowrap;">%s</td>', 'b.dav_name');
    $browser->AddColumn('access_ticket_id', translate('Ticket ID'), '', '');
    $browser->AddColumn('privs', translate('Privileges'), '', '', "privileges_list(privileges)");
    $delurl = $c->base_url . '/admin.php?action=edit&t=principal&id=##principal_id##&bind_id=##bind_id##&subaction=delete_binding';
    $browser->AddColumn('delete', translate('Action'), 'center', '', "'<a class=\"submit\" href=\"{$delurl}\">" . translate('Delete') . "</a>'");
    $browser->SetOrdering('target', 'A');
    $browser->SetJoins('dav_binding b LEFT JOIN collection c ON (bound_source_id=collection_id) LEFT JOIN access_ticket t ON (ticket_id=access_ticket_id) LEFT JOIN principal p USING(user_no)');
    $browser->SetWhere('p.principal_id = ' . intval($editor->Value('principal_id')));
    $browser->RowFormat('<tr class="r%d">', '</tr>', '#even');
    $browser->DoQuery();
    return $browser;
}
Example #2
0
    $browser->AddColumn('user_no', 'User#', 'center', '<a href="/user.php?user_no=##user_no##">%d</a>');
} else {
    $browser->AddHidden('user_no');
}
$browser->AddColumn('query_name', 'Query Name', 'left', '<a href="/wrsearch.php?style=plain&saved_query=##URL:query_name##">%s</a>');
$browser->AddColumn('query_type', 'Type', 'center', '%s');
//  $browser->AddColumn( 'query_sql', 'SQL', 'left', '%s' );
//  $browser->AddColumn( 'query_params', 'Params', 'left', '%s' );
$browser->AddColumn('maxresults', 'Max#', 'left', '%s');
$browser->AddColumn('rlsort', 'SortBy', 'center', '%s');
$browser->AddColumn('rlseq', 'Up/Dn', 'center', '%s');
$browser->AddColumn('updated', 'Last Modified', 'center', '%-16.16s');
$browser->AddColumn('public_checkbox', 'Public?', '', '<td class="center"><input name="query_is_public[##user_no##][##URL:query_name##]" value="off" type="hidden"><input name="query_is_public[##user_no##][##URL:query_name##]" class="fcheckbox" type="checkbox"%s></td>', "CASE WHEN public THEN ' checked' ELSE '' END");
$browser->AddColumn('menu_checkbox', 'Menu?', '', '<td class="center"><input name="show_in_menu[##user_no##][##URL:query_name##]" value="off" type="hidden"><input name="show_in_menu[##user_no##][##URL:query_name##]" class="fcheckbox" type="checkbox"%s></td>', "CASE WHEN in_menu THEN ' checked' ELSE '' END");
$browser->AddColumn('query_params', 'Actions', 'center', '<a href="/wrsearch.php?saved_query=##URL:query_name##" class="submit">Edit Query</a>');
$browser->SetJoins("saved_queries JOIN usr USING(user_no) ");
$browser->SetWhere("usr.user_no = " . $session->user_no);
if (isset($_GET['o']) && isset($_GET['d'])) {
    $browser->AddOrder($_GET['o'], $_GET['d']);
} else {
    $browser->AddOrder('query_name', 'A');
}
$browser->RowFormat("<tr onMouseOver=\"LinkHref(this,1);\" title=\"Click to Display Search Detail\" class=\"r%d\">\n", "</tr>\n", '#even');
$browser->DoQuery();
$c->page_title = "Saved Searches";
include "page-header.php";
echo "<form method=\"POST\">\n";
echo $browser->Render();
echo "<input type=\"submit\" name=\"submit\" class=\"submit\" value=\"Save Changes\">";
echo "</form>\n";
include "page-footer.php";