From 211f4246b74f50d15a67db1395536646cbc8cd5c Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Wed, 8 Jan 2020 00:31:53 +0100 Subject: [PATCH] Making DI:: calls explicit and move them to new Registry classes --- blockem/blockem.php | 8 +- blogger/blogger.php | 4 +- buffer/buffer.php | 12 +- calc/calc.php | 4 +- catavatar/catavatar.php | 8 +- cookienotice/cookienotice.php | 6 +- curweather/curweather.php | 8 +- diaspora/diaspora.php | 7 +- dwpost/dwpost.php | 4 +- forumdirectory/forumdirectory.php | 6 +- fromapp/fromapp.php | 4 +- geonames/geonames.php | 4 +- gnot/gnot.php | 4 +- group_text/group_text.php | 4 +- highlightjs/highlightjs.php | 8 +- ifttt/ifttt.php | 10 +- ijpost/ijpost.php | 4 +- impressum/impressum.php | 8 +- .../infiniteimprobabilitydrive.php | 8 +- irc/irc.php | 10 +- jappixmini/jappixmini.php | 28 +- js_upload/js_upload.php | 6 +- krynn/krynn.php | 4 +- langfilter/langfilter.php | 4 +- libertree/libertree.php | 6 +- ljpost/ljpost.php | 4 +- mailstream/mailstream.php | 6 +- mastodoncustomemojis/mastodoncustomemojis.php | 4 +- mathjax/mathjax.php | 6 +- namethingy/namethingy.php | 4 +- newmemberwidget/newmemberwidget.php | 8 +- notifyall/notifyall.php | 9 +- notimeline/notimeline.php | 4 +- nsfw/nsfw.php | 4 +- numfriends/numfriends.php | 4 +- openstreetmap/openstreetmap.php | 8 +- pageheader/pageheader.php | 6 +- phpmailer/phpmailer.php | 4 +- piwik/piwik.php | 4 +- planets/planets.php | 4 +- public_server/public_server.php | 8 +- pumpio/pumpio.php | 18 +- pumpio/pumpio_sync.php | 3 +- qcomment/qcomment.php | 4 +- randplace/randplace.php | 4 +- remote_permissions/remote_permissions.php | 9 +- rendertime/rendertime.php | 9 +- securemail/securemail.php | 4 +- showmore/showmore.php | 4 +- .../lang/smiley_pack_es/smiley_pack_es.php | 276 ++++++++--------- .../lang/smiley_pack_fr/smiley_pack_fr.php | 224 +++++++------- smiley_pack/smiley_pack.php | 278 +++++++++--------- smileybutton/smileybutton.php | 56 ++-- smilies_adult/smilies_adult.php | 14 +- sniper/sniper.php | 4 +- startpage/startpage.php | 7 +- statusnet/statusnet.php | 16 +- superblock/superblock.php | 6 +- testdrive/testdrive.php | 8 +- tumblr/tumblr.php | 10 +- twitter/twitter.php | 16 +- twitter/twitter_sync.php | 3 +- viewsrc/viewsrc.php | 6 +- widgets/widget_friendheader.php | 4 +- widgets/widget_friends.php | 4 +- widgets/widgets.php | 12 +- windowsphonepush/windowsphonepush.php | 9 +- wppost/wppost.php | 4 +- xmpp/xmpp.php | 16 +- 69 files changed, 647 insertions(+), 647 deletions(-) diff --git a/blockem/blockem.php b/blockem/blockem.php index e44ac622..5211aa70 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -11,7 +11,7 @@ use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\DI; +use Friendica\Registry\App as A; use Friendica\Util\Strings; function blockem_install() @@ -44,7 +44,7 @@ function blockem_addon_settings (App $a, &$s) } /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; $words = PConfig::get(local_user(), 'blockem', 'words'); @@ -149,7 +149,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data) function blockem_display_item(App $a, array &$b = null) { if (!empty($b['output']['body']) && strstr($b['output']['body'], 'id="blockem-wrap-')) { - $b['output']['thumb'] = DI::baseUrl()->get() . "/images/person-80.jpg"; + $b['output']['thumb'] = A::baseUrl()->get() . "/images/person-80.jpg"; } } @@ -165,7 +165,7 @@ function blockem_conversation_start(App $a, array &$b) $a->data['blockem'] = explode(',', $words); } - DI::page()['htmlhead'] .= <<< EOT + A::page()['htmlhead'] .= <<< EOT EOT; -DI::page()['htmlhead'] .= $x; +App::page()['htmlhead'] .= $x; } function calc_content($app) { diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index b345ea4f..89dc2d80 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -15,10 +15,10 @@ use Friendica\Core\PConfig; use Friendica\Core\Renderer; use Friendica\Core\Worker; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Photo; use Friendica\Network\HTTPException\NotFoundException; +use Friendica\Registry\App as A; define("CATAVATAR_SIZE", 256); @@ -85,7 +85,7 @@ function catavatar_addon_settings_post(App $a, &$s) $seed = PConfig::get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email'])))); if (!empty($_POST['catavatar-usecat'])) { - $url = DI::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time(); + $url = A::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time(); $self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]); if (!DBA::isResult($self)) { @@ -112,7 +112,7 @@ function catavatar_addon_settings_post(App $a, &$s) Contact::updateSelfFromUserID(local_user(), true); // Update global directory in background - $url = DI::baseUrl()->get() . '/profile/' . $a->user['nickname']; + $url = A::baseUrl()->get() . '/profile/' . $a->user['nickname']; if ($url && strlen(Config::get('system', 'directory'))) { Worker::add(PRIORITY_LOW, 'Directory', $url); } @@ -141,7 +141,7 @@ function catavatar_addon_settings_post(App $a, &$s) function catavatar_lookup(App $a, &$b) { $user = DBA::selectFirst('user', ['uid'], ['email' => $b['email']]); - $url = DI::baseUrl()->get() . '/catavatar/' . $user['uid']; + $url = A::baseUrl()->get() . '/catavatar/' . $user['uid']; switch($b['size']) { case 300: $url .= "/4"; break; diff --git a/cookienotice/cookienotice.php b/cookienotice/cookienotice.php index bad867e7..24efcea4 100644 --- a/cookienotice/cookienotice.php +++ b/cookienotice/cookienotice.php @@ -12,7 +12,7 @@ use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App as A; /** * cookienotice_install @@ -91,8 +91,8 @@ function cookienotice_page_content_top(App $a, &$b) $stylesheetPath = __DIR__ . '/cookienotice.css'; $footerscriptPath = __DIR__ . '/cookienotice.js'; - DI::page()->registerStylesheet($stylesheetPath); - DI::page()->registerFooterScript($footerscriptPath); + A::page()->registerStylesheet($stylesheetPath); + A::page()->registerFooterScript($footerscriptPath); } /** diff --git a/curweather/curweather.php b/curweather/curweather.php index c515adce..17feb4b9 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -17,7 +17,7 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; use Friendica\Core\Session; -use Friendica\DI; +use Friendica\Registry\App as A; use Friendica\Util\Network; use Friendica\Util\Proxy as ProxyUtils; @@ -104,7 +104,7 @@ function curweather_network_mod_init(App $a, &$b) return; } - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; // $rpt value is needed for location // $lang will be taken from the browser session to honour user settings @@ -137,7 +137,7 @@ function curweather_network_mod_init(App $a, &$b) if ($ok) { $t = Renderer::getMarkupTemplate("widget.tpl", "addon/curweather/" ); - $curweather = Renderer::replaceMacros($t, [ + $curweather = Renderer::replaceMacros($t, [ '$title' => L10n::t("Current Weather"), '$icon' => ProxyUtils::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'), '$city' => $res['city'], @@ -161,7 +161,7 @@ function curweather_network_mod_init(App $a, &$b) ]); } - DI::page()['aside'] = $curweather . DI::page()['aside']; + A::page()['aside'] = $curweather . A::page()['aside']; } function curweather_addon_settings_post(App $a, $post) diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 7393bbb2..0f007ec3 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -15,10 +15,9 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\Core\Protocol; use Friendica\Database\DBA; use Friendica\Core\Worker; -use Friendica\DI; +use Friendica\Registry\App as A; function diaspora_install() { @@ -66,7 +65,7 @@ function diaspora_settings(App $a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ @@ -232,7 +231,7 @@ function diaspora_post_local(App $a, array &$b) function diaspora_send(App $a, array &$b) { - $hostname = DI::baseUrl()->getHostname(); + $hostname = A::baseUrl()->getHostname(); Logger::log('diaspora_send: invoked'); diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 336c84e6..0e1cbe1a 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -15,7 +15,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; +use Friendica\Registry\App as A; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; @@ -64,7 +64,7 @@ function dwpost_settings(App $a, &$s) } /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ $enabled = PConfig::get(local_user(), 'dwpost', 'post'); diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index b5ec0d1c..a97c2831 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -15,8 +15,8 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Profile; +use Friendica\Registry\App as A; use Friendica\Util\Strings; function forumdirectory_install() @@ -42,7 +42,7 @@ function forumdirectory_app_menu(App $a, array &$b) function forumdirectory_init(App $a) { if (local_user()) { - DI::page()['aside'] .= Widget::findPeople(); + A::page()['aside'] .= Widget::findPeople(); } } @@ -108,7 +108,7 @@ function forumdirectory_content(App $a) $total = $cnt['total']; } - $pager = new Pager(DI::args()->getQueryString(), 60); + $pager = new Pager(A::args()->getQueryString(), 60); $order = " ORDER BY `name` ASC "; diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index 4e832506..ec00bea9 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -10,7 +10,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\DI; +use Friendica\Registry\App; function fromapp_install() { @@ -49,7 +49,7 @@ function fromapp_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + App::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ diff --git a/geonames/geonames.php b/geonames/geonames.php index 03a2e45b..6e3e8eb3 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -13,7 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App as A; use Friendica\Util\ConfigFileLoader; use Friendica\Util\Network; use Friendica\Util\XML; @@ -137,7 +137,7 @@ function geonames_addon_settings(App $a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ $stylesheetPath = __DIR__ . '/geonames.css'; - DI::page()->registerStylesheet($stylesheetPath); + A::page()->registerStylesheet($stylesheetPath); /* Get the current state of our config variable */ $enabled = intval(PConfig::get(local_user(), 'geonames', 'enable')); diff --git a/gnot/gnot.php b/gnot/gnot.php index c89b3aba..e23d8216 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -12,7 +12,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App; function gnot_install() { @@ -70,7 +70,7 @@ function gnot_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + App::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 3e636091..b3000b09 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -9,7 +9,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\DI; +use Friendica\Registry\App; function group_text_install() { @@ -65,7 +65,7 @@ function group_text_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + App::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ diff --git a/highlightjs/highlightjs.php b/highlightjs/highlightjs.php index 823541bb..8d1e68c7 100644 --- a/highlightjs/highlightjs.php +++ b/highlightjs/highlightjs.php @@ -8,7 +8,7 @@ use Friendica\App; use Friendica\Core\Hook; -use Friendica\DI; +use Friendica\Registry\App as A; function highlightjs_install() { @@ -30,11 +30,11 @@ function highlightjs_head(App $a, &$b) $style = 'default'; } - DI::page()->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css'); + A::page()->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css'); } function highlightjs_footer(App $a, &$b) { - DI::page()->registerFooterScript(__DIR__ . '/asset/highlight.pack.js'); - DI::page()->registerFooterScript(__DIR__ . '/highlightjs.js'); + A::page()->registerFooterScript(__DIR__ . '/asset/highlight.pack.js'); + A::page()->registerFooterScript(__DIR__ . '/highlightjs.js'); } diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 08be262b..fa7c9a61 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -14,8 +14,8 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Item; +use Friendica\Registry\App as A; use Friendica\Util\Strings; function ifttt_install() @@ -64,7 +64,7 @@ function ifttt_settings(App $a, &$s) $s .= '
'; $s .= '

' . L10n::t('Create an account at IFTTT. Create three Facebook recipes that are connected with Maker (In the form "if Facebook then Maker") with the following parameters:') . '

'; $s .= '

URL

'; - $s .= '

' . DI::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '

'; + $s .= '

' . A::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '

'; $s .= '

Method

'; $s .= '

POST

'; $s .= '

Content Type

'; @@ -161,13 +161,11 @@ function ifttt_post(App $a) $item['msg'] = substr($item['msg'], 3, -3); } - ifttt_message($uid, $item); + ifttt_message($a, $uid, $item); } -function ifttt_message($uid, $item) +function ifttt_message(App $a, $uid, $item) { - $a = DI::app(); - $_SESSION['authenticated'] = true; $_SESSION['uid'] = $uid; diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index f49fa214..83d6133d 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -13,7 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\DI; +use Friendica\Registry\App; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; @@ -62,7 +62,7 @@ function ijpost_settings(&$a, &$s) /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + App::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ diff --git a/impressum/impressum.php b/impressum/impressum.php index 190afc2c..4a58f36f 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -13,7 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App; use Friendica\Util\ConfigFileLoader; use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; @@ -35,7 +35,7 @@ function impressum_uninstall() { function impressum_module() { } function impressum_content() { - DI::baseUrl()->redirect('friendica/'); + App::baseUrl()->redirect('friendica/'); } function obfuscate_email ($s) { @@ -47,8 +47,8 @@ function impressum_footer($a, &$b) { $text = ProxyUtils::proxifyHtml(BBCode::convert(Config::get('impressum','footer_text'))); if (! $text == '') { - DI::page()['htmlhead'] .= ''; - $b .= '
'; + App::page()['htmlhead'] .= ''; + $b .= '
'; $b .= ''; } } diff --git a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php index 6a4fbab7..47442015 100644 --- a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php +++ b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php @@ -7,7 +7,7 @@ */ use Friendica\Core\Hook; use Friendica\Core\L10n; -use Friendica\DI; +use Friendica\Registry\App; function infiniteimprobabilitydrive_install() { @@ -33,13 +33,13 @@ function infiniteimprobabilitydrive_module() function infiniteimprobabilitydrive_content(&$a) { - $baseurl = DI::baseUrl()->get() . '/addon/infiniteimprobabilitydrive'; + $baseurl = App::baseUrl()->get() . '/addon/infiniteimprobabilitydrive'; $o = ''; - DI::page()['htmlhead'] .= ''; + App::page()['htmlhead'] .= ''; - $baseurl = DI::baseUrl()->get(); + $baseurl = App::baseUrl()->get(); $o .= <<< EOT diff --git a/irc/irc.php b/irc/irc.php index 528189ed..8932b1f8 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -12,7 +12,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App; function irc_install() { Hook::register('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); @@ -81,7 +81,7 @@ function irc_module() { function irc_content(&$a) { - $baseurl = DI::baseUrl()->get() . '/addon/irc'; + $baseurl = App::baseUrl()->get() . '/addon/irc'; $o = ''; /* set the list of popular channels */ @@ -98,11 +98,11 @@ function irc_content(&$a) { $chats = ['friendica','chat','chatback','hottub','ircbar','dateroom','debian']; - DI::page()['aside'] .= '

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

    '; + App::page()['aside'] .= '

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

    '; + App::page()['aside'] .= '
'; /* setting the channel(s) to auto connect */ if (local_user()) { diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index ad758167..74b45c29 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -70,8 +70,8 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\User; +use Friendica\Registry\App as A; use Friendica\Util\Network; function jappixmini_install() @@ -325,10 +325,10 @@ function jappixmini_settings(App $a, &$s) if (!$activate) { // load scripts if not yet activated so that password can be saved - DI::page()['htmlhead'] .= '' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; } $s .= ''; @@ -387,7 +387,7 @@ function jappixmini_settings(App $a, &$s) $s .= '
'; - DI::page()['htmlhead'] .= "' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; $username = PConfig::get(local_user(), 'jappixmini', 'username'); $username = str_replace("'", "\\'", $username); @@ -515,7 +515,7 @@ function jappixmini_script(App $a) // set proxy if necessary $use_proxy = Config::get('jappixmini', 'bosh_proxy'); if ($use_proxy) { - $proxy = DI::baseUrl()->get() . '/addon/jappixmini/proxy.php'; + $proxy = A::baseUrl()->get() . '/addon/jappixmini/proxy.php'; } else { $proxy = ""; } @@ -557,7 +557,7 @@ function jappixmini_script(App $a) } // add javascript to start Jappix Mini - DI::page()['htmlhead'] .= "' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; // for jappixmini_addon_set_client_secret - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; // save hash of password $o = str_replace("
get() . '/addon/jappixmini/jappix/AUTHORS">Jappix authors and is distributed under the terms of the GNU Affero General Public License.

'; - $b .= '

You can download the source code of the addon. The rest of Friendica is distributed under compatible licenses and can be retrieved from https://github.com/friendica/friendica and https://github.com/friendica/friendica-addons

'; + $b .= '

This site uses the jappixmini addon, which includes Jappix Mini by the Jappix authors and is distributed under the terms of the GNU Affero General Public License.

'; + $b .= '

You can download the source code of the addon. The rest of Friendica is distributed under compatible licenses and can be retrieved from https://github.com/friendica/friendica and https://github.com/friendica/friendica-addons

'; } diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index b92466a0..f151e1cf 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -13,7 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App as A; function js_upload_install() { @@ -27,8 +27,8 @@ function js_upload_form(App $a, array &$b) { $b['default_upload'] = false; - DI::page()->registerStylesheet('addon/js_upload/file-uploader/client/fileuploader.css'); - DI::page()->registerFooterScript('addon/js_upload/file-uploader/client/fileuploader.js'); + A::page()->registerStylesheet('addon/js_upload/file-uploader/client/fileuploader.css'); + A::page()->registerFooterScript('addon/js_upload/file-uploader/client/fileuploader.js'); $tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload'); $b['addon_text'] .= Renderer::replaceMacros($tpl, [ diff --git a/krynn/krynn.php b/krynn/krynn.php index 2a941580..75bef3da 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -13,7 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\DI; +use Friendica\Registry\App; function krynn_install() { @@ -143,7 +143,7 @@ function krynn_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + App::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index f4728c77..f3e0d608 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -13,7 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App as A; /* Define the hooks we want to use * that is, we have settings, we need to save the settings and we want @@ -123,7 +123,7 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data) // Never filter own messages // TODO: find a better way to extract this - $logged_user_profile = DI::baseUrl()->get() . '/profile/' . $a->user['nickname']; + $logged_user_profile = A::baseUrl()->get() . '/profile/' . $a->user['nickname']; if ($logged_user_profile == $hook_data['item']['author-link']) { return; } diff --git a/libertree/libertree.php b/libertree/libertree.php index 442fa90b..f37067dd 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -13,7 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; +use Friendica\Registry\App as A; use Friendica\Util\Network; function libertree_install() @@ -62,7 +62,7 @@ function libertree_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ @@ -207,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 = DI::baseUrl()->getHostname(); + $ltree_source = A::baseUrl()->getHostname(); if ($b['app'] != "") $ltree_source .= " (".$b['app'].")"; diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index e8732de6..06474e2e 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -13,7 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; -use Friendica\DI; +use Friendica\Registry\App; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; @@ -62,7 +62,7 @@ function ljpost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + App::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 1afde867..66c9210d 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -14,8 +14,8 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Renderer; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Protocol\Activity; +use Friendica\Registry\App; use Friendica\Util\Network; use Friendica\Model\Item; @@ -95,7 +95,7 @@ function mailstream_addon_admin_post ($a) { function mailstream_generate_id($a, $uri) { // http://www.jwz.org/doc/mid.html - $host = DI::baseUrl()->getHostname(); + $host = App::baseUrl()->getHostname(); $resource = hash('md5', $uri); $message_id = "<" . $resource . "@" . $host . ">"; Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri); @@ -307,7 +307,7 @@ function mailstream_send(\Friendica\App $a, $message_id, $item, $user) { $template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/'); $mail->AltBody = BBCode::toPlaintext($item['body']); $item['body'] = BBCode::convert($item['body']); - $item['url'] = DI::baseUrl()->get() . '/display/' . $item['guid']; + $item['url'] = App::baseUrl()->get() . '/display/' . $item['guid']; $mail->Body = Renderer::replaceMacros($template, [ '$upstream' => L10n::t('Upstream'), '$local' => L10n::t('Local'), diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index e1c20963..89a21569 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -15,7 +15,7 @@ use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Protocol; -use Friendica\DI; +use Friendica\Registry\App as A; use Friendica\Util\Network; use Friendica\Util\Proxy as ProxyUtils; @@ -41,7 +41,7 @@ function mastodoncustomemojis_uninstall() function mastodoncustomemojis_css_hook(App $a) { - DI::page()['htmlhead'] .= << "; $o .= _abs_url(HTML::contactBlock()); - $o .= "profile['nickname']."' target=new>". L10n::t('Get added to this list!') .""; + $o .= "profile['nickname'] . "' target=new>" . L10n::t('Get added to this list!') . ""; return $o; } diff --git a/widgets/widget_friends.php b/widgets/widget_friends.php index 37fc30dc..02fda89c 100644 --- a/widgets/widget_friends.php +++ b/widgets/widget_friends.php @@ -2,7 +2,7 @@ use Friendica\Content\Text\HTML; use Friendica\Core\L10n; -use Friendica\DI; +use Friendica\Registry\App; function friends_widget_name() { @@ -50,6 +50,6 @@ function friends_widget_content(&$a, $conf) "; $o .= _abs_url(HTML::contactBlock()); - $o .= "profile['nickname']."'>". L10n::t('Connect on Friendica!') .""; + $o .= "profile['nickname'] . "'>" . L10n::t('Connect on Friendica!') . ""; return $o; } diff --git a/widgets/widgets.php b/widgets/widgets.php index dd623afd..1e06ba86 100644 --- a/widgets/widgets.php +++ b/widgets/widgets.php @@ -13,7 +13,7 @@ use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Renderer; use Friendica\Database\DBA; -use Friendica\DI; +use Friendica\Registry\App; function widgets_install() { Hook::register('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings'); @@ -77,7 +77,7 @@ function widgets_module() { } function _abs_url($s){ - return preg_replace("|href=(['\"])([^h][^t][^t][^p])|", "href=\$1" . DI::baseUrl()->get() . "/\$2", $s); + return preg_replace("|href=(['\"])([^h][^t][^t][^p])|", "href=\$1" . App::baseUrl()->get() . "/\$2", $s); } function _randomAlphaNum($length){ @@ -127,7 +127,7 @@ function widgets_content(&$a) { if (isset($_GET['p']) && local_user()==$conf['uid'] ) { $o .= ""; $o .= "

Preview Widget

"; - $o .= ''. L10n::t("Addon Settings") .''; + $o .= '' . L10n::t("Addon Settings") . ''; $o .= "

".call_user_func($a->argv[1].'_widget_name')."

"; $o .= call_user_func($a->argv[1].'_widget_help'); @@ -143,10 +143,10 @@ function widgets_content(&$a) { $script = file_get_contents(dirname(__file__)."/widgets.js"); $o .= Renderer::replaceMacros($script, [ - '$entrypoint' => DI::baseUrl()->get()."/widgets/".$a->argv[1]."/cb/", + '$entrypoint' => App::baseUrl()->get() . "/widgets/" . $a->argv[1] . "/cb/", '$key' => $conf['key'], '$widget_id' => 'f9a_'.$a->argv[1]."_"._randomAlphaNum(6), - '$loader' => DI::baseUrl()->get()."/images/rotator.gif", + '$loader' => App::baseUrl()->get() . "/images/rotator.gif", '$args' => (isset($_GET['a'])?$_GET['a']:''), '$width' => $widget_size[0], '$height' => $widget_size[1], @@ -164,7 +164,7 @@ function widgets_content(&$a) {

Copy and paste this code

" - .htmlspecialchars('') .""; diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index e74ee635..16ba7514 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -34,9 +34,10 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; use Friendica\Model\Item; use Friendica\Model\User; +use Friendica\Registry\App as A; +use Friendica\Registry\Core; function windowsphonepush_install() { @@ -107,7 +108,7 @@ function windowsphonepush_settings(&$a, &$s) } /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ $enabled = PConfig::get(local_user(), 'windowsphonepush', 'enable'); @@ -473,7 +474,7 @@ function windowsphonepush_login(App $a) die('This api requires login'); } - DI::auth()->setForUser($a, $record); - DI::session()->set('allow_api', true); + A::auth()->setForUser($a, $record); + Core::session()->set('allow_api', true); Hook::callAll('logged_in', $a->user); } diff --git a/wppost/wppost.php b/wppost/wppost.php index 81e6efff..fd83e6a9 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -13,7 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\DI; +use Friendica\Registry\App; use Friendica\Util\Network; use Friendica\Util\Strings; use Friendica\Util\XML; @@ -70,7 +70,7 @@ function wppost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + App::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index a2a1e17d..653b3402 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -13,7 +13,7 @@ use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; -use Friendica\DI; +use Friendica\Registry\App as A; use Friendica\Util\Strings; function xmpp_install() @@ -53,7 +53,7 @@ function xmpp_addon_settings(App $a, &$s) /* Add our stylesheet to the xmpp so we can make our settings look nice */ - DI::page()['htmlhead'] .= '' . "\r\n"; + A::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ @@ -143,7 +143,7 @@ function xmpp_converse(App $a) return; } - if (DI::mode()->isMobile() || DI::mode()->isMobile()) { + if (A::mode()->isMobile() || A::mode()->isMobile()) { return; } @@ -151,12 +151,12 @@ function xmpp_converse(App $a) return; } - if (in_array(DI::args()->getQueryString(), ["admin/federation/"])) { + if (in_array(A::args()->getQueryString(), ["admin/federation/"])) { return; } - DI::page()['htmlhead'] .= '' . "\n"; - DI::page()['htmlhead'] .= '' . "\n"; + A::page()['htmlhead'] .= '' . "\n"; + A::page()['htmlhead'] .= '' . "\n"; if (Config::get("xmpp", "central_userbase") && !PConfig::get(local_user(), "xmpp", "individual")) { $bosh_proxy = Config::get("xmpp", "bosh_proxy"); @@ -168,7 +168,7 @@ function xmpp_converse(App $a) PConfig::set(local_user(), "xmpp", "password", $password); } - $jid = $a->user["nickname"] . "@" . DI::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5); + $jid = $a->user["nickname"] . "@" . A::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5); $auto_login = "auto_login: true, authentication: 'login', @@ -216,7 +216,7 @@ function xmpp_converse(App $a) xhr_user_search: false });\n"; - DI::page()['htmlhead'] .= "