Differential D21789 Diff 51945 src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorNotificationsSettingsPanel.php
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | public function processRequest(AphrontRequest $request) { | ||||
$no_support = pht( | $no_support = pht( | ||||
'This web browser does not support desktop notifications. Only '. | 'This web browser does not support desktop notifications. Only '. | ||||
'application notifications will be sent for this browser regardless of '. | 'application notifications will be sent for this browser regardless of '. | ||||
'this preference.'); | 'this preference.'); | ||||
$default_status = phutil_tag( | $default_status = phutil_tag( | ||||
'span', | 'span', | ||||
array(), | array(), | ||||
array( | array( | ||||
pht('This browser has not yet granted permission to send desktop '. | pht( | ||||
'notifications for this Phabricator instance.'), | 'Your browser has not yet granted this server permission to send '. | ||||
'desktop notifications.'), | |||||
phutil_tag('br'), | phutil_tag('br'), | ||||
phutil_tag('br'), | phutil_tag('br'), | ||||
javelin_tag( | javelin_tag( | ||||
'button', | 'button', | ||||
array( | array( | ||||
'sigil' => 'desktop-notifications-permission-button', | 'sigil' => 'desktop-notifications-permission-button', | ||||
'class' => 'green', | 'class' => 'green', | ||||
), | ), | ||||
pht('Grant Permission')), | pht('Grant Permission')), | ||||
)); | )); | ||||
$granted_status = phutil_tag( | $granted_status = phutil_tag( | ||||
'span', | 'span', | ||||
array(), | array(), | ||||
pht('This browser has been granted permission to send desktop '. | pht('Your browser has granted this server permission to send desktop '. | ||||
'notifications for this Phabricator instance.')); | 'notifications.')); | ||||
$denied_status = phutil_tag( | $denied_status = phutil_tag( | ||||
'span', | 'span', | ||||
array(), | array(), | ||||
pht('This browser has denied permission to send desktop notifications '. | pht('This browser has denied permission to send desktop notifications '. | ||||
'for this Phabricator instance. Consult your browser settings / '. | 'to this server. Consult your browser settings / '. | ||||
'documentation to figure out how to clear this setting, do so, '. | 'documentation to figure out how to clear this setting, do so, '. | ||||
'and then re-visit this page to grant permission.')); | 'and then re-visit this page to grant permission.')); | ||||
$message_id = celerity_generate_unique_node_id(); | $message_id = celerity_generate_unique_node_id(); | ||||
$message_container = phutil_tag( | $message_container = phutil_tag( | ||||
'span', | 'span', | ||||
array( | array( | ||||
Show All 40 Lines | $form = id(new AphrontFormView()) | ||||
id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
->setLabel($title) | ->setLabel($title) | ||||
->setControlID($control_id) | ->setControlID($control_id) | ||||
->setName($notifications_key) | ->setName($notifications_key) | ||||
->setValue($notifications_value) | ->setValue($notifications_value) | ||||
->setOptions(PhabricatorNotificationsSetting::getOptionsMap()) | ->setOptions(PhabricatorNotificationsSetting::getOptionsMap()) | ||||
->setCaption( | ->setCaption( | ||||
pht( | pht( | ||||
'Phabricator can send real-time notifications to your web browser '. | 'This server can send real-time notifications to your web browser '. | ||||
'or to your desktop. Select where you want to receive these '. | 'or to your desktop. Select where you want to receive these '. | ||||
'real-time updates.')) | 'real-time updates.')) | ||||
->initBehavior( | ->initBehavior( | ||||
'desktop-notifications-control', | 'desktop-notifications-control', | ||||
$control_config)) | $control_config)) | ||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
->setValue(pht('Save Preference'))); | ->setValue(pht('Save Preference'))); | ||||
Show All 26 Lines |