From 905823ea63bee55129a8d2337ca5a812b09eeda9 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 29 Dec 2019 21:55:10 -0500 Subject: [PATCH] Update obsolete App::getBaseUrl calls to DI::baseUrl --- fromapp/fromapp.php | 3 +- gnot/gnot.php | 3 +- group_text/group_text.php | 3 +- ijpost/ijpost.php | 3 +- impressum/impressum.php | 2 +- .../infiniteimprobabilitydrive.php | 7 +- irc/irc.php | 5 +- krynn/krynn.php | 3 +- libertree/libertree.php | 5 +- ljpost/ljpost.php | 3 +- mahjongg/mahjongg.php | 82 +++--- mailstream/mailstream.php | 2 +- namethingy/namethingy.php | 3 +- newmemberwidget/newmemberwidget.php | 3 +- notimeline/notimeline.php | 3 +- nsfw/nsfw.php | 3 +- numfriends/numfriends.php | 3 +- piwik/piwik.php | 3 +- planets/planets.php | 3 +- public_server/public_server.php | 7 +- qcomment/qcomment.php | 3 +- randplace/randplace.php | 3 +- remote_permissions/remote_permissions.php | 4 +- showmore/showmore.php | 3 +- .../lang/smiley_pack_es/smiley_pack_es.php | 275 ++++++++--------- .../lang/smiley_pack_fr/smiley_pack_fr.php | 223 +++++++------- smiley_pack/smiley_pack.php | 277 +++++++++--------- smilies_adult/smilies_adult.php | 13 +- sniper/sniper.php | 3 +- startpage/startpage.php | 5 +- superblock/superblock.php | 3 +- testdrive/testdrive.php | 7 +- viewsrc/viewsrc.php | 3 +- widgets/widget_friendheader.php | 3 +- widgets/widget_friends.php | 3 +- widgets/widgets.php | 8 +- windowsphonepush/windowsphonepush.php | 2 +- wppost/wppost.php | 3 +- 38 files changed, 510 insertions(+), 480 deletions(-) diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index 5c9b4454..dd48e740 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -10,6 +10,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; +use Friendica\DI; function fromapp_install() { @@ -48,7 +49,7 @@ function fromapp_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ diff --git a/gnot/gnot.php b/gnot/gnot.php index 2168f97a..46012e5e 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -12,6 +12,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Renderer; +use Friendica\DI; function gnot_install() { @@ -69,7 +70,7 @@ function gnot_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ diff --git a/group_text/group_text.php b/group_text/group_text.php index 47768df2..6d14b6f5 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -9,6 +9,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; +use Friendica\DI; function group_text_install() { @@ -64,7 +65,7 @@ function group_text_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 020dd221..1ba936a2 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -13,6 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; +use Friendica\DI; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; @@ -61,7 +62,7 @@ function ijpost_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ diff --git a/impressum/impressum.php b/impressum/impressum.php index b943fd9f..0bc4d6e3 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -47,7 +47,7 @@ function impressum_footer($a, &$b) { $text = ProxyUtils::proxifyHtml(BBCode::convert(Config::get('impressum','footer_text'))); if (! $text == '') { - $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''; $b .= '
'; $b .= ''; } diff --git a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php index a71fe651..0450a7c7 100644 --- a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php +++ b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php @@ -7,6 +7,7 @@ */ use Friendica\Core\Hook; use Friendica\Core\L10n; +use Friendica\DI; function infiniteimprobabilitydrive_install() { @@ -32,13 +33,13 @@ function infiniteimprobabilitydrive_module() function infiniteimprobabilitydrive_content(&$a) { - $baseurl = $a->getBaseURL() . '/addon/infiniteimprobabilitydrive'; + $baseurl = DI::baseUrl()->get() . '/addon/infiniteimprobabilitydrive'; $o = ''; - $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''; - $baseurl = $a->getBaseURL(); + $baseurl = DI::baseUrl()->get(); $o .= <<< EOT diff --git a/irc/irc.php b/irc/irc.php index d02b2cbd..d7eaed62 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -12,6 +12,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; +use Friendica\DI; function irc_install() { Hook::register('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); @@ -80,7 +81,7 @@ function irc_module() { function irc_content(&$a) { - $baseurl = $a->getBaseURL() . '/addon/irc'; + $baseurl = DI::baseUrl()->get() . '/addon/irc'; $o = ''; /* set the list of popular channels */ @@ -99,7 +100,7 @@ function irc_content(&$a) { $a->page['aside'] .= '

' . L10n::t('Popular Channels') . '

'; diff --git a/krynn/krynn.php b/krynn/krynn.php index 8f92daf7..fe5c1975 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -13,6 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; +use Friendica\DI; function krynn_install() { @@ -142,7 +143,7 @@ function krynn_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ diff --git a/libertree/libertree.php b/libertree/libertree.php index 034833e8..11036d5c 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -13,6 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Util\Network; function libertree_install() @@ -61,7 +62,7 @@ function libertree_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ @@ -206,7 +207,7 @@ function libertree_send(&$a,&$b) { $ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token'); $ltree_url = PConfig::get($b['uid'],'libertree','libertree_url'); $ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token"; - $ltree_source = $a->getHostName(); + $ltree_source = DI::baseUrl()->getHostname(); if ($b['app'] != "") $ltree_source .= " (".$b['app'].")"; diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 8bc33fc7..6d347b27 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -13,6 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; +use Friendica\DI; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; @@ -61,7 +62,7 @@ function ljpost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ diff --git a/mahjongg/mahjongg.php b/mahjongg/mahjongg.php index d9772037..502c92d9 100644 --- a/mahjongg/mahjongg.php +++ b/mahjongg/mahjongg.php @@ -1,42 +1,40 @@ -Mahjongg'; -} - - -function mahjongg_module() {} - -function mahjongg_content(&$a) { - -$baseurl = $a->getBaseURL() . '/addon/mahjongg'; - -$o .= <<< EOT -

-

- -

-Simply locate the matching tiles and find a way to clear them from the board as quickly as possible. -A timer at the top of the screen keeps track of how you are doing.
-

-EOT; - -return $o; -} +Mahjongg'; +} + + +function mahjongg_module() {} + +function mahjongg_content(&$a) { + +$o .= <<< EOT +

+

+ +

+Simply locate the matching tiles and find a way to clear them from the board as quickly as possible. +A timer at the top of the screen keeps track of how you are doing.
+

+EOT; + +return $o; +} diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 02e6dcb6..1afde867 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -95,7 +95,7 @@ function mailstream_addon_admin_post ($a) { function mailstream_generate_id($a, $uri) { // http://www.jwz.org/doc/mid.html - $host = $a->getHostName(); + $host = DI::baseUrl()->getHostname(); $resource = hash('md5', $uri); $message_id = "<" . $resource . "@" . $host . ">"; Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri); diff --git a/namethingy/namethingy.php b/namethingy/namethingy.php index cb330981..7e314e89 100644 --- a/namethingy/namethingy.php +++ b/namethingy/namethingy.php @@ -8,6 +8,7 @@ * Status: Unsupported */ use Friendica\Core\Hook; +use Friendica\DI; function namethingy_install() { Hook::register('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu'); @@ -27,7 +28,7 @@ function namethingy_module() {} function namethingy_content(&$a) { -$baseurl = $a->getBaseURL() . '/addon/namethingy'; +$baseurl = DI::baseUrl()->get() . '/addon/namethingy'; $o .= <<< EOT