From 17b5d175ff4391b51f40da0164ff47bdd23e99b3 Mon Sep 17 00:00:00 2001 From: Pepijn Over Date: Tue, 5 Aug 2014 15:49:17 +0200 Subject: [PATCH] adding pushover clone button for new app --- src/includes/psmconfig.inc.php | 7 ++++++- src/lang/bg_BG.lang.php | 3 ++- src/lang/da_DK.lang.php | 3 ++- src/lang/de_DE.lang.php | 3 ++- src/lang/en_US.lang.php | 3 ++- src/lang/es_ES.lang.php | 3 ++- src/lang/fr_FR.lang.php | 3 ++- src/lang/it_IT.lang.php | 3 ++- src/lang/ko_KR.lang.php | 3 ++- src/lang/nl_NL.lang.php | 3 ++- src/lang/pt_BR.lang.php | 3 ++- src/lang/ru_RU.lang.php | 3 ++- src/lang/zh_CN.lang.php | 3 ++- .../Config/Controller/ConfigController.class.php | 7 ++++++- src/templates/default/module/config/config.tpl.html | 1 + static/js/scripts.js | 10 ---------- 16 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/includes/psmconfig.inc.php b/src/includes/psmconfig.inc.php index 58c309b6..3cc604dd 100644 --- a/src/includes/psmconfig.inc.php +++ b/src/includes/psmconfig.inc.php @@ -106,4 +106,9 @@ define('PSM_CURL_TIMEOUT', 10); /** * Name of the default theme. */ -define('PSM_THEME', 'default'); \ No newline at end of file +define('PSM_THEME', 'default'); + +/** + * Clone URL for the Pushover.net service. + */ +define('PSM_PUSHOVER_CLONE_URL', 'https://pushover.net/apps/clone/php_server_monitor'); \ No newline at end of file diff --git a/src/lang/bg_BG.lang.php b/src/lang/bg_BG.lang.php index 1cb8b533..257728cc 100644 --- a/src/lang/bg_BG.lang.php +++ b/src/lang/bg_BG.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Номер на изпращача', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Изберете кога желаете да получавате известия', 'alert_type_description' => 'Промяна на сатуса:
'. 'Ще получавате известие когато има промяна със връзката на даден някой от описаните сървър или сайт. От Онлайн -> Офлайн и от Офлайн -> Онлайн.
'. diff --git a/src/lang/da_DK.lang.php b/src/lang/da_DK.lang.php index d78b5d46..43d3e881 100644 --- a/src/lang/da_DK.lang.php +++ b/src/lang/da_DK.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Afsenders navn.', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Vælg hvornår du vil modtage besked', 'alert_type_description' => 'Status ændring: '. 'Du vil modtage en notifcation når en server har en ændring i status. Fra online -> offline eller offline -> online.
'. diff --git a/src/lang/de_DE.lang.php b/src/lang/de_DE.lang.php index 7f39008d..b36e4dac 100644 --- a/src/lang/de_DE.lang.php +++ b/src/lang/de_DE.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'SMS Sendernummer', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Wann möchten Sie benachrichtig werden?', 'alert_type_description' => 'Status geändert: '. '... wenn sich der Status ändert
'. diff --git a/src/lang/en_US.lang.php b/src/lang/en_US.lang.php index b3a0218d..ce789338 100644 --- a/src/lang/en_US.lang.php +++ b/src/lang/en_US.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Sender\'s phone number', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Select when you\'d like to be notified.', 'alert_type_description' => 'Status change: '. 'You will receive a notifcation when a server has a change in status. So from online -> offline or offline -> online.
'. diff --git a/src/lang/es_ES.lang.php b/src/lang/es_ES.lang.php index 3d271739..5c32096a 100644 --- a/src/lang/es_ES.lang.php +++ b/src/lang/es_ES.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Número origen del SMS', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Cuando desea recibir notificaciones ?', 'alert_type_description' => '... Al cambiar el estado: '. 'p.ej. online -> offline o offline -> online.
'. diff --git a/src/lang/fr_FR.lang.php b/src/lang/fr_FR.lang.php index f8e76f08..82b64337 100644 --- a/src/lang/fr_FR.lang.php +++ b/src/lang/fr_FR.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'SMS de l\'expéditeur', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Choisissez quand vous souhaitez être notifié', 'alert_type_description' => 'Changement d\'état : '. 'Vous recevez une notification chaque fois que le serveur change d\'état. C\'est-à-dire passe de l\'état OK à HORS SERVICE ou de HORS SERVICE à OK.
'. diff --git a/src/lang/it_IT.lang.php b/src/lang/it_IT.lang.php index b5c231bf..c4859486 100644 --- a/src/lang/it_IT.lang.php +++ b/src/lang/it_IT.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Numero di telefono del mittente', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Seleziona quando vuoi essere notificato', 'alert_type_description' => 'Cambio di Stato: '. 'Riceverai una notifica solo quando un server cambierà stato. Quindi da online -> offline oppure da offline -> online.
'. diff --git a/src/lang/ko_KR.lang.php b/src/lang/ko_KR.lang.php index 85337917..68a71897 100644 --- a/src/lang/ko_KR.lang.php +++ b/src/lang/ko_KR.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Sender\'s phone number', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => '알림을 원하면 다음과 같이 변경하십시오.', 'alert_type_description' => '상태 변경:
'. '서버 상태가 변경이되면 알림을 받습니다. online -> offline -> online.
'. diff --git a/src/lang/nl_NL.lang.php b/src/lang/nl_NL.lang.php index a3d78e43..fede517b 100644 --- a/src/lang/nl_NL.lang.php +++ b/src/lang/nl_NL.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Telefoonnummer afzender', 'pushover_status' => 'Sta Pushover berichten toe?', 'pushover_description' => 'Pushover is een dienst die het gemakkelijk maakt om real-time notificaties te ontvangen. Zie hun website voor meer informatie.', + 'pushover_clone_app' => 'Klik hier om je Pushover app te maken', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Voordat je Pushover kunt gebruiken moet je een App registreren via hun website, en daarvan de App API Token hier invullen.', + 'pushover_api_token_description' => 'Voordat je Pushover kunt gebruiken moet je een App registreren via hun website, en daarvan de App API Token hier invullen.', 'alert_type' => 'Selecteer wanneer je een notificatie wilt', 'alert_type_description' => 'Status change: '. 'Je ontvangt alleen bericht wanneer een server van status verandert. Dus van online -> offline of offline -> online.
'. diff --git a/src/lang/pt_BR.lang.php b/src/lang/pt_BR.lang.php index bd89fa54..5436cd22 100644 --- a/src/lang/pt_BR.lang.php +++ b/src/lang/pt_BR.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Número de telefone de envio', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => 'Selecione como você gostaria de ser notificado.', 'alert_type_description' => 'Mudança de Status: '. 'Você receberá uma notificação quando o seridor tive uma mudança de status. De online -> offline ou offline -> online.
'. diff --git a/src/lang/ru_RU.lang.php b/src/lang/ru_RU.lang.php index 5ec93971..87712f94 100644 --- a/src/lang/ru_RU.lang.php +++ b/src/lang/ru_RU.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => 'Номер отправителя', 'pushover_status' => 'Разрешить отправку Pushover сообщений', 'pushover_description' => 'Pushover - это сервис, который позволяет легко получать уведомления в режиме реального времени. Больше информации на их веб-сайте.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Прежде чем вы сможете начать пользоваться Pushover, вам необходимо зарегестрировать "App" на их веб-сайте и ввести "App API Token" сюда.', + 'pushover_api_token_description' => 'Прежде чем вы сможете начать пользоваться Pushover, вам необходимо зарегестрировать "App" на их веб-сайте и ввести "App API Token" сюда.', 'alert_type' => 'Выбeрите, какие вы хотите получать уведомления', 'alert_type_description' => 'Изменение статуса : '. 'Вы получите уведомление об изменение статуса. Для онлайн -> оффлайн или офлайн -> онлайн.
'. diff --git a/src/lang/zh_CN.lang.php b/src/lang/zh_CN.lang.php index eed73d86..6e83ca04 100644 --- a/src/lang/zh_CN.lang.php +++ b/src/lang/zh_CN.lang.php @@ -198,8 +198,9 @@ $sm_lang = array( 'sms_from' => '发信人电话号', 'pushover_status' => 'Allow sending Pushover messages', 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.', + 'pushover_clone_app' => 'Click here to create your Pushover app', 'pushover_api_token' => 'Pushover App API Token', - 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', + 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.', 'alert_type' => '如果想要收到提醒请选中此项.', 'alert_type_description' => '状态变化: '. '服务器 online -> offline 或 offline -> online 的状态变化将会收到提醒.
'. diff --git a/src/psm/Module/Config/Controller/ConfigController.class.php b/src/psm/Module/Config/Controller/ConfigController.class.php index e518525d..125fee0b 100644 --- a/src/psm/Module/Config/Controller/ConfigController.class.php +++ b/src/psm/Module/Config/Controller/ConfigController.class.php @@ -308,8 +308,13 @@ class ConfigController extends AbstractController { 'label_sms_from' => psm_get_lang('config', 'sms_from'), 'label_pushover_description' => psm_get_lang('config', 'pushover_description'), 'label_pushover_status' => psm_get_lang('config', 'pushover_status'), + 'label_pushover_clone_app' => psm_get_lang('config', 'pushover_clone_app'), + 'pushover_clone_url' => PSM_PUSHOVER_CLONE_URL, 'label_pushover_api_token' => psm_get_lang('config', 'pushover_api_token'), - 'label_pushover_api_token_description' => psm_get_lang('config', 'pushover_api_token_description'), + 'label_pushover_api_token_description' => sprintf( + psm_get_lang('config', 'pushover_api_token_description'), + PSM_PUSHOVER_CLONE_URL + ), 'label_alert_type' => psm_get_lang('config', 'alert_type'), 'label_alert_type_description' => psm_get_lang('config', 'alert_type_description'), 'label_alert_type_status' => psm_get_lang('config', 'alert_type_status'), diff --git a/src/templates/default/module/config/config.tpl.html b/src/templates/default/module/config/config.tpl.html index 35d84325..8749ce96 100644 --- a/src/templates/default/module/config/config.tpl.html +++ b/src/templates/default/module/config/config.tpl.html @@ -193,6 +193,7 @@
+

{{ label_pushover_api_token_description|raw }}

diff --git a/static/js/scripts.js b/static/js/scripts.js index 40d51e3b..f77c5e3f 100755 --- a/static/js/scripts.js +++ b/static/js/scripts.js @@ -119,14 +119,4 @@ function psm_flash_message(message) { flashmessage.slideDown(); } } -} - -/** -* This function toggles all grouped checkboxes by name -*/ -function psm_onClickCheckboxIDCToggleAll(name, value) { - var $visible = $('input[name="'+name+'"]:visible'); - - var value = (typeof value === 'undefined') ? !$visible.first().is(':checked') : value; - $visible.prop('checked', value); } \ No newline at end of file