]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/theme.php
Merge pull request #9687 from annando/drop-unused
[friendica.git] / view / theme / frio / theme.php
index dcbeccc301ee487598af535aa44e0ffd0999be91..4c37e42e734518a7c5d1f6e251edf2bfdda4f1f7 100644 (file)
@@ -21,6 +21,12 @@ use Friendica\Model\Contact;
 use Friendica\Module;
 use Friendica\Util\Strings;
 
+const FRIO_SCHEME_ACCENT_BLUE   = '#1e87c2';
+const FRIO_SCHEME_ACCENT_RED    = '#b50404';
+const FRIO_SCHEME_ACCENT_PURPLE = '#a54bad';
+const FRIO_SCHEME_ACCENT_GREEN  = '#218f39';
+const FRIO_SCHEME_ACCENT_PINK   = '#d900a9';
+
 function frio_init(App $a)
 {
        global $frio;
@@ -195,13 +201,12 @@ function frio_remote_nav($a, &$nav)
        // this isn't optimal because the contact query will be done now twice
        $fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl'];
        if (local_user() && !empty($a->user['uid'])) {
-               $remoteUser = Contact::getById($a->user['uid'], $fields);
-               $remoteUser['name'] = $a->user['username'];
+               $remoteUser = Contact::selectFirst($fields, ['uid' => $a->user['uid'], 'self' => true]);
        } elseif (!local_user() && remote_user()) {
                $remoteUser = Contact::getById(remote_user(), $fields);
                $nav['remote'] = DI::l10n()->t('Guest');
        } elseif (Model\Profile::getMyURL()) {
-               $remoteUser = Contact::getByURL($homelink, $fields);
+               $remoteUser = Contact::getByURL($homelink, null, $fields);
                $nav['remote'] = DI::l10n()->t('Visitor');
        } else {
                $remoteUser = null;
@@ -320,51 +325,3 @@ function frio_display_item(App $a, &$arr)
        }
        $arr['output']['subthread'] = $subthread;
 }
-
-/**
- * @param int|null $uid
- * @return string
- * @see \Friendica\Core\Theme::getBackgroundColor()
- */
-function frio_get_background_color(int $uid = null)
-{
-       $background_color = DI::config()->get('frio', 'background_color') ?: '#ededed';
-
-       if ($uid) {
-               $background_color = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $background_color;
-       }
-
-       $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema'));
-       $scheme = Strings::sanitizeFilePathItem($scheme);
-
-       if ($scheme && ($scheme != '---') && file_exists('view/theme/frio/scheme/' . $scheme . '.php')) {
-               $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php';
-               require_once $schemefile;
-       }
-
-       return $background_color;
-}
-
-/**
- * @param int|null $uid
- * @return string
- * @see \Friendica\Core\Theme::getThemeColor()
- */
-function frio_get_theme_color(int $uid = null)
-{
-       $nav_bg = DI::config()->get('frio', 'nav_bg') ?: '#708fa0';
-
-       if ($uid) {
-               $nav_bg = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $nav_bg;
-       }
-
-       $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema'));
-       $scheme = Strings::sanitizeFilePathItem($scheme);
-
-       if ($scheme && ($scheme != '---') && file_exists('view/theme/frio/scheme/' . $scheme . '.php')) {
-               $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php';
-               require_once $schemefile;
-       }
-
-       return $nav_bg;
-}