本文整理汇总了PHP中AphrontTableView::render方法的典型用法代码示例。如果您正苦于以下问题:PHP AphrontTableView::render方法的具体用法?PHP AphrontTableView::render怎么用?PHP AphrontTableView::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AphrontTableView
的用法示例。
在下文中一共展示了AphrontTableView::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render()
{
$data = $this->getData();
$lib_data = $data['libraries'];
$lib_rows = array();
foreach ($lib_data as $key => $value) {
$lib_rows[] = array(phutil_escape_html($key), phutil_escape_html($value));
}
$lib_table = new AphrontTableView($lib_rows);
$lib_table->setHeaders(array('Library', 'Loaded From'));
$lib_table->setColumnClasses(array('header', 'wide wrap'));
$config_data = $data['config'];
ksort($config_data);
$mask = PhabricatorEnv::getEnvConfig('darkconsole.config-mask');
$mask = array_fill_keys($mask, true);
foreach ($mask as $masked_key => $ignored) {
if (!PhabricatorEnv::envConfigExists($masked_key)) {
throw new Exception("Configuration 'darkconsole.config-mask' masks unknown " . "configuration key '" . $masked_key . "'. If this key has been " . "renamed, you might be accidentally exposing information which you " . "don't intend to.");
}
}
$rows = array();
foreach ($config_data as $key => $value) {
if (empty($mask[$key])) {
$display_value = is_array($value) ? json_encode($value) : $value;
$display_value = phutil_escape_html($display_value);
} else {
$display_value = phutil_escape_html('<Masked>');
}
$rows[] = array(phutil_escape_html($key), $display_value);
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('Key', 'Value'));
$table->setColumnClasses(array('header', 'wide wrap'));
return $lib_table->render() . $table->render();
}
示例2: renderPanel
public function renderPanel()
{
$data = $this->getData();
$sections = array('Basics' => array('Machine' => php_uname('n')));
// NOTE: This may not be present for some SAPIs, like php-fpm.
if (!empty($data['Server']['SERVER_ADDR'])) {
$addr = $data['Server']['SERVER_ADDR'];
$sections['Basics']['Host'] = $addr;
$sections['Basics']['Hostname'] = @gethostbyaddr($addr);
}
$sections = array_merge($sections, $data);
$mask = array('HTTP_COOKIE' => true, 'HTTP_X_PHABRICATOR_CSRF' => true);
$out = array();
foreach ($sections as $header => $map) {
$rows = array();
foreach ($map as $key => $value) {
if (isset($mask[$key])) {
$rows[] = array($key, phutil_tag('em', array(), '(Masked)'));
} else {
$rows[] = array($key, is_array($value) ? json_encode($value) : $value);
}
}
$table = new AphrontTableView($rows);
$table->setHeaders(array($header, null));
$table->setColumnClasses(array('header', 'wide wrap'));
$out[] = $table->render();
}
return phutil_implode_html("\n", $out);
}
示例3: 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();
}
示例4: render
public function render()
{
$drequest = $this->getDiffusionRequest();
$current_branch = $drequest->getBranch();
$rows = array();
$rowc = array();
foreach ($this->branches as $branch) {
$commit = idx($this->commits, $branch->getHeadCommitIdentifier());
if ($commit) {
$details = $commit->getCommitData()->getCommitMessage();
$details = idx(explode("\n", $details), 0);
$details = substr($details, 0, 80);
$datetime = phabricator_datetime($commit->getEpoch(), $this->user);
} else {
$datetime = null;
$details = null;
}
$rows[] = array(phutil_render_tag('a', array('href' => $drequest->generateURI(array('action' => 'history', 'branch' => $branch->getName()))), 'History'), phutil_render_tag('a', array('href' => $drequest->generateURI(array('action' => 'browse', 'branch' => $branch->getName()))), phutil_escape_html($branch->getName())), self::linkCommit($drequest->getRepository(), $branch->getHeadCommitIdentifier()), $datetime, AphrontTableView::renderSingleDisplayLine(phutil_escape_html($details)));
if ($branch->getName() == $current_branch) {
$rowc[] = 'highlighted';
} else {
$rowc[] = null;
}
}
$view = new AphrontTableView($rows);
$view->setHeaders(array('History', 'Branch', 'Head', 'Modified', 'Details'));
$view->setColumnClasses(array('', 'pri', '', '', 'wide'));
$view->setRowClasses($rowc);
return $view->render();
}
示例5: 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();
}
示例6: render
public function render()
{
$data = $this->getData();
$rows = array();
$details = '';
foreach ($data as $index => $row) {
$file = $row['file'];
$line = $row['line'];
$tag = phutil_render_tag('a', array('onclick' => jsprintf('show_details(%d)', $index)), phutil_escape_html($row['str'] . ' at [' . basename($file) . ':' . $line . ']'));
$rows[] = array($tag);
$details .= '<div class="dark-console-panel-error-details" id="row-details-' . $index . '">' . phutil_escape_html($row['details']) . "\n" . 'Stack trace:' . "\n";
foreach ($row['trace'] as $key => $entry) {
$line = '';
if (isset($entry['class'])) {
$line .= $entry['class'] . '::';
}
$line .= idx($entry, 'function', '');
$onclick = '';
if (isset($entry['file'])) {
$line .= ' called at [' . $entry['file'] . ':' . $entry['line'] . ']';
$onclick = jsprintf('open_file(%s, %d)', $entry['file'], $entry['line']);
}
$details .= phutil_render_tag('a', array('onclick' => $onclick), phutil_escape_html($line));
$details .= "\n";
}
$details .= '</div>';
}
$table = new AphrontTableView($rows);
$table->setClassName('error-log');
$table->setHeaders(array('Error'));
$table->setNoDataString('No errors.');
return '<div>' . '<div>' . $table->render() . '</div>' . '<div class="dark-console-panel-error-separator"></div>' . '<pre class="PhabricatorMonospaced">' . $details . '</pre>' . '</div>';
}
示例7: render
public function render()
{
$rows = array();
foreach ($this->edits as $edit) {
$name = nonempty($edit->getRuleName(), 'Unknown Rule');
$rule_name = phutil_render_tag('strong', array(), phutil_escape_html($name));
switch ($edit->getAction()) {
case 'create':
$details = "Created rule '{$rule_name}'.";
break;
case 'delete':
$details = "Deleted rule '{$rule_name}'.";
break;
case 'edit':
default:
$details = "Edited rule '{$rule_name}'.";
break;
}
$rows[] = array($edit->getRuleID(), $this->handles[$edit->getEditorPHID()]->renderLink(), $details, phabricator_datetime($edit->getDateCreated(), $this->user));
}
$table = new AphrontTableView($rows);
$table->setNoDataString("No edits for rule.");
$table->setHeaders(array('Rule ID', 'Editor', 'Details', 'Edit Date'));
$table->setColumnClasses(array('', '', 'wide', ''));
return $table->render();
}
示例8: render
public function render()
{
$rows = array();
$rowc = array();
// TODO: Experiment with path stack rendering.
// TODO: Copy Away and Move Away are rendered junkily still.
foreach ($this->pathChanges as $id => $change) {
$path = $change->getPath();
$hash = substr(md5($path), 0, 8);
if ($change->getFileType() == DifferentialChangeType::FILE_DIRECTORY) {
$path .= '/';
}
if (isset($this->renderingReferences[$id])) {
$path_column = javelin_render_tag('a', array('href' => '#' . $hash, 'meta' => array('id' => 'diff-' . $hash, 'ref' => $this->renderingReferences[$id]), 'sigil' => 'differential-load'), phutil_escape_html($path));
} else {
$path_column = phutil_escape_html($path);
}
$rows[] = array($this->linkHistory($change->getPath()), $this->linkBrowse($change->getPath()), $this->linkChange($change->getChangeType(), $change->getFileType(), $change->getPath()), $path_column);
$row_class = null;
foreach ($this->ownersPaths as $owners_path) {
$owners_path = $owners_path->getPath();
if (strncmp('/' . $path, $owners_path, strlen($owners_path)) == 0) {
$row_class = 'highlighted';
break;
}
}
$rowc[] = $row_class;
}
$view = new AphrontTableView($rows);
$view->setHeaders(array('History', 'Browse', 'Change', 'Path'));
$view->setColumnClasses(array('', '', '', 'wide'));
$view->setRowClasses($rowc);
$view->setNoDataString('This change has not been fully parsed yet.');
return $view->render();
}
示例9: render
public function render()
{
$viewer = $this->getViewer();
$rows = array();
foreach ($this->events as $event) {
// Limit display log size. If a daemon gets stuck in an output loop this
// page can be like >100MB if we don't truncate stuff. Try to do cheap
// line-based truncation first, and fall back to expensive UTF-8 character
// truncation if that doesn't get things short enough.
$message = $event->getMessage();
$more = null;
if (!$this->showFullMessage) {
$more_lines = null;
$more_chars = null;
$line_limit = 12;
if (substr_count($message, "\n") > $line_limit) {
$message = explode("\n", $message);
$more_lines = count($message) - $line_limit;
$message = array_slice($message, 0, $line_limit);
$message = implode("\n", $message);
}
$char_limit = 8192;
if (strlen($message) > $char_limit) {
$message = phutil_utf8v($message);
$more_chars = count($message) - $char_limit;
$message = array_slice($message, 0, $char_limit);
$message = implode('', $message);
}
if ($more_chars) {
$more = new PhutilNumber($more_chars);
$more = pht('Show %d more character(s)...', $more);
} else {
if ($more_lines) {
$more = new PhutilNumber($more_lines);
$more = pht('Show %d more line(s)...', $more);
}
}
if ($more) {
$id = $event->getID();
$more = array("\n...\n", phutil_tag('a', array('href' => "/daemon/event/{$id}/"), $more));
}
}
$row = array($event->getLogType(), phabricator_date($event->getEpoch(), $viewer), phabricator_time($event->getEpoch(), $viewer), array($message, $more));
if ($this->combinedLog) {
array_unshift($row, phutil_tag('a', array('href' => '/daemon/log/' . $event->getLogID() . '/'), pht('Daemon %s', $event->getLogID())));
}
$rows[] = $row;
}
$classes = array('', '', 'right', 'wide prewrap');
$headers = array('Type', 'Date', 'Time', 'Message');
if ($this->combinedLog) {
array_unshift($classes, 'pri');
array_unshift($headers, 'Daemon');
}
$log_table = new AphrontTableView($rows);
$log_table->setHeaders($headers);
$log_table->setColumnClasses($classes);
return $log_table->render();
}
示例10: render
public function render()
{
$drequest = $this->getDiffusionRequest();
$current_branch = $drequest->getBranch();
$repository = $drequest->getRepository();
Javelin::initBehavior('phabricator-tooltips');
$doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: Autoclose');
$rows = array();
$rowc = array();
foreach ($this->branches as $branch) {
$commit = idx($this->commits, $branch->getCommitIdentifier());
if ($commit) {
$details = $commit->getSummary();
$datetime = phabricator_datetime($commit->getEpoch(), $this->user);
} else {
$datetime = null;
$details = null;
}
switch ($repository->shouldSkipAutocloseBranch($branch->getShortName())) {
case PhabricatorRepository::BECAUSE_REPOSITORY_IMPORTING:
$icon = 'fa-times bluegrey';
$tip = pht('Repository Importing');
break;
case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED:
$icon = 'fa-times bluegrey';
$tip = pht('Repository Autoclose Disabled');
break;
case PhabricatorRepository::BECAUSE_BRANCH_UNTRACKED:
$icon = 'fa-times bluegrey';
$tip = pht('Branch Untracked');
break;
case PhabricatorRepository::BECAUSE_BRANCH_NOT_AUTOCLOSE:
$icon = 'fa-times bluegrey';
$tip = pht('Branch Autoclose Disabled');
break;
case null:
$icon = 'fa-check bluegrey';
$tip = pht('Autoclose Enabled');
break;
default:
$icon = 'fa-question';
$tip = pht('Status Unknown');
break;
}
$status_icon = id(new PHUIIconView())->setIconFont($icon)->addSigil('has-tooltip')->setHref($doc_href)->setMetadata(array('tip' => $tip, 'size' => 200));
$rows[] = array(phutil_tag('a', array('href' => $drequest->generateURI(array('action' => 'history', 'branch' => $branch->getShortName()))), pht('History')), phutil_tag('a', array('href' => $drequest->generateURI(array('action' => 'browse', 'branch' => $branch->getShortName()))), $branch->getShortName()), self::linkCommit($drequest->getRepository(), $branch->getCommitIdentifier()), $status_icon, $datetime, AphrontTableView::renderSingleDisplayLine($details));
if ($branch->getShortName() == $current_branch) {
$rowc[] = 'highlighted';
} else {
$rowc[] = null;
}
}
$view = new AphrontTableView($rows);
$view->setHeaders(array(pht('History'), pht('Branch'), pht('Head'), pht(''), pht('Modified'), pht('Details')));
$view->setColumnClasses(array('', 'pri', '', '', '', 'wide'));
$view->setRowClasses($rowc);
return $view->render();
}
示例11: render
public function render()
{
$user = $this->getUser();
$trace = $this->trace;
$libraries = PhutilBootloader::getInstance()->getAllLibraries();
// TODO: Make this configurable?
$path = 'https://secure.phabricator.com/diffusion/%s/browse/master/src/';
$callsigns = array('arcanist' => 'ARC', 'phutil' => 'PHU', 'phabricator' => 'P');
$rows = array();
$depth = count($trace);
foreach ($trace as $part) {
$lib = null;
$file = idx($part, 'file');
$relative = $file;
foreach ($libraries as $library) {
$root = phutil_get_library_root($library);
if (Filesystem::isDescendant($file, $root)) {
$lib = $library;
$relative = Filesystem::readablePath($file, $root);
break;
}
}
$where = '';
if (isset($part['class'])) {
$where .= $part['class'] . '::';
}
if (isset($part['function'])) {
$where .= $part['function'] . '()';
}
if ($file) {
if (isset($callsigns[$lib])) {
$attrs = array('title' => $file);
try {
$attrs['href'] = $user->loadEditorLink('/src/' . $relative, $part['line'], $callsigns[$lib]);
} catch (Exception $ex) {
// The database can be inaccessible.
}
if (empty($attrs['href'])) {
$attrs['href'] = sprintf($path, $callsigns[$lib]) . str_replace(DIRECTORY_SEPARATOR, '/', $relative) . '$' . $part['line'];
$attrs['target'] = '_blank';
}
$file_name = phutil_tag('a', $attrs, $relative);
} else {
$file_name = phutil_tag('span', array('title' => $file), $relative);
}
$file_name = hsprintf('%s : %d', $file_name, $part['line']);
} else {
$file_name = phutil_tag('em', array(), '(Internal)');
}
$rows[] = array($depth--, $lib, $file_name, $where);
}
$table = new AphrontTableView($rows);
$table->setHeaders(array(pht('Depth'), pht('Library'), pht('File'), pht('Where')));
$table->setColumnClasses(array('n', '', '', 'wide'));
return phutil_tag('div', array('class' => 'exception-trace'), $table->render());
}
示例12: render
public function render()
{
$rows = array();
if (!$this->user) {
throw new Exception("Call setUser() before rendering!");
}
foreach ($this->daemonLogs as $log) {
$epoch = $log->getDateCreated();
$status = $log->getStatus();
if ($log->getHost() == php_uname('n') && $status != PhabricatorDaemonLog::STATUS_EXITED && $status != PhabricatorDaemonLog::STATUS_DEAD) {
$pid = $log->getPID();
$is_running = PhabricatorDaemonReference::isProcessRunning($pid);
if (!$is_running) {
$guard = AphrontWriteGuard::beginScopedUnguardedWrites();
$log->setStatus(PhabricatorDaemonLog::STATUS_DEAD);
$log->save();
unset($guard);
$status = PhabricatorDaemonLog::STATUS_DEAD;
}
}
$heartbeat_timeout = $log->getDateModified() + 3 * PhutilDaemonOverseer::HEARTBEAT_WAIT;
if ($status == PhabricatorDaemonLog::STATUS_RUNNING && $heartbeat_timeout < time()) {
$status = PhabricatorDaemonLog::STATUS_UNKNOWN;
}
switch ($status) {
case PhabricatorDaemonLog::STATUS_RUNNING:
$style = 'color: #00cc00';
$title = 'Running';
$symbol = '•';
break;
case PhabricatorDaemonLog::STATUS_DEAD:
$style = 'color: #cc0000';
$title = 'Died';
$symbol = '•';
break;
case PhabricatorDaemonLog::STATUS_EXITED:
$style = 'color: #000000';
$title = 'Exited';
$symbol = '•';
break;
case PhabricatorDaemonLog::STATUS_UNKNOWN:
default:
// fallthrough
$style = 'color: #888888';
$title = 'Unknown';
$symbol = '?';
}
$running = phutil_render_tag('span', array('style' => $style, 'title' => $title), $symbol);
$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();
}
示例13: render
public function render()
{
$request = $this->getDiffusionRequest();
$repository = $request->getRepository();
$base_path = trim($request->getPath(), '/');
if ($base_path) {
$base_path = $base_path . '/';
}
$need_pull = array();
$rows = array();
$show_edit = false;
foreach ($this->paths as $path) {
$full_path = $base_path . $path->getPath();
$dir_slash = null;
$file_type = $path->getFileType();
if ($file_type == DifferentialChangeType::FILE_DIRECTORY) {
$browse_text = $path->getPath() . '/';
$dir_slash = '/';
$browse_link = phutil_tag('strong', array(), $this->linkBrowse($full_path . $dir_slash, array('type' => $file_type, 'name' => $browse_text)));
$history_path = $full_path . '/';
} else {
if ($file_type == DifferentialChangeType::FILE_SUBMODULE) {
$browse_text = $path->getPath() . '/';
$browse_link = phutil_tag('strong', array(), $this->linkBrowse(null, array('type' => $file_type, 'name' => $browse_text, 'hash' => $path->getHash(), 'external' => $path->getExternalURI())));
$history_path = $full_path . '/';
} else {
$browse_text = $path->getPath();
$browse_link = $this->linkBrowse($full_path, array('type' => $file_type, 'name' => $browse_text));
$history_path = $full_path;
}
}
$history_link = $this->linkHistory($history_path);
$dict = array('lint' => celerity_generate_unique_node_id(), 'commit' => celerity_generate_unique_node_id(), 'date' => celerity_generate_unique_node_id(), 'author' => celerity_generate_unique_node_id(), 'details' => celerity_generate_unique_node_id());
$need_pull[$full_path . $dir_slash] = $dict;
foreach ($dict as $k => $uniq) {
$dict[$k] = phutil_tag('span', array('id' => $uniq), '');
}
$rows[] = array($history_link, $browse_link, idx($dict, 'lint'), $dict['commit'], $dict['details'], $dict['date']);
}
if ($need_pull) {
Javelin::initBehavior('diffusion-pull-lastmodified', array('uri' => (string) $request->generateURI(array('action' => 'lastmodified', 'stable' => true)), 'map' => $need_pull));
}
$branch = $this->getDiffusionRequest()->loadBranch();
$show_lint = $branch && $branch->getLintCommit();
$lint = $request->getLint();
$view = new AphrontTableView($rows);
$view->setHeaders(array(null, pht('Path'), $lint ? $lint : pht('Lint'), pht('Modified'), pht('Details'), pht('Committed')));
$view->setColumnClasses(array('nudgeright', '', '', '', 'wide', 'right'));
$view->setColumnVisibility(array(true, true, $show_lint, true, true, true));
$view->setDeviceVisibility(array(true, true, false, false, true, false));
return $view->render();
}
示例14: render
public function render()
{
$user = $this->user;
require_celerity_resource('phabricator-flag-css');
$rows = array();
foreach ($this->flags as $flag) {
$class = PhabricatorFlagColor::getCSSClass($flag->getColor());
$rows[] = array(phutil_render_tag('div', array('class' => 'phabricator-flag-icon ' . $class), ''), $flag->getHandle()->renderLink(), phutil_escape_html($flag->getNote()), phabricator_datetime($flag->getDateCreated(), $user), phabricator_render_form($user, array('method' => 'POST', 'action' => '/flag/edit/' . $flag->getObjectPHID() . '/', 'sigil' => 'workflow'), phutil_render_tag('button', array('class' => 'small grey'), 'Edit Flag')), phabricator_render_form($user, array('method' => 'POST', 'action' => '/flag/delete/' . $flag->getID() . '/', 'sigil' => 'workflow'), phutil_render_tag('button', array('class' => 'small grey'), 'Remove Flag')));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array('', 'Flagged Object', 'Note', 'Flagged On', '', ''));
$table->setColumnClasses(array('', 'pri', 'wide', '', 'action', 'action'));
$table->setNoDataString('No flags.');
return $table->render();
}
示例15: render
public function render()
{
$data = $this->getData();
$sections = array('Basics' => array('Host' => $data['Server']['SERVER_ADDR'], 'Hostname' => gethostbyaddr($data['Server']['SERVER_ADDR']), 'Machine' => php_uname('n')));
$sections = array_merge($sections, $data);
$out = array();
foreach ($sections as $header => $map) {
$rows = array();
foreach ($map as $key => $value) {
$rows[] = array(phutil_escape_html($key), phutil_escape_html(is_array($value) ? json_encode($value) : $value));
}
$table = new AphrontTableView($rows);
$table->setHeaders(array($header, null));
$table->setColumnClasses(array('header', 'wide wrap'));
$out[] = $table->render();
}
return implode("\n", $out);
}