From 8d02a1dbf8a51d9e2396b5b431fede557ea2fedd Mon Sep 17 00:00:00 2001 From: yehudah Date: Mon, 28 Jan 2019 15:23:06 +0000 Subject: Chrome Extension Notification --- .../PostmanRegisterConfigurationSettings.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php') diff --git a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php index ecd7ec3..6102d10 100644 --- a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php +++ b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php @@ -213,6 +213,16 @@ class PostmanSettingsRegistry { 'slack_token_callback', ), PostmanAdminController::NOTIFICATIONS_SLACK_CRED, 'slack_credentials' ); + add_settings_field( PostmanOptions::NOTIFICATION_USE_CHROME, _x( 'Push to chrome extension', 'Configuration Input Field', Postman::TEXT_DOMAIN ), array( + $this, + 'notification_use_chrome_callback', + ), PostmanAdminController::NOTIFICATIONS_OPTIONS, PostmanAdminController::NOTIFICATIONS_SECTION ); + + add_settings_field( PostmanOptions::NOTIFICATION_CHROME_UID, _x( 'Chrome Extension UID', 'Configuration Input Field', Postman::TEXT_DOMAIN ), array( + $this, + 'notification_chrome_uid_callback', + ), PostmanAdminController::NOTIFICATIONS_OPTIONS, PostmanAdminController::NOTIFICATIONS_SECTION ); + } } @@ -415,6 +425,15 @@ class PostmanSettingsRegistry { printf( '
%s', $inputDescription ); } + public function notification_use_chrome_callback() { + $value = $this->options->useChromeExtension(); + printf( '', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_USE_CHROME, $value ? 'checked="checked"' : '' ); + } + + public function notification_chrome_uid_callback() { + printf( '', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_CHROME_UID, $this->options->getNotificationChromeUid() ); + } + public function pushover_user_callback() { printf( '', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::PUSHOVER_USER, $this->options->getPushoverUser() ); } -- cgit v1.2.3