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 .= '
' . 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 .= '' . DI::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '
'; + $s .= '' . A::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '
'; $s .= 'POST
'; $s .= '