X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=geonames%2Fgeonames.php;h=45d8fde5774c9a84c8e066e3ac2f5aebb4b55eab;hb=afaa39ed7bfc68536ba75ba81229a6f1700ff9b1;hp=71e05c8b617553b8905b124c05483eaf254d3a75;hpb=be1342fe5dee55f30f4c83d2da5cdc4f5bc46b16;p=friendica-addons.git diff --git a/geonames/geonames.php b/geonames/geonames.php index 71e05c8b..45d8fde5 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -12,14 +12,14 @@ * $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\PConfig; @@ -27,23 +27,23 @@ 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"); } @@ -59,9 +59,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"); @@ -76,7 +76,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 * */ @@ -137,7 +137,7 @@ 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; PConfig::set(local_user(),'geonames','enable',intval($_POST['geonames'])); @@ -148,14 +148,14 @@ function geonames_plugin_admin_post($a,$post) { /** * - * 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; @@ -180,7 +180,7 @@ function geonames_plugin_admin(&$a,&$s) { $s .= '
'; $s .= '

' . t('Geonames Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
';