Skip to content

Commit 4674b88

Browse files
James Rhodesepriestley
James Rhodes
authored and
epriestley
committedMar 21, 2013
Added configurable welcome content for Phabricator home page.
Summary: The welcome.enabled feature is turned on by default; unsure of whether this is desired by upstream. Test Plan: Apply the patch and see the welcome content. It's configurable in the config. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5339
1 parent 489f9e7 commit 4674b88

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed
 

‎conf/default.conf.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,12 @@
847847
'phabricator.show-beta-applications' => false,
848848

849849
// Contains a list of uninstalled applications
850-
'phabricator.uninstalled-applications' => array(),
850+
'phabricator.uninstalled-applications' => array(),
851+
852+
// -- Welcome Screen -------------------------------------------------------- //
853+
854+
// The custom HTML content for the Phabricator welcome screen.
855+
'welcome.html' => null,
851856

852857
// -- Files ----------------------------------------------------------------- //
853858

‎src/applications/config/option/PhabricatorCoreConfigOptions.php

+4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ public function getOptions() {
135135
->setLocked(true)
136136
->setDescription(
137137
pht('Array containing list of Uninstalled applications.')),
138+
$this->newOption('welcome.html', 'string', null)
139+
->setLocked(true)
140+
->setDescription(
141+
pht('Custom HTML to show on the main Phabricator dashboard.')),
138142
);
139143
}
140144

‎src/applications/directory/controller/PhabricatorDirectoryMainController.php

+16
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,19 @@ private function buildMainResponse($nav, array $projects) {
4040
$tasks_panel = null;
4141
}
4242

43+
if (PhabricatorEnv::getEnvConfig('welcome.html') !== null) {
44+
$welcome_panel = $this->buildWelcomePanel();
45+
} else {
46+
$welcome_panel = null;
47+
}
4348
$jump_panel = $this->buildJumpPanel();
4449
$revision_panel = $this->buildRevisionPanel();
4550
$audit_panel = $this->buildAuditPanel();
4651
$commit_panel = $this->buildCommitPanel();
4752

4853
$content = array(
4954
$jump_panel,
55+
$welcome_panel,
5056
$unbreak_panel,
5157
$triage_panel,
5258
$revision_panel,
@@ -226,6 +232,16 @@ private function buildRevisionPanel() {
226232
return $panel;
227233
}
228234

235+
private function buildWelcomePanel() {
236+
$panel = new AphrontPanelView();
237+
$panel->appendChild(
238+
phutil_safe_html(
239+
PhabricatorEnv::getEnvConfig('welcome.html')));
240+
$panel->setNoBackground();
241+
242+
return $panel;
243+
}
244+
229245
private function buildTasksPanel() {
230246
$user = $this->getRequest()->getUser();
231247
$user_phid = $user->getPHID();

0 commit comments

Comments
 (0)
Failed to load comments.