From 84659fc1ad339b0f7cee0b8d11ede9ea9aafba07 Mon Sep 17 00:00:00 2001 From: Art4 Date: Wed, 11 Dec 2024 21:47:10 +0000 Subject: [PATCH] Replace DI::app() with DI::appHelper() --- advancedcontentfilter/advancedcontentfilter.php | 2 +- bluesky/bluesky.php | 2 +- fancybox/fancybox.php | 2 +- geonames/geonames.php | 2 +- gravatar/gravatar.php | 2 +- highlightjs/highlightjs.php | 2 +- impressum/impressum.php | 2 +- ldapauth/ldapauth.php | 2 +- libravatar/libravatar.php | 2 +- openstreetmap/openstreetmap.php | 2 +- phpmailer/phpmailer.php | 2 +- piwik/piwik.php | 2 +- pnut/pnut.php | 2 +- public_server/public_server.php | 2 +- pumpio/pumpio.php | 2 +- smileybutton/smileybutton.php | 6 +++--- testdrive/testdrive.php | 2 +- tumblr/tumblr.php | 2 +- twitter/twitter.php | 2 +- 19 files changed, 21 insertions(+), 21 deletions(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 329156f1..c03034cd 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -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() ]); diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php index 91e524fe..aa4bc340 100644 --- a/bluesky/bluesky.php +++ b/bluesky/bluesky.php @@ -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) diff --git a/fancybox/fancybox.php b/fancybox/fancybox.php index 8608bcd7..b1a1ff35 100644 --- a/fancybox/fancybox.php +++ b/fancybox/fancybox.php @@ -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( '#]*href="([^"]*)"[^>]*>(]*src="[^"]*"[^>]*>)#', '$2', diff --git a/geonames/geonames.php b/geonames/geonames.php index 668eb0e7..d14b1e8f 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -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) diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index ca5eaaf0..6007c433 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -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); } /** diff --git a/highlightjs/highlightjs.php b/highlightjs/highlightjs.php index c1c2aac8..762f4117 100644 --- a/highlightjs/highlightjs.php +++ b/highlightjs/highlightjs.php @@ -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'; diff --git a/impressum/impressum.php b/impressum/impressum.php index 19ade933..f61d7182 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -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) diff --git a/ldapauth/ldapauth.php b/ldapauth/ldapauth.php index 14686e99..f834b4d5 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -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) diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index b0b2c214..4cd72c83 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -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); } /** diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index c520514c..fc5ebbbe 100644 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -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) diff --git a/phpmailer/phpmailer.php b/phpmailer/phpmailer.php index 5e137b94..f4bb7753 100644 --- a/phpmailer/phpmailer.php +++ b/phpmailer/phpmailer.php @@ -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); } /** diff --git a/piwik/piwik.php b/piwik/piwik.php index b7b49bd4..fc459a87 100644 --- a/piwik/piwik.php +++ b/piwik/piwik.php @@ -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) diff --git a/pnut/pnut.php b/pnut/pnut.php index 32f60f6d..f298997b 100644 --- a/pnut/pnut.php +++ b/pnut/pnut.php @@ -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) diff --git a/public_server/public_server.php b/public_server/public_server.php index 5834f42a..eb7af1e7 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -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) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index d7c2ac32..ffe5f187 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -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) diff --git a/smileybutton/smileybutton.php b/smileybutton/smileybutton.php index ae0e783b..4d0a8d42 100644 --- a/smileybutton/smileybutton.php +++ b/smileybutton/smileybutton.php @@ -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; } @@ -96,7 +96,7 @@ function smileybutton_jot_tool(string &$body) $s .= ''; //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'; } @@ -104,7 +104,7 @@ function smileybutton_jot_tool(string &$body) 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'; } diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index 40f22e0a..90fb5918 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -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) diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 1e9f5c7f..580d73e6 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -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) diff --git a/twitter/twitter.php b/twitter/twitter.php index 10f8a2fb..ea4ae356 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -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)