Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/config/controller/PhabricatorConfigController.php
12256 views
1
<?php
2
3
abstract class PhabricatorConfigController extends PhabricatorController {
4
5
public function shouldRequireAdmin() {
6
return true;
7
}
8
9
public function buildHeaderView($text, $action = null) {
10
$viewer = $this->getViewer();
11
12
$file = PhabricatorFile::loadBuiltin($viewer, 'projects/v3/manage.png');
13
$image = $file->getBestURI($file);
14
$header = id(new PHUIHeaderView())
15
->setHeader($text)
16
->setProfileHeader(true)
17
->setImage($image);
18
19
if ($action) {
20
$header->addActionLink($action);
21
}
22
23
return $header;
24
}
25
26
public function buildConfigBoxView($title, $content, $action = null) {
27
$header = id(new PHUIHeaderView())
28
->setHeader($title);
29
30
if ($action) {
31
$header->addActionItem($action);
32
}
33
34
$view = id(new PHUIObjectBoxView())
35
->setHeader($header)
36
->appendChild($content)
37
->setBackground(PHUIObjectBoxView::WHITE_CONFIG);
38
39
return $view;
40
}
41
42
}
43
44