buildCrumbs(
array(
'branch' => true,
'path' => true,
'view' => 'browse',
));
$select_map = array(
//'highlighted' => 'View as Highlighted Text',
//'blame' => 'View as Highlighted Text with Blame',
'plain' => 'View as Plain Text',
//'plainblame' => 'View as Plain Text with Blame',
);
$selected = $this->getRequest()->getStr('view');
$select = '';
if ($selected == 'plain') {
$style =
"margin: 1em 2em; width: 90%; height: 80em; font-family: monospace";
} else {
// default style.
$style =
"margin: 1em 2em; width: 90%; height: 80em; font-family: monospace";
}
// TODO: blame, color, line numbers, highlighting, etc etc
$view_form = phutil_render_tag(
'form',
array(
'action' => $this->getRequest()->getRequestURI(),
'method' => 'get',
'style' => 'display: inline',
),
$select.
'');
$file_query = DiffusionFileContentQuery::newFromDiffusionRequest(
$this->diffusionRequest);
$file_content = $file_query->loadFileContent();
$corpus = phutil_render_tag(
'textarea',
array(
'style' => $style,
),
phutil_escape_html($file_content->getCorpus()));
$content[] = $view_form;
$content[] = $corpus;
$nav = $this->buildSideNav('browse', true);
$nav->appendChild($content);
return $this->buildStandardPageResponse(
$nav,
array(
'title' => 'Browse',
));
}
}