本文整理汇总了PHP中AphrontTableView::setColumnClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontTableView::setColumnClasses方法的具体用法?PHP AphrontTableView::setColumnClasses怎么用?PHP AphrontTableView::setColumnClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AphrontTableView
的用法示例。
在下文中一共展示了AphrontTableView::setColumnClasses方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$nav = $this->buildSideNav('resource');
$pager = new AphrontPagerView();
$pager->setURI(new PhutilURI('/drydock/resource/'), 'page');
$data = id(new DrydockResource())->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
$data = $pager->sliceResults($data);
$phids = mpull($data, 'getOwnerPHID');
$handles = $this->loadViewerHandles($phids);
$rows = array();
foreach ($data as $resource) {
$rows[] = array($resource->getID(), $resource->getOwnerPHID() ? $handles[$resource->getOwnerPHID()]->renderLink() : null, phutil_escape_html($resource->getType()), DrydockResourceStatus::getNameForStatus($resource->getStatus()), phutil_escape_html(nonempty($resource->getName(), 'Unnamed')), phabricator_datetime($resource->getDateCreated(), $user));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('ID', 'Owner', 'Type', 'Status', 'Resource', 'Created'));
$table->setColumnClasses(array('', '', '', '', 'pri wide', 'right'));
$panel = new AphrontPanelView();
$panel->setHeader('Drydock Resources');
$panel->addButton(phutil_render_tag('a', array('href' => '/drydock/resource/allocate/', 'class' => 'green button'), 'Allocate Resource'));
$panel->appendChild($table);
$panel->appendChild($pager);
$nav->appendChild($panel);
return $this->buildStandardPageResponse($nav, array('title' => 'Resources'));
}
示例2: processRequest
public function processRequest()
{
$request = $this->getRequest();
$pager = new AphrontPagerView();
$pager->setOffset($request->getInt('page'));
$macro_table = new PhabricatorFileImageMacro();
$macros = $macro_table->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize());
// Get an exact count since the size here is reasonably going to be a few
// thousand at most in any reasonable case.
$count = queryfx_one($macro_table->establishConnection('r'), 'SELECT COUNT(*) N FROM %T', $macro_table->getTableName());
$count = $count['N'];
$pager->setCount($count);
$pager->setURI($request->getRequestURI(), 'page');
$rows = array();
foreach ($macros as $macro) {
$src = PhabricatorFileURI::getViewURIForPHID($macro->getFilePHID());
$rows[] = array(phutil_render_tag('a', array('href' => '/file/macro/edit/' . $macro->getID() . '/'), phutil_escape_html($macro->getName())), phutil_render_tag('a', array('href' => $src, 'target' => '_blank'), phutil_render_tag('img', array('src' => $src))), javelin_render_tag('a', array('href' => '/file/macro/delete/' . $macro->getID() . '/', 'sigil' => 'workflow', 'class' => 'grey small button'), 'Delete'));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Name', 'Image', ''));
$table->setColumnClasses(array('pri', 'wide thumb', 'action'));
$panel = new AphrontPanelView();
$panel->appendChild($table);
$panel->setHeader('Image Macros');
$panel->setCreateButton('New Image Macro', '/file/macro/edit/');
$panel->appendChild($pager);
return $this->buildStandardPageResponse($panel, array('title' => 'Image Macros', 'tab' => 'macros'));
}
示例3: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$nav = $this->buildSideNav('lease');
$pager = new AphrontPagerView();
$pager->setURI(new PhutilURI('/drydock/lease/'), 'page');
$data = id(new DrydockLease())->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
$data = $pager->sliceResults($data);
$phids = mpull($data, 'getOwnerPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$resource_ids = mpull($data, 'getResourceID');
$resources = array();
if ($resource_ids) {
$resources = id(new DrydockResource())->loadAllWhere('id IN (%Ld)', $resource_ids);
}
$rows = array();
foreach ($data as $lease) {
$resource = idx($resources, $lease->getResourceID());
$rows[] = array($lease->getID(), DrydockLeaseStatus::getNameForStatus($lease->getStatus()), $lease->getOwnerPHID() ? $handles[$lease->getOwnerPHID()]->renderLink() : null, $lease->getResourceID(), $resource ? phutil_escape_html($resource->getName()) : null, phabricator_datetime($lease->getDateCreated(), $user));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('ID', 'Status', 'Owner', 'Resource ID', 'Resource', 'Created'));
$table->setColumnClasses(array('', '', '', '', 'wide pri', 'right'));
$panel = new AphrontPanelView();
$panel->setHeader('Drydock Leases');
$panel->appendChild($table);
$panel->appendChild($pager);
$nav->appendChild($panel);
return $this->buildStandardPageResponse($nav, array('title' => 'Leases'));
}
示例4: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$nav = $this->buildSideNav('log');
$query = new DrydockLogQuery();
$resource_ids = $request->getStrList('resource');
if ($resource_ids) {
$query->withResourceIDs($resource_ids);
}
$lease_ids = $request->getStrList('lease');
if ($lease_ids) {
$query->withLeaseIDs($lease_ids);
}
$pager = new AphrontPagerView();
$pager->setPageSize(500);
$pager->setOffset($request->getInt('offset'));
$pager->setURI($request->getRequestURI(), 'offset');
$logs = $query->executeWithOffsetPager($pager);
$rows = array();
foreach ($logs as $log) {
$rows[] = array($log->getResourceID(), $log->getLeaseID(), phutil_escape_html($log->getMessage()), phabricator_datetime($log->getEpoch(), $user));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Resource', 'Lease', 'Message', 'Date'));
$table->setColumnClasses(array('', '', 'wide', ''));
$panel = new AphrontPanelView();
$panel->setHeader('Drydock Logs');
$panel->appendChild($table);
$panel->appendChild($pager);
$nav->appendChild($panel);
return $this->buildStandardPageResponse($nav, array('title' => 'Logs'));
}
示例5: processRequest
public function processRequest()
{
$request = $this->getRequest();
$pager = new AphrontPagerView();
$pager->setOffset($request->getInt('page'));
$pastes = id(new PhabricatorPaste())->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
$pastes = $pager->sliceResults($pastes);
$pager->setURI($request->getRequestURI(), 'page');
$phids = mpull($pastes, 'getAuthorPHID');
$handles = array();
if ($phids) {
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
}
$rows = array();
foreach ($pastes as $paste) {
$handle = $handles[$paste->getAuthorPHID()];
$rows[] = array(phutil_escape_html('P' . $paste->getID()), phutil_render_tag('a', array('href' => '/p/' . $handle->getName() . '/'), phutil_escape_html($handle->getName())), phutil_escape_html($paste->getLanguage()), phutil_render_tag('a', array('href' => '/P' . $paste->getID()), phutil_escape_html(nonempty($paste->getTitle(), 'Untitled Masterwork P' . $paste->getID()))), phutil_render_tag('a', array('href' => PhabricatorFileURI::getViewURIForPHID($paste->getFilePHID())), phutil_escape_html($paste->getFilePHID())));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Paste ID', 'Author', 'Language', 'Title', 'File'));
$table->setColumnClasses(array(null, null, null, 'wide pri', null));
$panel = new AphrontPanelView();
$panel->setWidth(AphrontPanelView::WIDTH_FULL);
$panel->setHeader("Paste");
$panel->setCreateButton('Paste Something', '/paste/');
$panel->appendChild($table);
$panel->appendChild($pager);
return $this->buildStandardPageResponse($panel, array('title' => 'Paste List', 'tab' => 'list'));
}
示例6: render
public function render()
{
$drequest = $this->getDiffusionRequest();
$handles = $this->handles;
$rows = array();
foreach ($this->history as $history) {
$epoch = $history->getEpoch();
if ($epoch) {
$date = date('M j, Y', $epoch);
$time = date('g:i A', $epoch);
} else {
$date = null;
$time = null;
}
$data = $history->getCommitData();
$author_phid = null;
if ($data) {
$author_phid = $data->getCommitDetail('authorPHID');
}
if ($author_phid && isset($handles[$author_phid])) {
$author = $handles[$author_phid]->renderLink();
} else {
$author = phutil_escape_html($history->getAuthorName());
}
$rows[] = array($this->linkBrowse($drequest->getPath(), array('commit' => $history->getCommitIdentifier())), self::linkCommit($drequest->getRepository(), $history->getCommitIdentifier()), $this->linkChange($history->getChangeType(), $history->getFileType(), null, $history->getCommitIdentifier()), $date, $time, $author, phutil_escape_html($history->getSummary()));
}
$view = new AphrontTableView($rows);
$view->setHeaders(array('Browse', 'Commit', 'Change', 'Date', 'Time', 'Author', 'Details'));
$view->setColumnClasses(array('', 'n', '', '', 'right', '', 'wide wrap'));
return $view->render();
}
示例7: render
public function render()
{
$rows = array();
if (!$this->user) {
throw new Exception("Call setUser() before rendering!");
}
foreach ($this->daemonLogs as $log) {
$epoch = $log->getDateCreated();
if ($log->getHost() == php_uname('n')) {
$pid = $log->getPID();
$is_running = PhabricatorDaemonReference::isProcessRunning($pid);
if ($is_running) {
$running = phutil_render_tag('span', array('style' => 'color: #00cc00', 'title' => 'Running'), '•');
} else {
$running = phutil_render_tag('span', array('style' => 'color: #cc0000', 'title' => 'Not running'), '•');
}
} else {
$running = phutil_render_tag('span', array('style' => 'color: #888888', 'title' => 'Not on this host'), '?');
}
$rows[] = array($running, phutil_escape_html($log->getDaemon()), phutil_escape_html($log->getHost()), $log->getPID(), phabricator_date($epoch, $this->user), phabricator_time($epoch, $this->user), phutil_render_tag('a', array('href' => '/daemon/log/' . $log->getID() . '/', 'class' => 'button small grey'), 'View Log'));
}
$daemon_table = new AphrontTableView($rows);
$daemon_table->setHeaders(array('', 'Daemon', 'Host', 'PID', 'Date', 'Time', 'View'));
$daemon_table->setColumnClasses(array('', 'wide wrap', '', '', '', 'right', 'action'));
return $daemon_table->render();
}
示例8: processRequest
public function processRequest()
{
$method_groups = $this->getMethodFilters();
$rows = array();
foreach ($method_groups as $group => $methods) {
foreach ($methods as $info) {
switch ($info['status']) {
case ConduitAPIMethod::METHOD_STATUS_DEPRECATED:
$status = 'Deprecated';
break;
case ConduitAPIMethod::METHOD_STATUS_UNSTABLE:
$status = 'Unstable';
break;
default:
$status = null;
break;
}
$rows[] = array($group, phutil_render_tag('a', array('href' => '/conduit/method/' . $info['full_name']), phutil_escape_html($info['full_name'])), $info['description'], $status);
$group = null;
}
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Group', 'Name', 'Description', 'Status'));
$table->setColumnClasses(array('pri', 'pri', 'wide', null));
$panel = new AphrontPanelView();
$panel->setHeader('Conduit Methods');
$panel->appendChild($table);
$panel->setWidth(AphrontPanelView::WIDTH_FULL);
$utils = new AphrontPanelView();
$utils->setHeader('Utilities');
$utils->appendChild('<ul>' . '<li><a href="/conduit/log/">Log</a> - Conduit Method Calls</li>' . '<li><a href="/conduit/token/">Token</a> - Certificate Install</li>' . '</ul>');
$utils->setWidth(AphrontPanelView::WIDTH_FULL);
$this->setShowSideNav(false);
return $this->buildStandardPageResponse(array($panel, $utils), array('title' => 'Conduit Console'));
}
示例9: render
public function render()
{
$user = $this->getUser();
$blogs = $this->getBlogs();
$panel = new AphrontPanelView();
if (empty($blogs)) {
$panel = id(new AphrontPanelView())->setHeader('No blogs... Yet!')->setCaption('Will you answer the call to phame?')->setCreateButton('New Blog', '/phame/blog/new');
return $panel->render();
}
$table_data = array();
foreach ($blogs as $blog) {
$view_link = phutil_render_tag('a', array('href' => $blog->getViewURI()), phutil_escape_html($blog->getName()));
$bloggers = $blog->getBloggers();
if (isset($bloggers[$user->getPHID()])) {
$edit = phutil_render_tag('a', array('class' => 'button small grey', 'href' => $blog->getEditURI()), 'Edit');
} else {
$edit = null;
}
$view = phutil_render_tag('a', array('class' => 'button small grey', 'href' => $blog->getViewURI()), 'View');
$table_data[] = array($view_link, implode(', ', mpull($blog->getBloggers(), 'renderLink')), $view, $edit);
}
$table = new AphrontTableView($table_data);
$table->setHeaders(array('Name', 'Bloggers', '', ''));
$table->setColumnClasses(array(null, null, 'action', 'action'));
$panel->setCreateButton('Create a Blog', '/phame/blog/new/');
$panel->setHeader($this->getHeader());
$panel->appendChild($table);
return $panel->render();
}
示例10: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$pager = new AphrontPagerView();
$pager->setOffset($request->getInt('page'));
$pager->setURI($request->getRequestURI(), 'page');
$timers = id(new PhabricatorTimer())->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
$timers = $pager->sliceResults($timers);
$phids = mpull($timers, 'getAuthorPHID');
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$rows = array();
foreach ($timers as $timer) {
$edit_button = null;
$delete_button = null;
if ($user->getIsAdmin() || $user->getPHID() == $timer->getAuthorPHID()) {
$edit_button = phutil_render_tag('a', array('class' => 'small button grey', 'href' => '/countdown/edit/' . $timer->getID() . '/'), 'Edit');
$delete_button = javelin_render_tag('a', array('class' => 'small button grey', 'href' => '/countdown/delete/' . $timer->getID() . '/', 'sigil' => 'workflow'), 'Delete');
}
$rows[] = array(phutil_escape_html($timer->getID()), $handles[$timer->getAuthorPHID()]->renderLink(), phutil_render_tag('a', array('href' => '/countdown/' . $timer->getID() . '/'), phutil_escape_html($timer->getTitle())), phabricator_datetime($timer->getDatepoint(), $user), $edit_button, $delete_button);
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('ID', 'Author', 'Title', 'End Date', '', ''));
$table->setColumnClasses(array(null, null, 'wide pri', null, 'action', 'action'));
$panel = id(new AphrontPanelView())->appendChild($table)->setHeader('Timers')->setCreateButton('Create Timer', '/countdown/edit/')->appendChild($pager);
return $this->buildStandardPageResponse($panel, array('title' => 'Countdown'));
}
示例11: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
if ($request->isFormPost()) {
$uri = new PhutilURI('/fact/chart/');
$uri->setQueryParam('y1', $request->getStr('y1'));
return id(new AphrontRedirectResponse())->setURI($uri);
}
$types = array('+N:*', '+N:DREV', 'updated');
$engines = PhabricatorFactEngine::loadAllEngines();
$specs = PhabricatorFactSpec::newSpecsForFactTypes($engines, $types);
$facts = id(new PhabricatorFactAggregate())->loadAllWhere('factType IN (%Ls)', $types);
$rows = array();
foreach ($facts as $fact) {
$spec = $specs[$fact->getFactType()];
$name = $spec->getName();
$value = $spec->formatValueForDisplay($user, $fact->getValueX());
$rows[] = array(phutil_escape_html($name), phutil_escape_html($value));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Fact', 'Value'));
$table->setColumnClasses(array('wide', 'n'));
$panel = new AphrontPanelView();
$panel->setHeader('Facts!');
$panel->appendChild($table);
$chart_form = $this->buildChartForm();
return $this->buildStandardPageResponse(array($chart_form, $panel), array('title' => 'Facts!'));
}
示例12: render
public function render()
{
$user = $this->user;
if (!$user) {
throw new Exception("Call setUser() before render()!");
}
$rows = array();
foreach ($this->revisions as $revision) {
$status = $revision->getStatus();
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
$reviewer_phids = $revision->getReviewers();
if ($reviewer_phids) {
$first = reset($reviewer_phids);
if (count($reviewer_phids) > 1) {
$suffix = ' (+' . (count($reviewer_phids) - 1) . ')';
} else {
$suffix = null;
}
$reviewers = $this->handles[$first]->renderLink() . $suffix;
} else {
$reviewers = '<em>None</em>';
}
$link = phutil_render_tag('a', array('href' => '/D' . $revision->getID()), phutil_escape_html($revision->getTitle()));
$rows[] = array('D' . $revision->getID(), $link, phutil_escape_html($status), number_format($revision->getLineCount()), $this->handles[$revision->getAuthorPHID()]->renderLink(), $reviewers, phabricator_datetime($revision->getDateModified(), $user), phabricator_date($revision->getDateCreated(), $user));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('ID', 'Revision', 'Status', 'Lines', 'Author', 'Reviewers', 'Updated', 'Created'));
$table->setColumnClasses(array(null, 'wide pri', null, 'n', null, null, 'right', 'right'));
if ($this->noDataString) {
$table->setNoDataString($this->noDataString);
}
return $table->render();
}
示例13: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$offset = $request->getInt('offset', 0);
$pager = new AphrontPagerView();
$pager->setPageSize(250);
$pager->setOffset($offset);
$pager->setURI($request->getRequestURI(), 'offset');
$list = new PhabricatorMetaMTAMailingList();
$conn_r = $list->establishConnection('r');
$data = queryfx_all($conn_r, 'SELECT * FROM %T
ORDER BY name ASC
LIMIT %d, %d', $list->getTableName(), $pager->getOffset(), $pager->getPageSize() + 1);
$data = $pager->sliceResults($data);
$lists = $list->loadAllFromArray($data);
$rows = array();
foreach ($lists as $list) {
$rows[] = array(phutil_escape_html($list->getName()), phutil_escape_html($list->getEmail()), phutil_render_tag('a', array('class' => 'button grey small', 'href' => $this->getApplicationURI('/edit/' . $list->getID() . '/')), 'Edit'));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Name', 'Email', ''));
$table->setColumnClasses(array(null, 'wide', 'action'));
$panel = new AphrontPanelView();
$panel->appendChild($table);
$panel->setHeader('Mailing Lists');
$panel->setCreateButton('Add New List', $this->getApplicationURI('/edit/'));
$panel->appendChild($pager);
return $this->buildApplicationPage($panel, array('title' => 'Mailing Lists'));
}
示例14: processRequest
public function processRequest()
{
$request = $this->getRequest();
$phids = $request->getStrList('phids');
if ($phids) {
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$rows = array();
foreach ($handles as $handle) {
if ($handle->getURI()) {
$link = phutil_render_tag('a', array('href' => $handle->getURI()), phutil_escape_html($handle->getURI()));
} else {
$link = null;
}
$rows[] = array(phutil_escape_html($handle->getPHID()), phutil_escape_html($handle->getType()), phutil_escape_html($handle->getName()), $link);
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('PHID', 'Type', 'Name', 'URI'));
$table->setColumnClasses(array(null, null, null, 'wide'));
$panel = new AphrontPanelView();
$panel->setHeader('PHID Handles');
$panel->appendChild($table);
return $this->buildStandardPageResponse($panel, array('title' => 'PHID Lookup Results'));
}
$lookup_form = new AphrontFormView();
$lookup_form->setUser($request->getUser());
$lookup_form->setAction('/phid/')->appendChild(id(new AphrontFormTextAreaControl())->setName('phids')->setCaption('Enter PHIDs separated by spaces or commas.'))->appendChild(id(new AphrontFormSubmitControl())->setValue('Lookup PHIDs'));
$lookup_panel = new AphrontPanelView();
$lookup_panel->setHeader('Lookup PHIDs');
$lookup_panel->appendChild($lookup_form);
$lookup_panel->setWidth(AphrontPanelView::WIDTH_WIDE);
return $this->buildStandardPageResponse(array($lookup_panel), array('title' => 'PHID Lookup'));
}
示例15: processRequest
public function processRequest()
{
$request = $this->getRequest();
$user = $request->getUser();
$pager = new AphrontPagerView();
$pager->setOffset($request->getInt('page'));
$pager->setURI($request->getRequestURI(), 'page');
$mails = id(new PhabricatorMetaMTAReceivedMail())->loadAllWhere('1 = 1 ORDER BY id DESC LIMIT %d, %d', $pager->getOffset(), $pager->getPageSize() + 1);
$mails = $pager->sliceResults($mails);
$phids = array_merge(mpull($mails, 'getAuthorPHID'), mpull($mails, 'getRelatedPHID'));
$phids = array_unique(array_filter($phids));
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
$rows = array();
foreach ($mails as $mail) {
$rows[] = array($mail->getID(), phabricator_date($mail->getDateCreated(), $user), phabricator_time($mail->getDateCreated(), $user), $mail->getAuthorPHID() ? $handles[$mail->getAuthorPHID()]->renderLink() : '-', $mail->getRelatedPHID() ? $handles[$mail->getRelatedPHID()]->renderLink() : '-', phutil_escape_html($mail->getMessage()));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('ID', 'Date', 'Time', 'Author', 'Object', 'Message'));
$table->setColumnClasses(array(null, null, 'right', null, null, 'wide'));
$panel = new AphrontPanelView();
$panel->setHeader('Received Mail');
$panel->appendChild($table);
$panel->appendChild($pager);
$nav = $this->buildSideNavView();
$nav->selectFilter('received');
$nav->appendChild($panel);
return $this->buildApplicationPage($nav, array('title' => 'Received Mail'));
}