Skip to content

Commit

Permalink
Replace DI::app() with DI::appHelper()
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Dec 11, 2024
1 parent 5f7482d commit 84659fc
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion advancedcontentfilter/advancedcontentfilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function advancedcontentfilter_content()
'rule_expression' => DI::l10n()->t('Rule Expression'),
'cancel' => DI::l10n()->t('Cancel'),
],
'$current_theme' => DI::app()->getCurrentTheme(),
'$current_theme' => DI::appHelper()->getCurrentTheme(),
'$rules' => DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => DI::userSession()->getLocalUserId()])),
'$form_security_token' => BaseModule::getFormSecurityToken()
]);
Expand Down
2 changes: 1 addition & 1 deletion bluesky/bluesky.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function bluesky_install()

function bluesky_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('bluesky'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('bluesky'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function bluesky_check_item_notification(array &$notification_data)
Expand Down
2 changes: 1 addition & 1 deletion fancybox/fancybox.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function fancybox_render(array &$b){
function ($text) use ($gallery) {
// This processes images inlined in posts
// Frio / Vier hooks für lightbox are un-hooked in fancybox-config.js. So this works for them, too!
//if (!in_array(DI::app()->getCurrentTheme(),['vier','frio']))
//if (!in_array(DI::appHelper()->getCurrentTheme(),['vier','frio']))
$text = preg_replace(
'#<a[^>]*href="([^"]*)"[^>]*>(<img[^>]*src="[^"]*"[^>]*>)</a>#',
'<a data-fancybox="' . $gallery . '" href="$1">$2</a>',
Expand Down
2 changes: 1 addition & 1 deletion geonames/geonames.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function geonames_install()

function geonames_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('geonames'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('geonames'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function geonames_post_hook(array &$item)
Expand Down
2 changes: 1 addition & 1 deletion gravatar/gravatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function gravatar_install() {

function gravatar_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('gravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('gravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion highlightjs/highlightjs.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function highlightjs_install()

function highlightjs_head(string &$str)
{
if (DI::app()->getCurrentTheme() == 'frio') {
if (DI::appHelper()->getCurrentTheme() == 'frio') {
$style = 'bootstrap';
} else {
$style = 'default';
Expand Down
2 changes: 1 addition & 1 deletion impressum/impressum.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function impressum_footer(string &$body)

function impressum_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('impressum'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('impressum'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function impressum_show(string &$body)
Expand Down
2 changes: 1 addition & 1 deletion ldapauth/ldapauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ldapauth_install()

function ldapauth_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function ldapauth_hook_authenticate(array &$b)
Expand Down
2 changes: 1 addition & 1 deletion libravatar/libravatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function libravatar_install()

function libravatar_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('libravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('libravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion openstreetmap/openstreetmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function openstreetmap_install()

function openstreetmap_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('openstreetmap'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('openstreetmap'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function openstreetmap_alterheader(&$navHtml)
Expand Down
2 changes: 1 addition & 1 deletion phpmailer/phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function phpmailer_install()

function phpmailer_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('phpmailer'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('phpmailer'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion piwik/piwik.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function piwik_install() {

function piwik_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('piwik'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('piwik'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function piwik_analytics(string &$b)
Expand Down
2 changes: 1 addition & 1 deletion pnut/pnut.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function pnut_connect()

function pnut_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('pnut'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('pnut'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function pnut_addon_admin(string &$o)
Expand Down
2 changes: 1 addition & 1 deletion public_server/public_server.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function public_server_install()

function public_server_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('public_server'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('public_server'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function public_server_register_account($b)
Expand Down
2 changes: 1 addition & 1 deletion pumpio/pumpio.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function pumpio_settings_post(array &$b)

function pumpio_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('pumpio'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('pumpio'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function pumpio_hook_fork(array &$b)
Expand Down
6 changes: 3 additions & 3 deletions smileybutton/smileybutton.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function smileybutton_install()
function smileybutton_jot_tool(string &$body)
{
// Disable if theme is quattro
if (DI::app()->getCurrentTheme() == 'quattro') {
if (DI::appHelper()->getCurrentTheme() == 'quattro') {
return;
}

Expand Down Expand Up @@ -96,15 +96,15 @@ function smileybutton_jot_tool(string &$body)
$s .= '</tr></table>';

//Add css to header
$css_file = __DIR__ . '/view/' . DI::app()->getCurrentTheme() . '.css';
$css_file = __DIR__ . '/view/' . DI::appHelper()->getCurrentTheme() . '.css';
if (!file_exists($css_file)) {
$css_file = __DIR__ . '/view/default.css';
}

DI::page()->registerStylesheet($css_file);

//Get the correct image for the theme
$image = 'addon/smileybutton/view/' . DI::app()->getCurrentTheme() . '.png';
$image = 'addon/smileybutton/view/' . DI::appHelper()->getCurrentTheme() . '.png';
if (!file_exists($image)) {
$image = 'addon/smileybutton/view/default.png';
}
Expand Down
2 changes: 1 addition & 1 deletion testdrive/testdrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function testdrive_install()

function testdrive_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('testdrive'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('testdrive'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function testdrive_globaldir_update(array &$b)
Expand Down
2 changes: 1 addition & 1 deletion tumblr/tumblr.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function tumblr_install()

function tumblr_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('tumblr'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('tumblr'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function tumblr_check_item_notification(array &$notification_data)
Expand Down
2 changes: 1 addition & 1 deletion twitter/twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function twitter_install()

function twitter_load_config(ConfigFileManager $loader)
{
DI::app()->getConfigCache()->load($loader->loadAddonConfig('twitter'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('twitter'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC);
}

function twitter_jot_nets(array &$jotnets_fields)
Expand Down

0 comments on commit 84659fc

Please sign in to comment.