diff --git a/bl-plugins/discovery/languages/de_CH.json b/bl-plugins/discovery/languages/de_CH.json new file mode 100644 index 00000000..99b71854 --- /dev/null +++ b/bl-plugins/discovery/languages/de_CH.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "API", + "description": "Schnittstelle, für den Datenaustausch mit Bludit über das HTTP-Protokoll. Informationen zur Verwendung des Plugins unter API Introduction." + }, + "api-token": "API-Token", + "amount-of-pages": "Anzahl Seiten", + "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Maximum der Seiten bei einem Aufruf /api/pages.", + "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Der Token kann für Leserechte verwendet werden. Er wird bei bei einer Neuinstallation des Plugins erneuert." +} diff --git a/bl-plugins/discovery/languages/de_DE.json b/bl-plugins/discovery/languages/de_DE.json new file mode 100644 index 00000000..99b71854 --- /dev/null +++ b/bl-plugins/discovery/languages/de_DE.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "API", + "description": "Schnittstelle, für den Datenaustausch mit Bludit über das HTTP-Protokoll. Informationen zur Verwendung des Plugins unter API Introduction." + }, + "api-token": "API-Token", + "amount-of-pages": "Anzahl Seiten", + "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Maximum der Seiten bei einem Aufruf /api/pages.", + "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Der Token kann für Leserechte verwendet werden. Er wird bei bei einer Neuinstallation des Plugins erneuert." +} diff --git a/bl-plugins/discovery/languages/en.json b/bl-plugins/discovery/languages/en.json new file mode 100644 index 00000000..fc25e50c --- /dev/null +++ b/bl-plugins/discovery/languages/en.json @@ -0,0 +1,7 @@ +{ + "plugin-data": + { + "name": "Discovery", + "description": "" + } +} \ No newline at end of file diff --git a/bl-plugins/discovery/languages/es.json b/bl-plugins/discovery/languages/es.json new file mode 100644 index 00000000..0bcb5085 --- /dev/null +++ b/bl-plugins/discovery/languages/es.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "API", + "description": "Interfaz para interactuar con Bludit mediante el protocolo HTTP.
Leer más sobre este plugin en API introducción." + }, + "api-token": "API Token", + "amount-of-pages": "Cantidad de paginas", + "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Este es el máximo de páginas a devolver cuando llame a /api/pages.", + "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Este token es para sólo lectura y se regenera cada vez que se instala el plugin." +} \ No newline at end of file diff --git a/bl-plugins/discovery/languages/fr_FR.json b/bl-plugins/discovery/languages/fr_FR.json new file mode 100644 index 00000000..eb8c7568 --- /dev/null +++ b/bl-plugins/discovery/languages/fr_FR.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "API", + "description": "Interface pour interagir avec Bludit en utilisant le protocole HTTP.
En savoir plus sur ce plugin, en lisant l’introduction sur l’API." + }, + "api-token": "Jeton de l’API", + "amount-of-pages": "Nombre de pages", + "this-is-the-maximum-of-pages-to-return-when-you-call-to": "C’est le nombre maximal de pages à renvoyer lorsque vous appelez l’api par pages.", + "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Ce jeton est en lecture seule et est régénéré à chaque fois que vous installez le plugin." +} \ No newline at end of file diff --git a/bl-plugins/discovery/languages/ru_RU.json b/bl-plugins/discovery/languages/ru_RU.json new file mode 100644 index 00000000..819ba33f --- /dev/null +++ b/bl-plugins/discovery/languages/ru_RU.json @@ -0,0 +1,11 @@ +{ + "plugin-data": + { + "name": "API", + "description": "Интерфейс для взаимодействия с Bludit по HTTP-протоколу.
Узнать больше про этот плагин API Introduction." + }, + "api-token": "API Tтокен", + "amount-of-pages": "Количество страниц", + "this-is-the-maximum-of-pages-to-return-when-you-call-to": "Максимальное количество возвращаемых страниц при обращении к /api/pages", + "this-token-is-for-read-only-and-is-regenerated-every-time-you-install-the-plugin": "Данные токен используется только для чтения, он обновляется при каждой переустановке плагина" +} diff --git a/bl-plugins/discovery/metadata.json b/bl-plugins/discovery/metadata.json new file mode 100644 index 00000000..0a1ec2d2 --- /dev/null +++ b/bl-plugins/discovery/metadata.json @@ -0,0 +1,10 @@ +{ + "author": "Bludit", + "email": "", + "website": "https://plugins.bludit.com", + "version": "2.0", + "releaseDate": "2017-06-15", + "license": "MIT", + "compatible": "2.0", + "notes": "" +} \ No newline at end of file diff --git a/bl-plugins/discovery/plugin.php b/bl-plugins/discovery/plugin.php new file mode 100644 index 00000000..243d2601 --- /dev/null +++ b/bl-plugins/discovery/plugin.php @@ -0,0 +1,35 @@ +formButtons = false; + } + + public function form() + { + global $Language; + + if (!pluginEnabled('API')) { + $html = '
Enable the plugin API to use this plugin.
'; + } else { + $this->pingBludit(); + $html = '
Your Site is in sync with Bludit Discovery.
'; + } + + return $html; + } + + private function pingBludit() + { + global $plugins; + + $API = $plugins['all']['pluginAPI']; + $APIToken = $API->getValue('token'); + + $url = 'https://ping.bludit.com?site='.urlencode(DOMAIN_BASE).'&token='.urlencode($APIToken); + TCP::http($url, $method='GET', $verifySSL=true, $timeOut=4, $followRedirections=false, $binary=false, $headers=false); + } + +} \ No newline at end of file