Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / files / applicationpanel / PhabricatorFilesApplicationStorageEnginePanel.php
blob0d3fdc46cc54b759c5c4f688e6908afb8ecbb109
1 <?php
3 final class PhabricatorFilesApplicationStorageEnginePanel
4 extends PhabricatorApplicationConfigurationPanel {
6 public function getPanelKey() {
7 return 'storage';
10 public function shouldShowForApplication(
11 PhabricatorApplication $application) {
12 return ($application instanceof PhabricatorFilesApplication);
15 public function buildConfigurationPagePanel() {
16 $viewer = $this->getViewer();
17 $application = $this->getApplication();
19 $engines = PhabricatorFileStorageEngine::loadAllEngines();
20 $writable_engines = PhabricatorFileStorageEngine::loadWritableEngines();
21 $chunk_engines = PhabricatorFileStorageEngine::loadWritableChunkEngines();
23 $yes = pht('Yes');
24 $no = pht('No');
26 $rows = array();
27 $rowc = array();
28 foreach ($engines as $key => $engine) {
29 if ($engine->isTestEngine()) {
30 continue;
33 $limit = null;
34 if ($engine->hasFilesizeLimit()) {
35 $limit = phutil_format_bytes($engine->getFilesizeLimit());
36 } else {
37 $limit = pht('Unlimited');
40 if ($engine->canWriteFiles()) {
41 $writable = $yes;
42 } else {
43 $writable = $no;
46 if (isset($writable_engines[$key]) || isset($chunk_engines[$key])) {
47 $rowc[] = 'highlighted';
48 } else {
49 $rowc[] = null;
52 $rows[] = array(
53 $key,
54 get_class($engine),
55 $writable,
56 $limit,
60 $table = id(new AphrontTableView($rows))
61 ->setNoDataString(pht('No storage engines available.'))
62 ->setHeaders(
63 array(
64 pht('Key'),
65 pht('Class'),
66 pht('Writable'),
67 pht('Limit'),
69 ->setRowClasses($rowc)
70 ->setColumnClasses(
71 array(
72 '',
73 'wide',
74 '',
75 'n',
76 ));
78 $box = id(new PHUIObjectBoxView())
79 ->setHeaderText(pht('Storage Engines'))
80 ->setTable($table);
82 return $box;
85 public function handlePanelRequest(
86 AphrontRequest $request,
87 PhabricatorController $controller) {
88 return new Aphront404Response();