Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php
index 0c9a5b8214..95c19d9d5e 100644
--- a/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php
+++ b/src/applications/settings/panel/PhabricatorSettingsPanelConpherencePreferences.php
@@ -1,79 +1,69 @@
<?php
final class PhabricatorSettingsPanelConpherencePreferences
extends PhabricatorSettingsPanel {
public function isEnabled() {
return PhabricatorApplication::isClassInstalled(
'PhabricatorApplicationConpherence');
}
public function getPanelKey() {
return 'conpherence';
}
public function getPanelName() {
return pht('Conpherence Preferences');
}
public function getPanelGroup() {
return pht('Application Settings');
}
public function processRequest(AphrontRequest $request) {
$user = $request->getUser();
$preferences = $user->loadPreferences();
$pref = PhabricatorUserPreferences::PREFERENCE_CONPH_NOTIFICATIONS;
if ($request->isFormPost()) {
$notifications = $request->getInt($pref);
$preferences->setPreference($pref, $notifications);
$preferences->save();
return id(new AphrontRedirectResponse())
->setURI($this->getPanelURI('?saved=true'));
}
$form = id(new AphrontFormView())
->setUser($user)
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Conpherence Notifications'))
->setName($pref)
->setValue($preferences->getPreference($pref))
->setOptions(
array(
ConpherenceSettings::EMAIL_ALWAYS
=> pht('Email Always'),
ConpherenceSettings::NOTIFICATIONS_ONLY
=> pht('Notifications Only'),
))
->setCaption(
pht('Should Conpherence send emails for updates or '.
'notifications only? This global setting can be overridden '.
'on a per-thread basis within Conpherence.')))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Save Preferences')));
- $error_view = null;
- if ($request->getBool('saved')) {
- $error_view = id(new AphrontErrorView())
- ->appendChild(pht('Preferences Saved'))
- ->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
- }
-
$form_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Conpherence Preferences'))
- ->setForm($form);
-
- if ($error_view) {
- $form_box->setErrorView($error_view);
- }
+ ->setForm($form)
+ ->setFormSaved($request->getBool('saved'));
return array(
$form_box,
);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Mar 16, 9:21 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
962538
Default Alt Text
(2 KB)

Event Timeline