diff --git a/blockem/blockem.php b/blockem/blockem.php
index e0c0a74a..6d93de1d 100644
--- a/blockem/blockem.php
+++ b/blockem/blockem.php
@@ -11,6 +11,7 @@ use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\DI;
use Friendica\Util\Strings;
function blockem_install()
@@ -43,7 +44,7 @@ function blockem_addon_settings (App $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";
$words = PConfig::get(local_user(), 'blockem', 'words');
@@ -148,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'] = $a->getBaseURL() . "/images/person-80.jpg";
+ $b['output']['thumb'] = DI::baseUrl()->get() . "/images/person-80.jpg";
}
}
diff --git a/blogger/blogger.php b/blogger/blogger.php
index 001224d2..049ee077 100644
--- a/blogger/blogger.php
+++ b/blogger/blogger.php
@@ -12,6 +12,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
+use Friendica\DI;
use Friendica\Util\Network;
use Friendica\Util\XML;
@@ -68,7 +69,7 @@ function blogger_settings(App $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/buffer/buffer.php b/buffer/buffer.php
index 13b5309d..24357634 100644
--- a/buffer/buffer.php
+++ b/buffer/buffer.php
@@ -17,6 +17,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\ItemContent;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
@@ -110,7 +111,7 @@ function buffer_connect(App $a)
$client_secret = Config::get('buffer','client_secret');
// The callback URL is the script that gets called after the user authenticates with buffer
- $callback_url = $a->getBaseURL()."/buffer/connect";
+ $callback_url = DI::baseUrl()->get()."/buffer/connect";
$buffer = new BufferApp($client_id, $client_secret, $callback_url);
@@ -119,7 +120,7 @@ function buffer_connect(App $a)
} else {
Logger::log("buffer_connect: authenticated");
$o = L10n::t("You are now authenticated to buffer. ");
- $o .= ' ' . L10n::t("return to the connector page") . '';
+ $o .= ' ' . L10n::t("return to the connector page") . '';
PConfig::set(local_user(), 'buffer','access_token', $buffer->access_token);
}
@@ -152,7 +153,7 @@ function buffer_settings(App $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 */
@@ -181,7 +182,7 @@ function buffer_settings(App $a, &$s)
if ($access_token == "") {
$s .= '
';
// The callback URL is the script that gets called after the user authenticates with buffer
- $callback_url = $a->getBaseURL() . '/buffer/connect';
+ $callback_url = DI::baseUrl()->get() . '/buffer/connect';
$buffer = new BufferApp($client_id, $client_secret, $callback_url, $access_token);
diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php
index e70449af..b345ea4f 100644
--- a/catavatar/catavatar.php
+++ b/catavatar/catavatar.php
@@ -15,6 +15,7 @@ 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;
@@ -84,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 = $a->getBaseURL() . '/catavatar/' . local_user() . '?ts=' . time();
+ $url = DI::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time();
$self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
if (!DBA::isResult($self)) {
@@ -111,7 +112,7 @@ function catavatar_addon_settings_post(App $a, &$s)
Contact::updateSelfFromUserID(local_user(), true);
// Update global directory in background
- $url = $a->getBaseURL() . '/profile/' . $a->user['nickname'];
+ $url = DI::baseUrl()->get() . '/profile/' . $a->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, 'Directory', $url);
}
@@ -140,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 = $a->getBaseURL() . '/catavatar/' . $user['uid'];
+ $url = DI::baseUrl()->get() . '/catavatar/' . $user['uid'];
switch($b['size']) {
case 300: $url .= "/4"; break;
diff --git a/cookienotice/cookienotice.php b/cookienotice/cookienotice.php
index 097f3c25..bad867e7 100644
--- a/cookienotice/cookienotice.php
+++ b/cookienotice/cookienotice.php
@@ -12,6 +12,7 @@ use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
+use Friendica\DI;
/**
* cookienotice_install
@@ -90,8 +91,8 @@ function cookienotice_page_content_top(App $a, &$b)
$stylesheetPath = __DIR__ . '/cookienotice.css';
$footerscriptPath = __DIR__ . '/cookienotice.js';
- $a->registerStylesheet($stylesheetPath);
- $a->registerFooterScript($footerscriptPath);
+ DI::page()->registerStylesheet($stylesheetPath);
+ DI::page()->registerFooterScript($footerscriptPath);
}
/**
diff --git a/curweather/curweather.php b/curweather/curweather.php
index df7a701a..533c83e0 100644
--- a/curweather/curweather.php
+++ b/curweather/curweather.php
@@ -17,6 +17,7 @@ use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
use Friendica\Core\Session;
+use Friendica\DI;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
@@ -103,7 +104,7 @@ function curweather_network_mod_init(App $a, &$b)
return;
}
- $a->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
diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php
index 0d847b14..06b54399 100644
--- a/diaspora/diaspora.php
+++ b/diaspora/diaspora.php
@@ -18,6 +18,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\Core\Worker;
+use Friendica\DI;
function diaspora_install()
{
@@ -65,7 +66,7 @@ function diaspora_settings(App $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 */
@@ -231,7 +232,7 @@ function diaspora_post_local(App $a, array &$b)
function diaspora_send(App $a, array &$b)
{
- $hostname = $a->getHostName();
+ $hostname = DI::baseUrl()->getHostname();
Logger::log('diaspora_send: invoked');
diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php
index ebba0232..5c13734b 100644
--- a/dwpost/dwpost.php
+++ b/dwpost/dwpost.php
@@ -15,6 +15,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\XML;
@@ -63,7 +64,7 @@ function dwpost_settings(App $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 */
$enabled = PConfig::get(local_user(), 'dwpost', 'post');
diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php
index f7c8b244..16538d79 100644
--- a/forumdirectory/forumdirectory.php
+++ b/forumdirectory/forumdirectory.php
@@ -15,6 +15,7 @@ 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\Util\Strings;
@@ -107,7 +108,7 @@ function forumdirectory_content(App $a)
$total = $cnt['total'];
}
- $pager = new Pager($a->query_string, 60);
+ $pager = new Pager(DI::args()->getQueryString(), 60);
$order = " ORDER BY `name` ASC ";
diff --git a/geonames/geonames.php b/geonames/geonames.php
index c052cef6..03a2e45b 100644
--- a/geonames/geonames.php
+++ b/geonames/geonames.php
@@ -13,6 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
+use Friendica\DI;
use Friendica\Util\ConfigFileLoader;
use Friendica\Util\Network;
use Friendica\Util\XML;
@@ -136,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';
- $a->registerStylesheet($stylesheetPath);
+ DI::page()->registerStylesheet($stylesheetPath);
/* Get the current state of our config variable */
$enabled = intval(PConfig::get(local_user(), 'geonames', 'enable'));
diff --git a/highlightjs/highlightjs.php b/highlightjs/highlightjs.php
index 258cb4ad..823541bb 100644
--- a/highlightjs/highlightjs.php
+++ b/highlightjs/highlightjs.php
@@ -8,6 +8,7 @@
use Friendica\App;
use Friendica\Core\Hook;
+use Friendica\DI;
function highlightjs_install()
{
@@ -29,11 +30,11 @@ function highlightjs_head(App $a, &$b)
$style = 'default';
}
- $a->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css');
+ DI::page()->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css');
}
function highlightjs_footer(App $a, &$b)
{
- $a->registerFooterScript(__DIR__ . '/asset/highlight.pack.js');
- $a->registerFooterScript(__DIR__ . '/highlightjs.js');
+ DI::page()->registerFooterScript(__DIR__ . '/asset/highlight.pack.js');
+ DI::page()->registerFooterScript(__DIR__ . '/highlightjs.js');
}
diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php
index 3bb55f35..c9e08696 100644
--- a/ifttt/ifttt.php
+++ b/ifttt/ifttt.php
@@ -14,6 +14,7 @@ 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\Util\Strings;
@@ -63,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:') . '