当前位置: 首页>>代码示例>>PHP>>正文


PHP Browser::MatchedRow方法代码示例

本文整理汇总了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;
}
开发者ID:derekyu1437,项目名称:davical,代码行数:23,代码来源:principal-edit.php

示例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}&nbsp;{$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>'");
开发者ID:rossryan,项目名称:Calico,代码行数:31,代码来源:collection-edit.php


注:本文中的Browser::MatchedRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。