Differential D15703 Diff 37846 src/applications/config/option/PhabricatorNotificationConfigOptions.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorNotificationConfigOptions.php
| Show All 14 Lines | public function getIcon() { | ||||
| return 'fa-bell'; | return 'fa-bell'; | ||||
| } | } | ||||
| public function getGroup() { | public function getGroup() { | ||||
| return 'core'; | return 'core'; | ||||
| } | } | ||||
| public function getOptions() { | public function getOptions() { | ||||
| return array( | $servers_type = 'custom:PhabricatorNotificationServersConfigOptionType'; | ||||
| $this->newOption('notification.enabled', 'bool', false) | $servers_help = $this->deformat(pht(<<<EOTEXT | ||||
| ->setBoolOptions( | Provide a list of notification servers to enable real-time notifications. | ||||
| For help setting up notification servers, see **[[ %s | %s ]]** in the | |||||
| documentation. | |||||
| EOTEXT | |||||
| , | |||||
| PhabricatorEnv::getDoclink( | |||||
| 'Notifications User Guide: Setup and Configuration'), | |||||
| pht('Notifications User Guide: Setup and Configuration'))); | |||||
| $servers_example1 = array( | |||||
| array( | array( | ||||
| pht('Enable Real-Time Notifications'), | 'type' => 'client', | ||||
| pht('Disable Real-Time Notifications'), | 'host' => 'phabricator.mycompany.com', | ||||
| )) | 'port' => 22280, | ||||
| ->setSummary(pht('Enable real-time notifications.')) | 'protocol' => 'https', | ||||
| ->setDescription( | ), | ||||
| pht( | array( | ||||
| "Enable real-time notifications. You must also run a Node.js ". | 'type' => 'admin', | ||||
| "based notification server for this to work. Consult the ". | 'host' => '127.0.0.1', | ||||
| "documentation in 'Notifications User Guide: Setup and ". | 'port' => 22281, | ||||
| "Configuration' for instructions.")), | 'protocol' => 'http', | ||||
| $this->newOption( | ), | ||||
| 'notification.client-uri', | ); | ||||
| 'string', | |||||
| 'http://localhost:22280/') | $servers_example1 = id(new PhutilJSON())->encodeAsList( | ||||
| ->setDescription(pht('Location of the client server.')), | $servers_example1); | ||||
| $this->newOption( | |||||
| 'notification.server-uri', | return array( | ||||
| 'string', | $this->newOption('notification.servers', $servers_type, array()) | ||||
| 'http://localhost:22281/') | ->setSummary(pht('Configure real-time notifications.')) | ||||
| ->setDescription(pht('Location of the notification receiver server.')), | ->setDescription($servers_help) | ||||
| ->addExample( | |||||
| $servers_example1, | |||||
| pht('Simple Example')), | |||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||