]> git.mxchange.org Git - friendica-addons.git/blobdiff - showmore_dyn/showmore_dyn.php
Merge pull request 'Bluesky: Tags are now supported' (#1438) from heluecht/friendica...
[friendica-addons.git] / showmore_dyn / showmore_dyn.php
index a6f414117c9d4796ab2986790e3708728feb79ff..7cb64bcca7c10fc3a57a984aa068c2573e9d8698 100644 (file)
@@ -24,35 +24,35 @@ function showmore_dyn_install()
        Hook::register('addon_settings_post',  __FILE__, 'showmore_dyn_settings_post');
 }
 
-function showmore_dyn_head(App $a, string &$body)
+function showmore_dyn_head(string &$body)
 {
        DI::page()->registerStylesheet(__DIR__ . '/showmore_dyn.css');
 }
 
-function showmore_dyn_footer(App $a, string &$body)
+function showmore_dyn_footer(string &$body)
 {
        DI::page()->registerFooterScript(__DIR__ . '/showmore_dyn.js');
 }
 
 function showmore_dyn_settings_post()
 {
-       if(!local_user()) {
+       if(!DI::userSession()->getLocalUserId()) {
                return;
        }
 
        if (isset($_POST['showmore_dyn-submit'])) {
-               DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $_POST['limitHeight'] ?? 0);
+               DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', $_POST['limitHeight'] ?? 0);
        }
 }
 
-function showmore_dyn_settings(App &$a, array &$data)
+function showmore_dyn_settings(array &$data)
 {
-       if(!local_user()) {
+       if(!DI::userSession()->getLocalUserId()) {
                return;
        }
 
-       $limitHeight = DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight', 250);
-       DI::pConfig()->set(local_user(), 'showmore_dyn', 'limitHeight', $limitHeight);
+       $limitHeight = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', 250);
+       DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', $limitHeight);
 
        $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/');
        $html = Renderer::replaceMacros($t, [
@@ -68,7 +68,7 @@ function showmore_dyn_settings(App &$a, array &$data)
 
 function showmore_dyn_script()
 {
-       $limitHeight = intval(DI::pConfig()->get(local_user(), 'showmore_dyn', 'limitHeight', 250));
+       $limitHeight = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', 250));
        $showmore_dyn_showmore_linktext = DI::l10n()->t('Show more...');
        DI::page()['htmlhead'] .= <<<EOT
 <script>