From 211f4246b74f50d15a67db1395536646cbc8cd5c Mon Sep 17 00:00:00 2001
From: nupplaPhil ' . 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:') . ' ' . DI::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . ' ' . A::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . ' POSTURL
';
- $s .= 'Method
';
$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'] .= ' ';
/* 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 .= '
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 .= ""
- .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'] .= "