Merge pull request #13668 from annando/issue-8542

Issue 8542: User option to display the event list/birthday notification
This commit is contained in:
Hypolite Petovan 2023-11-25 10:26:34 -05:00 committed by GitHub
commit c649230982
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 182 additions and 169 deletions

View file

@ -231,9 +231,9 @@ class Network extends Timeline
} else {
$this->systemMessages->addNotice($this->l10n->t('Invalid contact.'));
}
} elseif (!$this->config->get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays();
$o .= Profile::getEventsReminderHTML();
} elseif (Profile::shouldDisplayEventList($this->session->getLocalUserId(), $this->mode)) {
$o .= Profile::getBirthdays($this->session->getLocalUserId());
$o .= Profile::getEventsReminderHTML($this->session->getLocalUserId(), $this->session->getPublicContactId());
}
try {

View file

@ -220,9 +220,9 @@ class Conversations extends BaseProfile
$last_updated_array[$last_updated_key] = time();
$this->session->set('last_updated', $last_updated_array);
if ($is_owner && !$this->config->get('theme', 'hide_eventlist')) {
$o .= ProfileModel::getBirthdays();
$o .= ProfileModel::getEventsReminderHTML();
if ($is_owner && ProfileModel::shouldDisplayEventList($this->session->getLocalUserId(), $this->mode)) {
$o .= ProfileModel::getBirthdays($this->session->getLocalUserId());
$o .= ProfileModel::getEventsReminderHTML($this->session->getLocalUserId(), $this->session->getPublicContactId());
}
if ($is_owner) {

View file

@ -108,6 +108,7 @@ class Display extends BaseSettings
$display_resharer = (bool)$request['display_resharer'];
$stay_local = (bool)$request['stay_local'];
$show_page_drop = (bool)$request['show_page_drop'];
$display_eventlist = (bool)$request['display_eventlist'];
$preview_mode = (int)$request['preview_mode'];
$browser_update = (int)$request['browser_update'];
if ($browser_update != -1) {
@ -158,6 +159,7 @@ class Display extends BaseSettings
$this->pConfig->set($uid, 'system', 'display_resharer' , $display_resharer);
$this->pConfig->set($uid, 'system', 'stay_local' , $stay_local);
$this->pConfig->set($uid, 'system', 'show_page_drop' , $show_page_drop);
$this->pConfig->set($uid, 'system', 'display_eventlist' , $display_eventlist);
$this->pConfig->set($uid, 'system', 'preview_mode' , $preview_mode);
$this->pConfig->set($uid, 'system', 'network_timelines' , $network_timelines);
@ -251,6 +253,7 @@ class Display extends BaseSettings
$display_resharer = $this->pConfig->get($uid, 'system', 'display_resharer', false);
$stay_local = $this->pConfig->get($uid, 'system', 'stay_local', false);
$show_page_drop = $this->pConfig->get($uid, 'system', 'show_page_drop', true);
$display_eventlist = $this->pConfig->get($uid, 'system', 'display_eventlist', true);
$preview_mode = $this->pConfig->get($uid, 'system', 'preview_mode', BBCode::PREVIEW_LARGE);
$preview_modes = [
@ -329,6 +332,7 @@ class Display extends BaseSettings
'$display_resharer' => ['display_resharer' , $this->t('Display the resharer'), $display_resharer, $this->t('Display the first resharer as icon and text on a reshared item.')],
'$stay_local' => ['stay_local' , $this->t('Stay local'), $stay_local, $this->t("Don't go to a remote system when following a contact link.")],
'$show_page_drop' => ['show_page_drop' , $this->t('Show the post deletion checkbox'), $show_page_drop, $this->t("Display the checkbox for the post deletion on the network page.")],
'$display_eventlist' => ['display_eventlist' , $this->t('DIsplay the event list'), $display_eventlist, $this->t("Display the birthday reminder and event list on the network page.")],
'$preview_mode' => ['preview_mode' , $this->t('Link preview mode'), $preview_mode, $this->t('Appearance of the link preview that is added to each post with a link.'), $preview_modes, false],
'$timeline_label' => $this->t('Label'),

View file

@ -104,9 +104,9 @@ class Profile extends BaseModule
$last_updated_array[$last_updated_key] = time();
DI::session()->set('last_updated', $last_updated_array);
if ($is_owner && !$a->getProfileOwner() && !DI::config()->get('theme', 'hide_eventlist')) {
$o .= ProfileModel::getBirthdays();
$o .= ProfileModel::getEventsReminderHTML();
if ($is_owner && !$a->getProfileOwner() && ProfileModel::shouldDisplayEventList(DI::userSession()->getLocalUserId(), DI::mode())) {
$o .= ProfileModel::getBirthdays(DI::userSession()->getLocalUserId());
$o .= ProfileModel::getEventsReminderHTML(DI::userSession()->getLocalUserId(), DI::userSession()->getPublicContactId());
}
if ($is_owner) {