Merge branch '3.6-rc'

This commit is contained in:
Tobias Diekershoff 2018-03-23 08:00:37 +01:00
commit 39dd3dffe0
733 changed files with 10943 additions and 8237 deletions

View file

@ -12,36 +12,41 @@
* $a->config['geonames']['username'] = 'your_username';
* Also visit http://geonames.org/manageaccount and enable access to the free web services
*
* When plugin is installed, the system calls the plugin
* When addon is installed, the system calls the addon
* name_install() function, located in 'addon/name/name.php',
* where 'name' is the name of the addon.
* If the addon is removed from the configuration list, the
* system will call the name_uninstall() function.
*
*/
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Util\Network;
use Friendica\Util\XML;
function geonames_install() {
/**
*
* Our plugin will attach in three places.
* Our addon will attach in three places.
* The first is just prior to storing a local post.
*
*/
register_hook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
Addon::registerHook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
/**
*
* Then we'll attach into the plugin settings page, and also the
* Then we'll attach into the addon settings page, and also the
* settings post hook so that we can create and update
* user preferences.
*
*/
register_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
register_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
Addon::registerHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin');
Addon::registerHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post');
logger("installed geonames");
}
@ -57,9 +62,9 @@ function geonames_uninstall() {
*
*/
unregister_hook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
unregister_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
unregister_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
Addon::unregisterHook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
Addon::unregisterHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin');
Addon::unregisterHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post');
logger("removed geonames");
@ -74,7 +79,7 @@ function geonames_post_hook($a, &$item) {
* An item was posted on the local system.
* We are going to look for specific items:
* - A status post by a profile owner
* - The profile owner must have allowed our plugin
* - The profile owner must have allowed our addon
*
*/
@ -108,12 +113,12 @@ function geonames_post_hook($a, &$item) {
*
*/
$s = fetch_url('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
$s = Network::fetchUrl('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
if(! $s)
return;
$xml = parse_xml_string($s);
$xml = XML::parseString($s);
if($xml->geoname->name && $xml->geoname->countryName)
$item['location'] = $xml->geoname->name . ', ' . $xml->geoname->countryName;
@ -135,25 +140,25 @@ function geonames_post_hook($a, &$item) {
*
*/
function geonames_plugin_admin_post($a,$post) {
function geonames_addon_admin_post($a,$post) {
if(! local_user() || (! x($_POST,'geonames-submit')))
return;
set_pconfig(local_user(),'geonames','enable',intval($_POST['geonames']));
info( t('Geonames settings updated.') . EOL);
info(L10n::t('Geonames settings updated.') . EOL);
}
/**
*
* Called from the Plugin Setting form.
* Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
function geonames_plugin_admin(&$a,&$s) {
function geonames_addon_admin(&$a,&$s) {
if(! local_user())
return;
@ -176,14 +181,14 @@ function geonames_plugin_admin(&$a,&$s) {
/* Add some HTML to the existing form */
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Geonames Settings') . '</h3>';
$s .= '<h3>' . L10n::t('Geonames Settings') . '</h3>';
$s .= '<div id="geonames-enable-wrapper">';
$s .= '<label id="geonames-enable-label" for="geonames-checkbox">' . t('Enable Geonames Plugin') . '</label>';
$s .= '<label id="geonames-enable-label" for="geonames-checkbox">' . L10n::t('Enable Geonames Addon') . '</label>';
$s .= '<input id="geonames-checkbox" type="checkbox" name="geonames" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="geonames-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="geonames-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
}

View file

@ -26,7 +26,7 @@ msgid "Geonames Settings"
msgstr ""
#: geonames.php:181
msgid "Enable Geonames Plugin"
msgid "Enable Geonames Addon"
msgstr ""
#: geonames.php:187

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "Actualitzada la configuració de Geonames.";
$a->strings["Geonames Settings"] = "Configuració de Geonames";
$a->strings["Enable Geonames Plugin"] = "Habilitar Plugin de Geonames";
$a->strings["Enable Geonames Addon"] = "Habilitar Addon de Geonames";
$a->strings["Submit"] = "Enviar";

View file

@ -28,7 +28,7 @@ msgid "Geonames Settings"
msgstr "Nastavení Geonames"
#: geonames.php:181
msgid "Enable Geonames Plugin"
msgid "Enable Geonames Addon"
msgstr "Povolit Geonames rozšíření"
#: geonames.php:187

View file

@ -7,5 +7,5 @@ function string_plural_select_cs($n){
;
$a->strings["Geonames settings updated."] = "Geonames nastavení aktualizováno.";
$a->strings["Geonames Settings"] = "Nastavení Geonames";
$a->strings["Enable Geonames Plugin"] = "Povolit Geonames rozšíření";
$a->strings["Enable Geonames Addon"] = "Povolit Geonames rozšíření";
$a->strings["Submit"] = "Odeslat";

View file

@ -29,8 +29,8 @@ msgid "Geonames Settings"
msgstr "Geonames Einstellungen"
#: geonames.php:181
msgid "Enable Geonames Plugin"
msgstr "Geonames Plugin aktivieren"
msgid "Enable Geonames Addon"
msgstr "Geonames Addon aktivieren"
#: geonames.php:187
msgid "Submit"

View file

@ -7,5 +7,5 @@ function string_plural_select_de($n){
;
$a->strings["Geonames settings updated."] = "Geonames Einstellungen aktualisiert";
$a->strings["Geonames Settings"] = "Geonames Einstellungen";
$a->strings["Enable Geonames Plugin"] = "Geonames Plugin aktivieren";
$a->strings["Enable Geonames Addon"] = "Geonames Addon aktivieren";
$a->strings["Submit"] = "Senden";

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "Ĝidatigis la Geonames agordojn.";
$a->strings["Geonames Settings"] = "Geonames Agordoj";
$a->strings["Enable Geonames Plugin"] = "Ŝalti la Geonames Kromprogramon";
$a->strings["Enable Geonames Addon"] = "Ŝalti la Geonames Kromprogramon";
$a->strings["Submit"] = "Sendi";

View file

@ -28,8 +28,8 @@ msgid "Geonames Settings"
msgstr "Ajustes de Geonombres"
#: geonames.php:181
msgid "Enable Geonames Plugin"
msgstr "Habilitar Plugin de Geonombres"
msgid "Enable Geonames Addon"
msgstr "Habilitar Addon de Geonombres"
#: geonames.php:187
msgid "Submit"

View file

@ -7,5 +7,5 @@ function string_plural_select_es($n){
;
$a->strings["Geonames settings updated."] = "Ajustes de geonombres actualizados.";
$a->strings["Geonames Settings"] = "Ajustes de Geonombres";
$a->strings["Enable Geonames Plugin"] = "Habilitar Plugin de Geonombres";
$a->strings["Enable Geonames Addon"] = "Habilitar Addon de Geonombres";
$a->strings["Submit"] = "Enviar";

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "Réglages Geonames sauvés.";
$a->strings["Geonames Settings"] = "Réglages Geonames";
$a->strings["Enable Geonames Plugin"] = "Activer Geonames";
$a->strings["Enable Geonames Addon"] = "Activer Geonames";
$a->strings["Submit"] = "Envoyer";

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "";
$a->strings["Geonames Settings"] = "";
$a->strings["Enable Geonames Plugin"] = "";
$a->strings["Enable Geonames Addon"] = "";
$a->strings["Submit"] = "Senda inn";

View file

@ -4,13 +4,13 @@
#
#
# Translators:
# fabrixxm <fabrix.xm@gmail.com>, 2014-2015
# fabrixxm <fabrix.xm@gmail.com>, 2014-2015,2018
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"PO-Revision-Date: 2015-08-31 10:12+0000\n"
"PO-Revision-Date: 2018-03-19 13:22+0000\n"
"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
@ -28,8 +28,8 @@ msgid "Geonames Settings"
msgstr "Impostazioni Geonames"
#: geonames.php:181
msgid "Enable Geonames Plugin"
msgstr "Abilita plugin Geonames"
msgid "Enable Geonames Addon"
msgstr "Abilita componente aggiuntivo Geonames"
#: geonames.php:187
msgid "Submit"

View file

@ -7,5 +7,5 @@ function string_plural_select_it($n){
;
$a->strings["Geonames settings updated."] = "Impostazioni di Geonames aggiornate.";
$a->strings["Geonames Settings"] = "Impostazioni Geonames";
$a->strings["Enable Geonames Plugin"] = "Abilita plugin Geonames";
$a->strings["Enable Geonames Addon"] = "Abilita componente aggiuntivo Geonames";
$a->strings["Submit"] = "Invia";

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "";
$a->strings["Geonames Settings"] = "";
$a->strings["Enable Geonames Plugin"] = "";
$a->strings["Enable Geonames Addon"] = "";
$a->strings["Submit"] = "Lagre";

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "";
$a->strings["Geonames Settings"] = "ustawienia Geonames";
$a->strings["Enable Geonames Plugin"] = "";
$a->strings["Enable Geonames Addon"] = "";
$a->strings["Submit"] = "Potwierdź";

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "Configurações Geonames atualizadas.";
$a->strings["Geonames Settings"] = "Configurações Geonames";
$a->strings["Enable Geonames Plugin"] = "Plugin Geonames Habilitado";
$a->strings["Enable Geonames Addon"] = "Addon Geonames Habilitado";
$a->strings["Submit"] = "Enviar";

View file

@ -28,7 +28,7 @@ msgid "Geonames Settings"
msgstr "Configurări Geonume"
#: geonames.php:181
msgid "Enable Geonames Plugin"
msgid "Enable Geonames Addon"
msgstr "Permite Modul Geonume"
#: geonames.php:187

View file

@ -7,5 +7,5 @@ function string_plural_select_ro($n){
;
$a->strings["Geonames settings updated."] = "Configurări Geonume actualizate.";
$a->strings["Geonames Settings"] = "Configurări Geonume";
$a->strings["Enable Geonames Plugin"] = "Permite Modul Geonume";
$a->strings["Enable Geonames Addon"] = "Permite Modul Geonume";
$a->strings["Submit"] = "Trimite";

View file

@ -28,7 +28,7 @@ msgid "Geonames Settings"
msgstr "Настройки Geonames"
#: geonames.php:181
msgid "Enable Geonames Plugin"
msgid "Enable Geonames Addon"
msgstr "Включить плагин Geonames"
#: geonames.php:187

View file

@ -7,5 +7,5 @@ function string_plural_select_ru($n){
;
$a->strings["Geonames settings updated."] = "Настройки Geonames обновлены.";
$a->strings["Geonames Settings"] = "Настройки Geonames";
$a->strings["Enable Geonames Plugin"] = "Включить плагин Geonames";
$a->strings["Enable Geonames Addon"] = "Включить плагин Geonames";
$a->strings["Submit"] = "Добавить";

View file

@ -2,5 +2,5 @@
$a->strings["Geonames settings updated."] = "Geonames设置更新了。";
$a->strings["Geonames Settings"] = "Geonames设置";
$a->strings["Enable Geonames Plugin"] = "使Geonames插件能用";
$a->strings["Enable Geonames Addon"] = "使Geonames插件能用";
$a->strings["Submit"] = "提交";