本文整理汇总了PHP中Browser::MatchedRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::MatchedRow方法的具体用法?PHP Browser::MatchedRow怎么用?PHP Browser::MatchedRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::MatchedRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: access_ticket_browser
function access_ticket_browser()
{
global $c, $id, $editor, $can_write_principal;
$browser = new Browser(translate('Access Tickets'));
$browser->AddColumn('ticket_id', translate('Ticket ID'), '', '');
$browser->AddColumn('target', translate('Target'), '', '<td style="white-space:nowrap;">%s</td>', "COALESCE(d.dav_name,c.dav_name)");
$browser->AddColumn('expires', translate('Expires'), '', '', 'TO_CHAR(expires,\'YYYY-MM-DD HH:MI:SS\')');
$browser->AddColumn('privs', translate('Privileges'), '', '', 'privileges', '', '', 'privilege_format_function');
$delurl = $c->base_url . '/admin.php?action=edit&t=principal&id=' . $id . '&ticket_id=##URL:ticket_id##&subaction=delete_ticket';
$browser->AddColumn('delete', translate('Action'), 'center', '', "'<a class=\"submit\" href=\"{$delurl}\">" . translate('Delete') . "</a>'");
$browser->SetOrdering('target', 'A');
$browser->SetJoins('access_ticket t LEFT JOIN collection c ON (target_collection_id=collection_id) LEFT JOIN caldav_data d ON (target_resource_id=dav_id)');
$browser->SetWhere('dav_owner_id = ' . intval($editor->Value('principal_id')));
$browser->RowFormat('<tr class="r%d">', '</tr>', '#even');
$browser->DoQuery();
if ($can_write_principal) {
$ticket_id = substr(str_replace('/', '', str_replace('+', '', base64_encode(sha1(date('r') . rand(0, 2100000000) . microtime(true), true)))), 7, 8);
$extra_row = array('ticket_id' => $ticket_id, 'expires' => date('Y-m-d', time() + 86400 * 31), 'target' => '/' . $editor->Value('username') . '/' . $c->home_calendar_name . '/');
$browser->MatchedRow('ticket_id', $ticket_id, 'edit_ticket_row');
$browser->AddRow($extra_row);
}
return $browser;
}
示例2: translate
$edit_link = '<a href="' . $c->base_url . '/admin.php?action=edit&t=collection&id=' . $id . '&edit_grant=##to_principal##" class="submit">' . translate('Edit') . '</a>';
$browser->AddColumn('action', translate('Action'), 'center', '', "'{$edit_link} {$del_link}'");
}
$browser->SetOrdering('displayname', 'A');
$browser->SetJoins('grants LEFT JOIN dav_principal ON (to_principal = principal_id) ');
$browser->SetWhere('by_collection = ' . $id);
if ($c->enable_row_linking) {
$browser->RowFormat('<tr onMouseover="LinkHref(this,1);" title="' . translate('Click to edit principal details') . '" class="r%d">', '</tr>', '#even');
} else {
$browser->RowFormat('<tr class="r%d">', '</tr>', '#even');
}
$browser->DoQuery();
$page_elements[] = $browser;
if ($can_write_collection) {
if (isset($_GET['edit_grant'])) {
$browser->MatchedRow('to_principal', $_GET['edit_grant'], 'edit_grant_row');
} else {
$extra_row = array('to_principal' => -1);
$browser->MatchedRow('to_principal', -1, 'edit_grant_row');
$extra_row = (object) $extra_row;
$browser->AddRow($extra_row);
}
}
$browser = new Browser(translate('Access Tickets'));
$browser->AddHidden('dav_owner_id');
$browser->AddColumn('ticket_id', translate('Ticket ID'), '', '');
$browser->AddColumn('target', translate('Target'), '', '<td style="white-space:nowrap;">%s</td>', "'" . $c->base_url . '/caldav.php' . "' ||COALESCE(d.dav_name,c.dav_name)");
$browser->AddColumn('expiry', translate('Expires'), '', '', 'TO_CHAR(expires,\'YYYYMMDD"T"HH:MI:SS\')');
$browser->AddColumn('privs', translate('Privileges'), '', '', "privileges_list(privileges)");
$delurl = $c->base_url . '/admin.php?action=edit&t=principal&id=##dav_owner_id##&ticket_id=##URL:ticket_id##&subaction=delete_ticket';
$browser->AddColumn('delete', translate('Action'), 'center', '', "'<a class=\"submit\" href=\"{$delurl}\">" . translate('Delete') . "</a>'");