diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-01-28 15:23:06 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-01-28 15:23:06 +0000 |
commit | 8d02a1dbf8a51d9e2396b5b431fede557ea2fedd (patch) | |
tree | d551a64c731419c226b440c49e8621c5a1bd893b /Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php | |
parent | 4c2738e179c4d994b6b6db3c67d9d1c227a0ede1 (diff) | |
download | Post-SMTP-8d02a1dbf8a51d9e2396b5b431fede557ea2fedd.zip |
Chrome Extension Notification
Diffstat (limited to 'Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php')
-rw-r--r-- | Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php | 19 |
1 files changed, 19 insertions, 0 deletions
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( '</select><br/><span class="postman_input_description">%s</span>', $inputDescription ); } + public function notification_use_chrome_callback() { + $value = $this->options->useChromeExtension(); + printf( '<input type="checkbox" id="input_%2$s" class="input_%2$s" name="%1$s[%2$s]" %3$s />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_USE_CHROME, $value ? 'checked="checked"' : '' ); + } + + public function notification_chrome_uid_callback() { + printf( '<input type="password" id="input_%2$s" class="input_%2$s" name="%1$s[%2$s]" value="%3$s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_CHROME_UID, $this->options->getNotificationChromeUid() ); + } + public function pushover_user_callback() { printf( '<input type="password" id="pushover_user" name="%s[%s]" value="%s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::PUSHOVER_USER, $this->options->getPushoverUser() ); } |