mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-10 18:38:49 +00:00
Update function names
update function names and hook calls
This commit is contained in:
parent
0afd633346
commit
c71f7b0e1a
50 changed files with 356 additions and 348 deletions
|
@ -66,16 +66,17 @@ function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0)
|
|||
return $r;
|
||||
}
|
||||
|
||||
function curweather_install() {
|
||||
function curweather_install()
|
||||
{
|
||||
Addon::registerHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
|
||||
Addon::registerHook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
|
||||
Addon::registerHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
|
||||
Addon::registerHook('addon_settings', 'addon/curweather/curweather.php', 'curweather_addon_settings');
|
||||
Addon::registerHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post');
|
||||
}
|
||||
|
||||
function curweather_uninstall() {
|
||||
Addon::unregisterHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
|
||||
Addon::unregisterHook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
|
||||
Addon::unregisterHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
|
||||
Addon::unregisterHook('addon_settings', 'addon/curweather/curweather.php', 'curweather_addon_settings');
|
||||
Addon::unregisterHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post');
|
||||
}
|
||||
|
||||
function curweather_network_mod_init(&$fk_app,&$b) {
|
||||
|
@ -141,7 +142,7 @@ function curweather_network_mod_init(&$fk_app,&$b) {
|
|||
}
|
||||
|
||||
|
||||
function curweather_plugin_settings_post($a,$post) {
|
||||
function curweather_addon_settings_post($a,$post) {
|
||||
if(! local_user() || (! x($_POST,'curweather-settings-submit')))
|
||||
return;
|
||||
PConfig::set(local_user(),'curweather','curweather_loc',trim($_POST['curweather_loc']));
|
||||
|
@ -152,7 +153,7 @@ function curweather_plugin_settings_post($a,$post) {
|
|||
}
|
||||
|
||||
|
||||
function curweather_plugin_settings(&$a,&$s) {
|
||||
function curweather_addon_settings(&$a,&$s) {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
|
@ -186,7 +187,7 @@ function curweather_plugin_settings(&$a,&$s) {
|
|||
}
|
||||
// Config stuff for the admin panel to let the admin of the node set a APPID
|
||||
// for accessing the API of openweathermap
|
||||
function curweather_plugin_admin_post (&$a) {
|
||||
function curweather_addon_admin_post (&$a) {
|
||||
if(! is_site_admin())
|
||||
return;
|
||||
if ($_POST['curweather-submit']) {
|
||||
|
@ -195,7 +196,7 @@ function curweather_plugin_admin_post (&$a) {
|
|||
info( t('Curweather settings saved.'.EOL));
|
||||
}
|
||||
}
|
||||
function curweather_plugin_admin (&$a, &$o) {
|
||||
function curweather_addon_admin (&$a, &$o) {
|
||||
if(! is_site_admin())
|
||||
return;
|
||||
$appid = Config::get('curweather','appid');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue