diff options
Diffstat (limited to 'Postman/Postman-Configuration')
-rw-r--r-- | Postman/Postman-Configuration/PostmanConfigurationController.php | 23 | ||||
-rw-r--r-- | Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php | 19 |
2 files changed, 42 insertions, 0 deletions
diff --git a/Postman/Postman-Configuration/PostmanConfigurationController.php b/Postman/Postman-Configuration/PostmanConfigurationController.php index 6abb5e2..a74ae04 100644 --- a/Postman/Postman-Configuration/PostmanConfigurationController.php +++ b/Postman/Postman-Configuration/PostmanConfigurationController.php @@ -428,6 +428,29 @@ class PostmanConfigurationController { </table> </div> + <div id="use-chrome-extension"> + <h2><?php _e( 'Push To Chrome Extension', Postman::TEXT_DOMAIN ); ?></h2> + <table class="form-table"> + <tbody> + <tr> + <th scope="row"><?php _e( 'This is an extra notification to the selection above', Postman::TEXT_DOMAIN ); ?></th> + <td> + <input type="checkbox" id="notification_use_chrome" name="postman_options[notification_use_chrome]" value=""> + <a target="_blank" class="" href="https://chrome.google.com/webstore/detail/npklmbkpbknkmbohdbpikeidiaekjoch"> + <?php _e( 'You can download the chrome extensiom here.', Postman::TEXT_DOMAIN ); ?> + </a> + </td> + </tr> + <tr> + <th scope="row"><?php _e( 'Your UID as you see in the extension.', Postman::TEXT_DOMAIN ); ?></th> + <td> + <input type="password" id="notification_chrome_uid" name="postman_options[notification_chrome_uid]" value=""> + </td> + </tr> + </tbody> + </table> + </div> + <?php print '</fieldset>'; 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() ); } |