Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2682516
D25312.1734662554.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25312.1734662554.diff
View Options
diff --git a/src/applications/notification/view/PhabricatorNotificationStatusView.php b/src/applications/notification/view/PhabricatorNotificationStatusView.php
--- a/src/applications/notification/view/PhabricatorNotificationStatusView.php
+++ b/src/applications/notification/view/PhabricatorNotificationStatusView.php
@@ -40,34 +40,41 @@
protected function getTagContent() {
$have = PhabricatorEnv::getEnvConfig('notification.servers');
if ($have) {
- $icon = id(new PHUIIconView())
- ->setIcon('fa-circle-o yellow');
- $text = pht('Connecting...');
- return phutil_tag(
- 'span',
- array(
- 'class' => 'connection-status-text '.
- 'aphlict-connection-status-connecting',
- ),
- array(
- $icon,
- $text,
- ));
+ return $this->getIconAndMsg(
+ 'aphlict-connection-status-connecting',
+ 'fa-circle-o yellow',
+ pht('Connecting...'));
} else {
- $text = pht('Notification server not enabled');
- $icon = id(new PHUIIconView())
- ->setIcon('fa-circle-o grey');
- return phutil_tag(
- 'span',
- array(
- 'class' => 'connection-status-text '.
- 'aphlict-connection-status-notenabled',
- ),
- array(
- $icon,
- $text,
- ));
+ return $this->getIconAndMsg(
+ 'aphlict-connection-status-notenabled',
+ 'fa-circle-o grey',
+ pht('Notification server not enabled'));
}
}
+ /**
+ * Create an icon and a text
+ *
+ * @param string $class_name Raw CSS class name(s)
+ * @param string $icon_name Icon name
+ * @param string $text Text to be shown
+ * @return array
+ */
+ private function getIconAndMsg($class_name, $icon_name, $text) {
+ $icon = id(new PHUIIconView())
+ ->setIcon($icon_name);
+
+ $message = phutil_tag(
+ 'span',
+ array(
+ 'class' => 'connection-status-text '.$class_name,
+ ),
+ $text);
+
+ return array(
+ $icon,
+ $message,
+ );
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 02:42 (20 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016405
Default Alt Text
D25312.1734662554.diff (2 KB)
Attached To
Mode
D25312: Fix notification message when Aphlict is not configured
Attached
Detach File
Event Timeline
Log In to Comment