本文整理汇总了PHP中AphrontPagerView::setEnableKeyboardShortcuts方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontPagerView::setEnableKeyboardShortcuts方法的具体用法?PHP AphrontPagerView::setEnableKeyboardShortcuts怎么用?PHP AphrontPagerView::setEnableKeyboardShortcuts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AphrontPagerView
的用法示例。
在下文中一共展示了AphrontPagerView::setEnableKeyboardShortcuts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processRequest
public function processRequest()
{
$request = $this->getRequest();
$conn_table = new PhabricatorConduitConnectionLog();
$call_table = new PhabricatorConduitMethodCallLog();
$conn_r = $call_table->establishConnection('r');
$pager = new AphrontPagerView();
$pager->setOffset($request->getInt('page'));
$calls = $call_table->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
$calls = $pager->sliceResults($calls);
$pager->setURI(new PhutilURI('/conduit/log/'), 'page');
$pager->setEnableKeyboardShortcuts(true);
$min = $pager->getOffset() + 1;
$max = $min + count($calls) - 1;
$conn_ids = array_filter(mpull($calls, 'getConnectionID'));
$conns = array();
if ($conn_ids) {
$conns = $conn_table->loadAllWhere('id IN (%Ld)', $conn_ids);
}
$table = $this->renderCallTable($calls, $conns);
$panel = new AphrontPanelView();
$panel->setHeader('Conduit Method Calls (' . $min . '-' . $max . ')');
$panel->appendChild($table);
$panel->appendChild($pager);
$this->setShowSideNav(false);
return $this->buildStandardPageResponse($panel, array('title' => 'Conduit Logs'));
}
示例2: processRequest
public function processRequest()
{
$request = $this->getRequest();
$nav = new AphrontSideNavView();
$links = array('calls' => 'All Calls');
if (empty($links[$this->view])) {
$this->view = key($links);
}
foreach ($links as $slug => $name) {
$nav->addNavItem(phutil_render_tag('a', array('href' => '/conduit/log/view/' . $slug . '/', 'class' => $slug == $this->view ? 'aphront-side-nav-selected' : null), phutil_escape_html($name)));
}
$conn_table = new PhabricatorConduitConnectionLog();
$call_table = new PhabricatorConduitMethodCallLog();
$conn_r = $call_table->establishConnection('r');
$pager = new AphrontPagerView();
$pager->setOffset($request->getInt('page'));
$calls = $call_table->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
$calls = $pager->sliceResults($calls);
$pager->setURI(new PhutilURI('/conduit/log/view/' . $this->view . '/'), 'page');
$pager->setEnableKeyboardShortcuts(true);
$min = $pager->getOffset() + 1;
$max = $min + count($calls) - 1;
$conn_ids = array_filter(mpull($calls, 'getConnectionID'));
$conns = array();
if ($conn_ids) {
$conns = $conn_table->loadAllWhere('id IN (%Ld)', $conn_ids);
}
$table = $this->renderCallTable($calls, $conns);
$panel = new AphrontPanelView();
$panel->setHeader('Conduit Method Calls (' . $min . '-' . $max . ')');
$panel->appendChild($table);
$panel->appendChild($pager);
$nav->appendChild($panel);
return $this->buildStandardPageResponse($nav, array('title' => 'Conduit Logs', 'tab' => 'logs'));
}