use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
function theme_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
+ $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset');
$user = true;
return clean_form($a, $colorset, $user);
function theme_post(App $a)
{
- if (! Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
if (isset($_POST['duepuntozero-settings-submit'])) {
- DI::pConfig()->set(Session::getLocalUser(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
}
];
if ($user) {
- $color = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
+ $color = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset');
} else {
$color = DI::config()->get('duepuntozero', 'colorset');
}
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
/*
$colorset = null;
if (DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
- $colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero', 'colorset');
+ $colorset = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'duepuntozero', 'colorset');
if (!$colorset)
$colorset = DI::config()->get('duepuntozero', 'colorset'); // user setting have priority, then node settings
}
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
require_once 'view/theme/frio/php/Image.php';
function theme_post(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
'always_open_compose',
] as $field) {
if (isset($_POST['frio_' . $field])) {
- DI::pConfig()->set(Session::getLocalUser(), 'frio', $field, $_POST['frio_' . $field]);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'frio', $field, $_POST['frio_' . $field]);
}
}
- DI::pConfig()->set(Session::getLocalUser(), 'frio', 'css_modified', time());
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'frio', 'css_modified', time());
}
}
function theme_content(): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
$arr = [
- 'scheme' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme',
- DI::pConfig()->get(Session::getLocalUser(), 'frio', 'schema',
+ 'scheme' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme',
+ DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema',
DI::config()->get('frio', 'scheme',
DI::config()->get('frio', 'schema')
)
),
'share_string' => '',
- 'scheme_accent' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')),
- 'nav_bg' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')),
- 'nav_icon_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')),
- 'link_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')),
- 'background_color' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')),
- 'contentbg_transp' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')),
- 'background_image' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')),
- 'bg_image_option' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')),
- 'always_open_compose' => DI::pConfig()->get(Session::getLocalUser(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)),
+ 'scheme_accent' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme_accent' , DI::config()->get('frio', 'scheme_accent')),
+ 'nav_bg' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'nav_bg' , DI::config()->get('frio', 'nav_bg')),
+ 'nav_icon_color' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'nav_icon_color' , DI::config()->get('frio', 'nav_icon_color')),
+ 'link_color' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'link_color' , DI::config()->get('frio', 'link_color')),
+ 'background_color' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'background_color' , DI::config()->get('frio', 'background_color')),
+ 'contentbg_transp' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'contentbg_transp' , DI::config()->get('frio', 'contentbg_transp')),
+ 'background_image' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'background_image' , DI::config()->get('frio', 'background_image')),
+ 'bg_image_option' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option')),
+ 'always_open_compose' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)),
];
return frio_form($arr);
function theme_admin(): string
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return '';
}
* 'overwrites' => Variables which overwriting custom settings
*/
-use Friendica\Core\Session;
use Friendica\DI;
use Friendica\Util\Strings;
$theme = DI::app()->getCurrentTheme();
$themepath = 'view/theme/' . $theme . '/';
if (empty($scheme)) {
- $scheme = DI::pConfig()->get(Session::getLocalUser(), 'frio', 'scheme', DI::pConfig()->get(Session::getLocalUser(), 'frio', 'schema', '---'));
+ $scheme = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'scheme', DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'frio', 'schema', '---'));
}
$scheme = Strings::sanitizeFilePathItem($scheme);
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model;
$fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'];
if ($a->isLoggedIn()) {
$remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]);
- } elseif (!Session::getLocalUser() && Session::getRemoteUser()) {
- $remoteUser = Contact::getById(Session::getRemoteUser(), $fields);
+ } elseif (!DI::userSession()->getLocalUserId() && DI::userSession()->getRemoteUserId()) {
+ $remoteUser = Contact::getById(DI::userSession()->getRemoteUserId(), $fields);
$nav_info['nav']['remote'] = DI::l10n()->t('Guest');
} elseif (Profile::getMyURL()) {
$remoteUser = Contact::getByURL($homelink, null, $fields);
$server_url = $remoteUser['baseurl'];
}
- if (!Session::getLocalUser() && !empty($server_url) && !is_null($remoteUser)) {
+ if (!DI::userSession()->getLocalUserId() && !empty($server_url) && !is_null($remoteUser)) {
// user menu
$nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
$nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
// Add follow to the item menu
$followThread = [];
if (
- Session::getLocalUser()
- && in_array($arr['item']['uid'], [0, Session::getLocalUser()])
+ DI::userSession()->getLocalUserId()
+ && in_array($arr['item']['uid'], [0, DI::userSession()->getLocalUserId()])
&& $arr['item']['gravity'] == Item::GRAVITY_PARENT
&& !$arr['item']['self']
&& !$arr['item']['mention']
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
function theme_content(App $a) {
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- $align = DI::pConfig()->get(Session::getLocalUser(), 'quattro', 'align' );
- $color = DI::pConfig()->get(Session::getLocalUser(), 'quattro', 'color' );
- $tfs = DI::pConfig()->get(Session::getLocalUser(),"quattro","tfs");
- $pfs = DI::pConfig()->get(Session::getLocalUser(),"quattro","pfs");
+ $align = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'quattro', 'align' );
+ $color = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'quattro', 'color' );
+ $tfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","tfs");
+ $pfs = DI::pConfig()->get(DI::userSession()->getLocalUserId(),"quattro","pfs");
return quattro_form($a,$align, $color, $tfs, $pfs);
}
function theme_post(App $a) {
- if (! Session::getLocalUser()) {
+ if (! DI::userSession()->getLocalUserId()) {
return;
}
if (isset($_POST['quattro-settings-submit'])){
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'align', $_POST['quattro_align']);
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'color', $_POST['quattro_color']);
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'tfs', $_POST['quattro_tfs']);
- DI::pConfig()->set(Session::getLocalUser(), 'quattro', 'pfs', $_POST['quattro_pfs']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'align', $_POST['quattro_align']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'color', $_POST['quattro_color']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'tfs', $_POST['quattro_tfs']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'quattro', 'pfs', $_POST['quattro_pfs']);
}
}
use Friendica\App;
use Friendica\Core\Renderer;
-use Friendica\Core\Session;
use Friendica\DI;
require_once __DIR__ . '/theme.php';
function theme_content(App $a)
{
- if (!Session::getLocalUser()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
return;
}
- $style = DI::pConfig()->get(Session::getLocalUser(), 'vier', 'style');
+ $style = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'vier', 'style');
if ($style == "") {
$style = DI::config()->get('vier', 'style');
function theme_post(App $a)
{
- if (! Session::getLocalUser()) {
+ if (! DI::userSession()->getLocalUserId()) {
return;
}
if (isset($_POST['vier-settings-submit'])) {
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'style', $_POST['vier_style']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_pages', $_POST['vier_show_pages']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_helpers', $_POST['vier_show_helpers']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_services', $_POST['vier_show_services']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_friends', $_POST['vier_show_friends']);
- DI::pConfig()->set(Session::getLocalUser(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'style', $_POST['vier_style']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_pages', $_POST['vier_show_pages']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_helpers', $_POST['vier_show_helpers']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_services', $_POST['vier_show_services']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_friends', $_POST['vier_show_friends']);
+ DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'vier', 'show_lastusers', $_POST['vier_show_lastusers']);
}
}
use Friendica\Core\Addon;
use Friendica\Core\Renderer;
use Friendica\Core\Search;
-use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
DI::mode()->has(App\Mode::MAINTENANCEDISABLED)
&& (
$args->get(0) === 'profile' && $args->get(1) === ($a->getLoggedInUserNickname() ?? '')
- || $args->get(0) === 'network' && Session::getLocalUser()
+ || $args->get(0) === 'network' && DI::userSession()->getLocalUserId()
)
) {
vier_community_info();
function get_vier_config($key, $default = false, $admin = false)
{
- if (Session::getLocalUser() && !$admin) {
- $result = DI::pConfig()->get(Session::getLocalUser(), "vier", $key);
+ if (DI::userSession()->getLocalUserId() && !$admin) {
+ $result = DI::pConfig()->get(DI::userSession()->getLocalUserId(), "vier", $key);
if (!is_null($result)) {
return $result;
}
// comunity_profiles
if ($show_profiles) {
- $contacts = Contact\Relation::getSuggestions(Session::getLocalUser(), 0, 9);
+ $contacts = Contact\Relation::getSuggestions(DI::userSession()->getLocalUserId(), 0, 9);
$tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl');
if (DBA::isResult($contacts)) {
}
//right_aside FIND FRIENDS
- if ($show_friends && Session::getLocalUser()) {
+ if ($show_friends && DI::userSession()->getLocalUserId()) {
$nv = [];
$nv['findpeople'] = DI::l10n()->t('Find People');
$nv['desc'] = DI::l10n()->t('Enter name or interest');
}
//Community_Pages at right_aside
- if ($show_pages && Session::getLocalUser()) {
- $aside['$page'] = ForumManager::widget('network/forum', Session::getLocalUser());;
+ if ($show_pages && DI::userSession()->getLocalUserId()) {
+ $aside['$page'] = ForumManager::widget('network/forum', DI::userSession()->getLocalUserId());;
}
// END Community Page