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;
function vier_init(App $a)
{
- $a->setThemeInfoValue('events_in_profile', false);
-
Renderer::setActiveTemplateEngine('smarty3');
$args = DI::args();
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();
// Hide the left menu bar
/// @TODO maybe move this static array out where it should belong?
- if (empty(DI::page()['aside']) && in_array($args->get(0), ["community", "events", "help", "delegation", "notifications",
+ if (empty(DI::page()['aside']) && in_array($args->get(0), ["community", "calendar", "help", "delegation", "notifications",
"probe", "webfinger", "login", "invite", "credits"])) {
DI::page()['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />";
}
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::getCachedSuggestions(DI::userSession()->getLocalUserId(), 0, 9);
$tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl');
if (DBA::isResult($contacts)) {
foreach ($contacts as $contact) {
$entry = Renderer::replaceMacros($tpl, [
'$id' => $contact['id'],
- '$profile_link' => 'follow/?url='.urlencode($contact['url']),
+ '$profile_link' => 'contact/follow?url=' . urlencode($contact['url']),
'$photo' => Contact::getMicro($contact),
'$alt_text' => $contact['name'],
]);
}
//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