Browse Source

Update function names

update function names and hook calls
pull/492/head
Adam Magness 4 years ago
parent
commit
c71f7b0e1a
50 changed files with 356 additions and 348 deletions
  1. +4
    -4
      blackout/blackout.php
  2. +9
    -17
      blockem/blockem.php
  3. +37
    -32
      blogger/blogger.php
  4. +14
    -12
      buffer/buffer.php
  5. +10
    -7
      communityhome/communityhome.php
  6. +10
    -9
      curweather/curweather.php
  7. +4
    -4
      dav/friendica/main.php
  8. +4
    -4
      fromapp/fromapp.php
  9. +14
    -12
      fromgplus/fromgplus.php
  10. +8
    -8
      geocoordinates/geocoordinates.php
  11. +12
    -12
      geonames/geonames.php
  12. +6
    -6
      gnot/gnot.php
  13. +5
    -5
      gravatar/gravatar.php
  14. +5
    -5
      group_text/group_text.php
  15. +5
    -5
      impressum/impressum.php
  16. +6
    -6
      irc/irc.php
  17. +7
    -7
      jappixmini/jappixmini.php
  18. +9
    -9
      krynn/krynn.php
  19. +4
    -4
      langfilter/langfilter.php
  20. +5
    -5
      libravatar/libravatar.php
  21. +9
    -9
      mailstream/mailstream.php
  22. +7
    -7
      mathjax/mathjax.php
  23. +18
    -9
      membersince/membersince.php
  24. +2
    -2
      newmemberwidget/newmemberwidget.php
  25. +1
    -1
      notifyall/notifyall.php
  26. +4
    -4
      notimeline/notimeline.php
  27. +5
    -5
      nsfw/nsfw.php
  28. +5
    -11
      numfriends/numfriends.php
  29. +2
    -2
      openstreetmap/openstreetmap.php
  30. +4
    -4
      pageheader/pageheader.php
  31. +7
    -7
      piwik/piwik.php
  32. +10
    -10
      planets/planets.php
  33. +4
    -4
      pledgie/pledgie.php
  34. +4
    -4
      public_server/public_server.php
  35. +5
    -5
      qcomment/qcomment.php
  36. +11
    -11
      randplace/randplace.php
  37. +6
    -6
      remote_permissions/remote_permissions.php
  38. +7
    -7
      securemail/securemail.php
  39. +4
    -4
      showmore/showmore.php
  40. +5
    -5
      startpage/startpage.php
  41. +4
    -4
      statusnet/statusnet.php
  42. +4
    -4
      superblock/superblock.php
  43. +3
    -3
      tumblr/tumblr.php
  44. +9
    -9
      twitter/twitter.php
  45. +2
    -2
      webrtc/webrtc.php
  46. +5
    -5
      widgets/widgets.php
  47. +15
    -15
      windowsphonepush/windowsphonepush.php
  48. +3
    -3
      wppost/wppost.php
  49. +8
    -8
      xmpp/xmpp.php
  50. +5
    -5
      yourls/yourls.php

+ 4
- 4
blackout/blackout.php View File

@ -9,12 +9,12 @@
* About
* =====
*
* This plugin will allow you to enter a date/time period during which
* This addon will allow you to enter a date/time period during which
* all your ~friendica visitors from the web will be redirected to a page
* you can configure in the admin panel as well.
*
* Calls to the API and the communication with other ~friendica nodes is
* not effected from this plugin.
* not effected from this addon.
*
* If you enter a period the current date would be affected none of the
* currently logged in users will be effected as well. But if they log
@ -88,7 +88,7 @@ function blackout_redirect ($a, $b) {
}
}
function blackout_plugin_admin(&$a, &$o) {
function blackout_addon_admin(&$a, &$o) {
$mystart = Config::get('blackout','begindate');
if (! is_string($mystart)) { $mystart = "YYYY-MM-DD:hhmm"; }
$myend = Config::get('blackout','enddate');
@ -112,7 +112,7 @@ function blackout_plugin_admin(&$a, &$o) {
$o = '<p>Please double check that the current settings for the blackout. Begin will be <strong>'.$mystart.'</strong> and it will end <strong>'.$myend.'</strong>.</p>' . $o;
}
}
function blackout_plugin_admin_post (&$a) {
function blackout_addon_admin_post (&$a) {
$begindate = trim($_POST['startdate']);
$enddate = trim($_POST['enddate']);
$url = trim($_POST['rurl']);


+ 9
- 17
blockem/blockem.php View File

@ -12,30 +12,25 @@ use Friendica\Core\PConfig;
function blockem_install() {
Addon::registerHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
Addon::registerHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
Addon::registerHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
Addon::registerHook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
Addon::registerHook('addon_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
Addon::registerHook('addon_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
Addon::registerHook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start');
Addon::registerHook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
Addon::registerHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' );
Addon::registerHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store');
}
function blockem_uninstall() {
Addon::unregisterHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
Addon::unregisterHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
Addon::unregisterHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
Addon::unregisterHook('addon_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
Addon::unregisterHook('addon_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
Addon::unregisterHook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start');
Addon::unregisterHook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
Addon::unregisterHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' );
Addon::unregisterHook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store');
}
function blockem_addon_settings(&$a,&$s) {
function blockem_addon_settings(&$a, &$s)
{
if(! local_user())
return;
@ -45,7 +40,7 @@ function blockem_addon_settings(&$a,&$s) {
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n";
$words = PConfig::get(local_user(),'blockem','words');
$words = PConfig::get(local_user(), 'blockem', 'words');
if(! $words)
$words = '';
@ -79,7 +74,6 @@ function blockem_addon_settings_post(&$a,&$b) {
}
}
function blockem_enotify_store(&$a,&$b) {
$words = PConfig::get($b['uid'],'blockem','words');
@ -143,13 +137,11 @@ function blockem_prepare_body(&$a,&$b) {
}
}
function blockem_display_item(&$a,&$b) {
if(strstr($b['output']['body'],'id="blockem-wrap-'))
$b['output']['thumb'] = $a->get_baseurl() . "/images/person-80.jpg";
}
function blockem_conversation_start(&$a,&$b) {
if(! local_user())


+ 37
- 32
blogger/blogger.php View File

@ -8,7 +8,8 @@
use Friendica\Core\Addon;
use Friendica\Core\PConfig;
function blogger_install() {
function blogger_install()
{
Addon::registerHook('post_local', 'addon/blogger/blogger.php', 'blogger_post_local');
Addon::registerHook('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send');
Addon::registerHook('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets');
@ -16,7 +17,8 @@ function blogger_install() {
Addon::registerHook('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
}
function blogger_uninstall() {
function blogger_uninstall()
{
Addon::unregisterHook('post_local', 'addon/blogger/blogger.php', 'blogger_post_local');
Addon::unregisterHook('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send');
Addon::unregisterHook('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets');
@ -25,28 +27,29 @@ function blogger_uninstall() {
// obsolete - remove
Addon::unregisterHook('post_local_end', 'addon/blogger/blogger.php', 'blogger_send');
Addon::unregisterHook('plugin_settings', 'addon/blogger/blogger.php', 'blogger_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
Addon::unregisterHook('addon_settings', 'addon/blogger/blogger.php', 'blogger_settings');
Addon::unregisterHook('addon_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
}
function blogger_jot_nets(&$a,&$b) {
function blogger_jot_nets(&$a, &$b)
{
if (!local_user()) {
return;
}
$bl_post = PConfig::get(local_user(),'blogger','post');
$bl_post = PConfig::get(local_user(), 'blogger', 'post');
if (intval($bl_post) == 1) {
$bl_defpost = PConfig::get(local_user(),'blogger','post_by_default');
$bl_defpost = PConfig::get(local_user(), 'blogger', 'post_by_default');
$selected = ((intval($bl_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '<div class="profile-jot-net"><input type="checkbox" name="blogger_enable" ' . $selected . ' value="1" /> '
. t('Post to blogger') . '</div>';
. t('Post to blogger') . '</div>';
}
}
function blogger_settings(&$a,&$s) {
function blogger_settings(&$a, &$s)
{
if (! local_user()) {
return;
}
@ -57,11 +60,11 @@ function blogger_settings(&$a,&$s) {
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(),'blogger','post');
$enabled = PConfig::get(local_user(), 'blogger', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
$def_enabled = PConfig::get(local_user(),'blogger','post_by_default');
$def_enabled = PConfig::get(local_user(), 'blogger', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
@ -79,7 +82,7 @@ function blogger_settings(&$a,&$s) {
$s .= '</span>';
$s .= '<div id="blogger-enable-wrapper">';
$s .= '<label id="blogger-enable-label" for="blogger-checkbox">' . t('Enable Blogger Post Plugin') . '</label>';
$s .= '<label id="blogger-enable-label" for="blogger-checkbox">' . t('Enable Blogger Post Addon') . '</label>';
$s .= '<input id="blogger-checkbox" type="checkbox" name="blogger" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
@ -108,17 +111,19 @@ function blogger_settings(&$a,&$s) {
}
function blogger_settings_post(&$a,&$b) {
if (x($_POST,'blogger-submit')) {
PConfig::set(local_user(),'blogger','post',intval($_POST['blogger']));
PConfig::set(local_user(),'blogger','post_by_default',intval($_POST['bl_bydefault']));
PConfig::set(local_user(),'blogger','bl_username',trim($_POST['bl_username']));
PConfig::set(local_user(),'blogger','bl_password',trim($_POST['bl_password']));
PConfig::set(local_user(),'blogger','bl_blog',trim($_POST['bl_blog']));
function blogger_settings_post(&$a, &$b)
{
if (x($_POST, 'blogger-submit')) {
PConfig::set(local_user(), 'blogger', 'post', intval($_POST['blogger']));
PConfig::set(local_user(), 'blogger', 'post_by_default', intval($_POST['bl_bydefault']));
PConfig::set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username']));
PConfig::set(local_user(), 'blogger', 'bl_password', trim($_POST['bl_password']));
PConfig::set(local_user(), 'blogger', 'bl_blog', trim($_POST['bl_blog']));
}
}
function blogger_post_local(&$a,&$b) {
function blogger_post_local(&$a, &$b)
{
// This can probably be changed to allow editing by pointing to a different API endpoint
if ($b['edit']) {
@ -133,11 +138,11 @@ function blogger_post_local(&$a,&$b) {
return;
}
$bl_post = intval(PConfig::get(local_user(),'blogger','post'));
$bl_post = intval(PConfig::get(local_user(), 'blogger', 'post'));
$bl_enable = (($bl_post && x($_REQUEST,'blogger_enable')) ? intval($_REQUEST['blogger_enable']) : 0);
$bl_enable = (($bl_post && x($_REQUEST, 'blogger_enable')) ? intval($_REQUEST['blogger_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'blogger','post_by_default'))) {
if ($b['api_source'] && intval(PConfig::get(local_user(), 'blogger', 'post_by_default'))) {
$bl_enable = 1;
}
@ -155,12 +160,13 @@ function blogger_post_local(&$a,&$b) {
function blogger_send(&$a,&$b) {
function blogger_send(&$a, &$b)
{
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
return;
}
if (! strstr($b['postopts'],'blogger')) {
if (! strstr($b['postopts'], 'blogger')) {
return;
}
@ -168,12 +174,11 @@ function blogger_send(&$a,&$b) {
return;
}
$bl_username = xmlify(PConfig::get($b['uid'],'blogger','bl_username'));
$bl_password = xmlify(PConfig::get($b['uid'],'blogger','bl_password'));
$bl_blog = PConfig::get($b['uid'],'blogger','bl_blog');
$bl_username = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_username'));
$bl_password = xmlify(PConfig::get($b['uid'], 'blogger', 'bl_password'));
$bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog');
if ($bl_username && $bl_password && $bl_blog) {
require_once('include/bbcode.php');
$title = '<title>' . (($b['title']) ? $b['title'] : t('Post from Friendica')) . '</title>';
@ -199,9 +204,9 @@ EOT;
logger('blogger: data: ' . $xml, LOGGER_DATA);
if ($bl_blog !== 'test') {
$x = post_url($bl_blog,$xml);
$x = post_url($bl_blog, $xml);
}
logger('posted to blogger: ' . (($x) ? $x : ''), LOGGER_DEBUG);
}
}
}

+ 14
- 12
buffer/buffer.php View File

@ -55,22 +55,24 @@ function buffer_content(&$a) {
return $o;
}
function buffer_plugin_admin(&$a, &$o){
$t = get_markup_template( "admin.tpl", "addon/buffer/" );
function buffer_addon_admin(&$a, &$o)
{
$t = get_markup_template("admin.tpl", "addon/buffer/");
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
// name, label, value, help, [extra values]
'$client_id' => ['client_id', t('Client ID'), Config::get('buffer', 'client_id' ), ''],
'$client_secret' => ['client_secret', t('Client Secret'), Config::get('buffer', 'client_secret' ), ''],
// name, label, value, help, [extra values]
'$client_id' => ['client_id', t('Client ID'), Config::get('buffer', 'client_id'), ''],
'$client_secret' => ['client_secret', t('Client Secret'), Config::get('buffer', 'client_secret'), ''],
]);
}
function buffer_plugin_admin_post(&$a){
$client_id = ((x($_POST,'client_id')) ? notags(trim($_POST['client_id'])) : '');
$client_secret = ((x($_POST,'client_secret')) ? notags(trim($_POST['client_secret'])): '');
Config::set('buffer','client_id',$client_id);
Config::set('buffer','client_secret',$client_secret);
info( t('Settings updated.'). EOL );
function buffer_addon_admin_post(&$a)
{
$client_id = ((x($_POST, 'client_id')) ? notags(trim($_POST['client_id'])) : '');
$client_secret = ((x($_POST, 'client_secret')) ? notags(trim($_POST['client_secret'])): '');
Config::set('buffer', 'client_id', $client_id);
Config::set('buffer', 'client_secret', $client_secret);
info(t('Settings updated.'). EOL);
}
function buffer_connect(&$a) {
@ -155,7 +157,7 @@ function buffer_settings(&$a,&$s) {
$s .= '</div><div class="clear"></div>';
} else {
$s .= '<div id="buffer-enable-wrapper">';
$s .= '<label id="buffer-enable-label" for="buffer-checkbox">' . t('Enable Buffer Post Plugin') . '</label>';
$s .= '<label id="buffer-enable-label" for="buffer-checkbox">' . t('Enable Buffer Post Addon') . '</label>';
$s .= '<input id="buffer-checkbox" type="checkbox" name="buffer" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';


+ 10
- 7
communityhome/communityhome.php View File

@ -33,25 +33,28 @@ function communityhome_getopts() {
];
}
function communityhome_plugin_admin(&$a, &$o) {
$tpl = get_markup_template( 'settings.tpl', 'addon/communityhome/' );
function communityhome_addon_admin(&$a, &$o)
{
$tpl = get_markup_template('settings.tpl', 'addon/communityhome/');
$opts = communityhome_getopts();
$ctx = [
'$submit' => t("Submit"),
'$fields' => [],
];
foreach($opts as $k=>$v) {
foreach ($opts as $k => $v) {
$ctx['fields'][] = ['communityhome_'.$k, $v, Config::get('communityhome', $k)];
}
$o = replace_macros($tpl, $ctx);
}
function communityhome_plugin_admin_post(&$a,&$b) {
if(x($_POST,'communityhome-submit')) {
function communityhome_addon_admin_post(&$a, &$b)
{
if (x($_POST, 'communityhome-submit')) {
$opts = communityhome_getopts();
foreach($opts as $k=>$v) {
Config::set('communityhome', $k, x($_POST,'communityhome_'.$k));
foreach ($opts as $k => $v) {
Config::set('communityhome', $k, x($_POST, 'communityhome_'.$k));
}
}
}


+ 10
- 9
curweather/curweather.php View File

@ -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');


+ 4
- 4
dav/friendica/main.php View File

@ -203,7 +203,7 @@ function dav_content()
}
}
} catch (DAVVersionMismatchException $e) {
$x = t("The current version of this plugin has not been set up correctly. Please contact the system administrator of your installation of friendica to fix this.");
$x = t("The current version of this addon has not been set up correctly. Please contact the system administrator of your installation of friendica to fix this.");
}
return $x;
}
@ -302,9 +302,9 @@ function dav_cron(&$a, &$b)
* @param App $a
* @param null|object $o
*/
function dav_plugin_admin_post(&$a = null, &$o = null)
function dav_addon_admin_post(&$a = null, &$o = null)
{
check_form_security_token_redirectOnErr('/admin/plugins/dav', 'dav_admin_save');
check_form_security_token_redirectOnErr('/admin/addons/dav', 'dav_admin_save');
dav_include_files();
require_once(__DIR__ . "/database-init.inc.php");
@ -327,7 +327,7 @@ function dav_plugin_admin_post(&$a = null, &$o = null)
* @param App $a
* @param string $o
*/
function dav_plugin_admin(&$a, &$o)
function dav_addon_admin(&$a, &$o)
{
dav_include_files();
require_once(__DIR__ . "/database-init.inc.php");


+ 4
- 4
fromapp/fromapp.php View File

@ -12,8 +12,8 @@ use Friendica\Core\PConfig;
function fromapp_install() {
Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
Addon::registerHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
Addon::registerHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
Addon::registerHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
Addon::registerHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
logger("installed fromapp");
}
@ -22,8 +22,8 @@ function fromapp_install() {
function fromapp_uninstall() {
Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
Addon::unregisterHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
Addon::unregisterHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
Addon::unregisterHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
logger("removed fromapp");


+ 14
- 12
fromgplus/fromgplus.php View File

@ -30,8 +30,8 @@ function fromgplus_uninstall() {
Addon::unregisterHook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron');
// Old hooks
Addon::unregisterHook('plugin_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
Addon::unregisterHook('addon_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
Addon::unregisterHook('addon_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
}
function fromgplus_addon_settings(&$a,&$s) {
@ -94,19 +94,21 @@ function fromgplus_addon_settings_post(&$a,&$b) {
}
}
function fromgplus_plugin_admin(&$a, &$o){
$t = get_markup_template("admin.tpl", "addon/fromgplus/");
function fromgplus_addon_admin(&$a, &$o)
{
$t = get_markup_template("admin.tpl", "addon/fromgplus/");
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
'$key' => ['key', t('Key'), trim(Config::get('fromgplus', 'key')), t('')],
]);
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
'$key' => ['key', t('Key'), trim(Config::get('fromgplus', 'key')), t('')],
]);
}
function fromgplus_plugin_admin_post(&$a){
$key = ((x($_POST,'key')) ? trim($_POST['key']) : '');
Config::set('fromgplus','key',$key);
info( t('Settings updated.'). EOL );
function fromgplus_addon_admin_post(&$a)
{
$key = ((x($_POST, 'key')) ? trim($_POST['key']) : '');
Config::set('fromgplus', 'key', $key);
info(t('Settings updated.'). EOL);
}
function fromgplus_cron($a,$b) {


+ 8
- 8
geocoordinates/geocoordinates.php View File

@ -81,24 +81,24 @@ function geocoordinates_post_hook($a, &$item)
geocoordinates_resolve_item($item);
}
function geocoordinates_plugin_admin(&$a, &$o)
function geocoordinates_addon_admin(&$a, &$o)
{
$t = get_markup_template("admin.tpl", "addon/geocoordinates/");
$o = replace_macros($t, [
'$submit' => t('Save Settings'),
'$api_key' => ['api_key', t('API Key'), Config::get('geocoordinates', 'api_key' ), ''],
'$language' => ['language', t('Language code (IETF format)'), Config::get('geocoordinates', 'language' ), ''],
'$api_key' => ['api_key', t('API Key'), Config::get('geocoordinates', 'api_key'), ''],
'$language' => ['language', t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''],
]);
}
function geocoordinates_plugin_admin_post(&$a)
function geocoordinates_addon_admin_post(&$a)
{
$api_key = ((x($_POST,'api_key')) ? notags(trim($_POST['api_key'])) : '');
Config::set('geocoordinates','api_key',$api_key);
$api_key = ((x($_POST, 'api_key')) ? notags(trim($_POST['api_key'])) : '');
Config::set('geocoordinates', 'api_key', $api_key);
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
Config::set('geocoordinates','language',$language);
$language = ((x($_POST, 'language')) ? notags(trim($_POST['language'])) : '');
Config::set('geocoordinates', 'language', $language);
info(t('Settings updated.'). EOL);
}

+ 12
- 12
geonames/geonames.php View File

@ -12,7 +12,7 @@
* $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
@ -27,7 +27,7 @@ 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.
*
*/
@ -36,14 +36,14 @@ function geonames_install() {
/**
*
* 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.
*
*/
Addon::registerHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
Addon::registerHook('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");
}
@ -60,8 +60,8 @@ function geonames_uninstall() {
*/
Addon::unregisterHook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
Addon::unregisterHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
Addon::unregisterHook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
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 .= '<div class="settings-block">';
$s .= '<h3>' . 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">' . t('Enable Geonames Addon') . '</label>';
$s .= '<input id="geonames-checkbox" type="checkbox" name="geonames" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';


+ 6
- 6
gnot/gnot.php View File

@ -12,8 +12,8 @@ use Friendica\Core\PConfig;
function gnot_install() {
Addon::registerHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
Addon::registerHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Addon::registerHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings');
Addon::registerHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Addon::registerHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
logger("installed gnot");
@ -22,8 +22,8 @@ function gnot_install() {
function gnot_uninstall() {
Addon::unregisterHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Addon::unregisterHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings');
Addon::unregisterHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
@ -52,7 +52,7 @@ function gnot_settings_post($a,$post) {
/**
*
* Called from the Plugin Setting form.
* Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/
@ -80,7 +80,7 @@ function gnot_settings(&$a,&$s) {
$s .= '<h3>' . t('Gnot Settings') . '</h3>';
$s .= '<div id="gnot-wrapper">';
$s .= '<div id="gnot-desc">' . t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") . '</div>';
$s .= '<label id="gnot-label" for="gnot">' . t('Enable this plugin/addon?') . '</label>';
$s .= '<label id="gnot-label" for="gnot">' . t('Enable this addon?') . '</label>';
$s .= '<input id="gnot-input" type="checkbox" name="gnot" value="1"'. $gnot_checked . '/>';
$s .= '</div><div class="clear"></div>';


+ 5
- 5
gravatar/gravatar.php View File

@ -1,7 +1,7 @@
<?php
/**
* Name: Gravatar Support
* Description: If there is no avatar image for a new user or contact this plugin will look for one at Gravatar.
* Description: If there is no avatar image for a new user or contact this addon will look for one at Gravatar.
* Version: 1.1
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
*/
@ -9,7 +9,7 @@ use Friendica\Core\Addon;
use Friendica\Core\Config;
/**
* Installs the plugin hook
* Installs the addon hook
*/
function gravatar_install() {
Addon::registerHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
@ -18,7 +18,7 @@ function gravatar_install() {
}
/**
* Removes the plugin hook
* Removes the addon hook
*/
function gravatar_uninstall() {
Addon::unregisterHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
@ -56,7 +56,7 @@ function gravatar_lookup($a, &$b) {
/**
* Display admin settings for this addon
*/
function gravatar_plugin_admin (&$a, &$o) {
function gravatar_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/gravatar/" );
$default_avatar = Config::get('gravatar', 'default_img');
@ -103,7 +103,7 @@ function gravatar_plugin_admin (&$a, &$o) {
/**
* Save admin settings
*/
function gravatar_plugin_admin_post (&$a) {
function gravatar_addon_admin_post (&$a) {
check_form_security_token('gravatarsave');
$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon');


+ 5
- 5
group_text/group_text.php View File

@ -10,8 +10,8 @@ use Friendica\Core\PConfig;
function group_text_install() {
Addon::registerHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
Addon::registerHook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
Addon::registerHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings');
Addon::registerHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
logger("installed group_text");
}
@ -19,8 +19,8 @@ function group_text_install() {
function group_text_uninstall() {
Addon::unregisterHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
Addon::unregisterHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings');
Addon::unregisterHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
logger("removed group_text");
@ -48,7 +48,7 @@ function group_text_settings_post($a,$post) {
/**
*
* Called from the Plugin Setting form.
* Called from the Addon Setting form.
* Add our own settings info to the page.
*
*/


+ 5
- 5
impressum/impressum.php View File

@ -1,7 +1,7 @@
<?php
/**
* Name: Impressum
* Description: Plugin to add contact information to the about page (/friendica)
* Description: Addon to add contact information to the about page (/friendica)
* Version: 1.3
* Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
* License: 3-clause BSD license
@ -16,13 +16,13 @@ use Friendica\Core\Config;
function impressum_install() {
Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
Addon::registerHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
logger("installed impressum plugin");
logger("installed impressum Addon");
}
function impressum_uninstall() {
Addon::unregisterHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
Addon::unregisterHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
logger("uninstalled impressum plugin");
logger("uninstalled impressum Addon");
}
function impressum_module() {
@ -74,7 +74,7 @@ function impressum_show($a,&$b) {
}
}
function impressum_plugin_admin_post (&$a) {
function impressum_addon_admin_post (&$a) {
$owner = ((x($_POST, 'owner')) ? notags(trim($_POST['owner'])) : '');
$ownerprofile = ((x($_POST, 'ownerprofile')) ? notags(trim($_POST['ownerprofile'])) : '');
$postal = ((x($_POST, 'postal')) ? (trim($_POST['postal'])) : '');
@ -89,7 +89,7 @@ function impressum_plugin_admin_post (&$a) {
Config::set('impressum','footer_text',strip_tags($footer_text));
info( t('Settings updated.'). EOL );
}
function impressum_plugin_admin (&$a, &$o) {
function impressum_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/impressum/" );
$o = replace_macros($t, [
'$submit' => t('Save Settings'),


+ 6
- 6
irc/irc.php View File

@ -1,6 +1,6 @@
<?php
/**
* Name: IRC Chat Plugin
* Name: IRC Chat Addon
* Description: add an Internet Relay Chat chatroom on freenode
* Version: 1.1
* Author: tony baldwin <https://free-haven.org/profile/tony>
@ -12,13 +12,13 @@ use Friendica\Core\PConfig;
function irc_install() {
Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
Addon::registerHook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
Addon::registerHook('plugin_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
Addon::registerHook('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings');
Addon::registerHook('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
}
function irc_uninstall() {
Addon::unregisterHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
Addon::unregisterHook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
Addon::unregisterHook('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings');
}
@ -120,7 +120,7 @@ return $o;
}
function irc_plugin_admin_post (&$a) {
function irc_addon_admin_post (&$a) {
if(! is_site_admin())
return;
@ -131,7 +131,7 @@ function irc_plugin_admin_post (&$a) {
info( t('IRC settings saved.') . EOL);
}
}
function irc_plugin_admin (&$a, &$o) {
function irc_addon_admin (&$a, &$o) {
$sitechats = Config::get('irc','sitechats'); /* popular channels */
$autochans = Config::get('irc','autochans'); /* auto connect chans */
$t = get_markup_template( "admin.tpl", "addon/irc/" );


+ 7
- 7
jappixmini/jappixmini.php View File

@ -70,8 +70,8 @@ use Friendica\Model\User;
function jappixmini_install()
{
Addon::registerHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
Addon::registerHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
Addon::registerHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
Addon::registerHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
Addon::registerHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
Addon::registerHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
@ -104,8 +104,8 @@ function jappixmini_install()
function jappixmini_uninstall()
{
Addon::unregisterHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
Addon::unregisterHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
Addon::unregisterHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
@ -115,7 +115,7 @@ function jappixmini_uninstall()
Addon::unregisterHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
}
function jappixmini_plugin_admin(App $a, &$o)
function jappixmini_addon_admin(App $a, &$o)
{
// display instructions and warnings on addon settings page for admin
if (!file_exists("addon/jappixmini.tgz")) {
@ -159,7 +159,7 @@ function jappixmini_plugin_admin(App $a, &$o)
$o .= '<input type="submit" name="jappixmini-admin-settings" value="OK" />';
}
function jappixmini_plugin_admin_post(App $a)
function jappixmini_addon_admin_post(App $a)
{
// set info text
$submit = $_REQUEST['jappixmini-admin-settings'];
@ -230,7 +230,7 @@ function jappixmini_init()
}
// do not return an address if user deactivated plugin
// do not return an address if user deactivated addon
$activated = PConfig::get($uid, 'jappixmini', 'activate');
if (!$activated) {
killme();


+ 9
- 9
krynn/krynn.php View File

@ -16,7 +16,7 @@ function krynn_install() {
/**
*
* Our demo plugin will attach in three places.
* Our demo addon will attach in three places.
* The first is just prior to storing a local post.
*
*/
@ -25,14 +25,14 @@ function krynn_install() {
/**
*
* 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.
*
*/
Addon::registerHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
Addon::registerHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
Addon::registerHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
Addon::registerHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
logger("installed krynn");
}
@ -49,8 +49,8 @@ function krynn_uninstall() {
*/
Addon::unregisterHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
Addon::unregisterHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
Addon::unregisterHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings');
Addon::unregisterHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
logger("removed krynn");
@ -65,7 +65,7 @@ function krynn_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
*
*/
@ -126,7 +126,7 @@ function krynn_settings_post($a,$post) {
/**
*
* Called from the Plugin Setting form.
* Called from the addon Setting form.
* Add our own settings info to the page.
*
*/
@ -162,7 +162,7 @@ function krynn_settings(&$a,&$s) {
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Krynn Settings') . '</h3>';
$s .= '<div id="krynn-enable-wrapper">';
$s .= '<label id="krynn-enable-label" for="krynn-checkbox">' . t('Enable Krynn Plugin') . '</label>';
$s .= '<label id="krynn-enable-label" for="krynn-checkbox">' . t('Enable Krynn Addon') . '</label>';
$s .= '<input id="krynn-checkbox" type="checkbox" name="krynn" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div></div>';
/* provide a submit button */


+ 4
- 4
langfilter/langfilter.php View File

@ -20,15 +20,15 @@ use Friendica\Core\PConfig;
function langfilter_install()
{
Addon::registerHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body', 10);
Addon::registerHook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
Addon::registerHook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
Addon::registerHook('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
Addon::registerHook('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
}
function langfilter_uninstall()
{
Addon::unregisterHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body');
Addon::unregisterHook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
Addon::unregisterHook('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
Addon::unregisterHook('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
}
/* The settings


+ 5
- 5
libravatar/libravatar.php View File

@ -1,7 +1,7 @@
<?php
/**
* Name: Libravatar Support
* Description: If there is no avatar image for a new user or contact this plugin will look for one at Libravatar. Please disable Gravatar addon if you use this one. (requires PHP >= 5.3)
* Description: If there is no avatar image for a new user or contact this addon will look for one at Libravatar. Please disable Gravatar addon if you use this one. (requires PHP >= 5.3)
* Version: 1.1
* Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
*/
@ -9,7 +9,7 @@ use Friendica\Core\Addon;
use Friendica\Core\Config;
/**
* Installs the plugin hook
* Installs the addon hook
*/
function libravatar_install() {
if (! version_compare(PHP_VERSION, '5.3.0', '>=')) {
@ -23,7 +23,7 @@ function libravatar_install() {
}
/**
* Removes the plugin hook
* Removes the addon hook
*/
function libravatar_uninstall() {
Addon::unregisterHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
@ -61,7 +61,7 @@ function libravatar_lookup($a, &$b) {
/**
* Display admin settings for this addon
*/
function libravatar_plugin_admin (&$a, &$o) {
function libravatar_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/libravatar" );
$default_avatar = Config::get('libravatar', 'default_img');
@ -106,7 +106,7 @@ function libravatar_plugin_admin (&$a, &$o) {
/**
* Save admin settings
*/
function libravatar_plugin_admin_post (&$a) {
function libravatar_addon_admin_post (&$a) {
check_form_security_token('libravatarrsave');
$default_avatar = ((x($_POST, 'avatar')) ? notags(trim($_POST['avatar'])) : 'identicon');


+ 9
- 9
mailstream/mailstream.php View File

@ -11,8 +11,8 @@ use Friendica\Core\PConfig;
use Friendica\Database\DBM;
function mailstream_install() {
Addon::registerHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
Addon::registerHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post');
Addon::registerHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings');
Addon::registerHook('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post');
Addon::registerHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Addon::registerHook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Addon::registerHook('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron');
@ -52,8 +52,8 @@ function mailstream_install() {
}
function mailstream_uninstall() {
Addon::unregisterHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post');
Addon::unregisterHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings');
Addon::unregisterHook('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post');
Addon::unregisterHook('post_local', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook');
Addon::unregisterHook('post_remote', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook');
Addon::unregisterHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook');
@ -66,7 +66,7 @@ function mailstream_uninstall() {
function mailstream_module() {}
function mailstream_plugin_admin(&$a,&$o) {
function mailstream_addon_admin(&$a,&$o) {
$frommail = Config::get('mailstream', 'frommail');
$template = get_markup_template('admin.tpl', 'addon/mailstream/');
$config = ['frommail',
@ -78,7 +78,7 @@ function mailstream_plugin_admin(&$a,&$o) {
'$submit' => t('Save Settings')]);
}
function mailstream_plugin_admin_post ($a) {
function mailstream_addon_admin_post ($a) {
if (x($_POST, 'frommail')) {
Config::set('mailstream', 'frommail', $_POST['frommail']);
}
@ -266,7 +266,7 @@ function mailstream_send($a, $message_id, $item, $user) {
}
$mail = new PHPmailer;
try {
$mail->XMailer = 'Friendica Mailstream Plugin';
$mail->XMailer = 'Friendica Mailstream Addon';
$mail->SetFrom($frommail, mailstream_sender($item));
$mail->AddAddress($address, $user['username']);
$mail->MessageID = $message_id;
@ -346,7 +346,7 @@ function mailstream_cron($a, $b) {
mailstream_tidy();
}
function mailstream_plugin_settings(&$a,&$s) {
function mailstream_addon_settings(&$a,&$s) {
$enabled = PConfig::get(local_user(), 'mailstream', 'enabled');
$address = PConfig::get(local_user(), 'mailstream', 'address');
$nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes');
@ -376,7 +376,7 @@ function mailstream_plugin_settings(&$a,&$s) {
'$submit' => t('Save Settings')]);
}
function mailstream_plugin_settings_post($a,$post) {
function mailstream_addon_settings_post($a,$post) {
if ($_POST['mailstream_address'] != "") {
PConfig::set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']);
}


+ 7
- 7
mathjax/mathjax.php View File

@ -13,14 +13,14 @@ use Friendica\Core\PConfig;
function mathjax_install() {
Addon::registerHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
Addon::registerHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
Addon::registerHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
logger('installed js_math plugin');
Addon::registerHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
Addon::registerHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
logger('installed js_math addon');
}
function mathjax_uninstall() {
Addon::unregisterHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
Addon::unregisterHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
Addon::unregisterHook('addon_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
Addon::unregisterHook('addon_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
}
function mathjax_settings_post ($a, $post) {
if (! local_user())
@ -68,12 +68,12 @@ function mathjax_page_header($a, &$b) {
}
}
}
function mathjax_plugin_admin_post (&$a) {
function mathjax_addon_admin_post (&$a) {
$baseurl = ((x($_POST, 'baseurl')) ? trim($_POST['baseurl']) : 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML');
Config::set('mathjax','baseurl',$baseurl);
info( t('Settings updated.'). EOL);
}
function mathjax_plugin_admin (&$a, &$o) {
function mathjax_addon_admin (&$a, &$o) {
$t = get_markup_template( "admin.tpl", "addon/mathjax/" );
if (Config::get('mathjax','baseurl','') == '') {
Config::set('mathjax','baseurl','http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML');


+ 18
- 9
membersince/membersince.php View File

@ -1,21 +1,30 @@
<?php
/**
* Name: MemberSince
* Description: Display membership date in profile
* Version: 1.0
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*
*
*/
use Friendica\Core\Addon;
require_once('include/datetime.php');
require_once 'include/datetime.php';
function membersince_install()
{
Addon::registerHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
}
function membersince_install(){ Addon::registerHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
function membersince_uninstall()
{
Addon::unregisterHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
}
function membersince_uninstall(){ Addon::unregisterHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
function membersince_display(&$a, &$b)
{
// Works in Vier
$b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . t('Member since:') . "</dt>\n<dd>" . datetime_convert('UTC', date_default_timezone_get(), $a->profile['register_date']) . "</dd>\n</dl>", $b, 1);
function membersince_display(&$a,&$b) {
$b = preg_replace('/<\/dl>/',"</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . t('Member since:') . "</dt>\n<dd>" . datetime_convert('UTC',date_default_timezone_get(),$a->profile['register_date']) . "</dd>\n</dl>" ,$b, 1);
//$b = str_replace('</div>' . "\n" . '<div id="advanced-profile-name-end"></div>',sprintf( t(' - Member since: %s') . EOL, datetime_convert('UTC',date_default_timezone_get(),$a->profile['register_date'])) . '</div>' . "\n" . '<div id="advanced-profile-name-end"></div>',$b);
}
// Trying for Frio
//$b = preg_replace('/<\/div>/', "<div id=\"aprofile-membersince\" class=\"aprofile\"><hr class=\"profile-separator\"><div class=\"profile-label-name\">" . t('Member since:') . "</div><div class=\"profile-entry\">" . datetime_convert('UTC', date_default_timezone_get(), $a->profile['register_date']) . "</div></div>", $b, 1);
}

+ 2
- 2
newmemberwidget/newmemberwidget.php View File

@ -37,7 +37,7 @@ function newmemberwidget_network_mod_init ( $a, $b) {
}
}
function newmemberwidget_plugin_admin_post( &$a ) {
function newmemberwidget_addon_admin_post( &$a ) {
$ft = ((x($_POST, 'freetext')) ? trim($_POST['freetext']) : "");
$lsn = ((x($_POST, 'localsupportname')) ? notags(trim($_POST['localsupportname'])) : "");
$gs = intval($_POST['linkglobalsupport']);
@ -48,7 +48,7 @@ function newmemberwidget_plugin_admin_post( &$a ) {
Config::set ( 'newmemberwidget', 'localsupport', trim($lsn));
}
function newmemberwidget_plugin_admin(&$a, &$o){
function newmemberwidget_addon_admin(&$a, &$o){
$t = get_markup_template('admin.tpl','addon/newmemberwidget');
$o = replace_macros($t, [
'$submit' => t('Save Settings'),


+ 1
- 1
notifyall/notifyall.php View File

@ -21,7 +21,7 @@ function notifyall_uninstall() {
function notifyall_module() {}
function notifyall_plugin_admin(&$a, &$o) {
function notifyall_addon_admin(&$a, &$o) {
$o = '<div></div>&nbsp;&nbsp;&nbsp;&nbsp;<a href="' . z_root() . '/notifyall">' . t('Send email to all members') . '</a></br/>';


+ 4
- 4
notimeline/notimeline.php View File

@ -12,15 +12,15 @@ use Friendica\Core\PConfig;
function notimeline_install() {
Addon::registerHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
Addon::registerHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
Addon::registerHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
Addon::registerHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
}
function notimeline_uninstall() {
Addon::unregisterHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
Addon::unregisterHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
Addon::unregisterHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
}


+ 5
- 5
nsfw/nsfw.php View File

@ -11,16 +11,16 @@ use Friendica\Core\PConfig;
function nsfw_install() {
Addon::registerHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body', 10);
Addon::registerHook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
Addon::registerHook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
Addon::registerHook('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
Addon::registerHook('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
}
function nsfw_uninstall() {
Addon::unregisterHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body');
Addon::unregisterHook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
Addon::unregisterHook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
Addon::unregisterHook('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
Addon::unregisterHook('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');