]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/theme.php
Merge pull request #8053 from nupplaphil/task/remove_get_app
[friendica.git] / view / theme / frio / theme.php
index 9c4205c886d26b260b7894047bc530bcb059c83f..2cd30ad1f1f4e9495fb1f329ccde8e7c68b8f666 100644 (file)
@@ -14,10 +14,10 @@ use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
-use Friendica\Core\PConfig;
 use Friendica\Core\Renderer;
-use Friendica\Core\System;
+use Friendica\Core\Session;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model;
 use Friendica\Module;
 use Friendica\Util\Strings;
@@ -35,13 +35,21 @@ function frio_init(App $a)
 
        // if the device is a mobile device set js is_mobile
        // variable so the js scripts can use this information
-       if ($a->is_mobile || $a->is_tablet) {
-               $a->page['htmlhead'] .= <<< EOT
+       if (DI::mode()->isMobile() || DI::mode()->isMobile()) {
+               DI::page()['htmlhead'] .= <<< EOT
                        <script type="text/javascript">
                                var is_mobile = 1;
                        </script>
 EOT;
        }
+
+       $enable_compose = \Friendica\Core\PConfig::get(local_user(), 'frio', 'enable_compose');
+       $compose = $enable_compose === '1' || $enable_compose === null && Config::get('frio', 'enable_compose') ? 1 : 0;
+       DI::page()['htmlhead'] .= <<< HTML
+               <script type="text/javascript">
+                       var compose = $compose;
+               </script>
+HTML;
 }
 
 function frio_install()
@@ -201,7 +209,7 @@ function frio_remote_nav($a, &$nav)
        // get the homelink from $_XSESSION
        $homelink = Model\Profile::getMyURL();
        if (!$homelink) {
-               $homelink = defaults($_SESSION, 'visitor_home', '');
+               $homelink = Session::get('visitor_home', '');
        }
 
        // split up the url in it's parts (protocol,domain/directory, /profile/, nickname
@@ -232,7 +240,7 @@ function frio_remote_nav($a, &$nav)
                // user info
                $r = q("SELECT `micro` FROM `contact` WHERE `uid` = %d AND `self`", intval($a->user['uid']));
 
-               $r[0]['photo'] = (DBA::isResult($r) ? $a->removeBaseURL($r[0]['micro']) : 'images/person-48.jpg');
+               $r[0]['photo'] = (DBA::isResult($r) ? DI::baseUrl()->remove($r[0]['micro']) : 'images/person-48.jpg');
                $r[0]['name'] = $a->user['username'];
        } elseif (!local_user() && remote_user()) {
                $r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));