old boot.functions replaced in /mod

This commit is contained in:
Michael
2022-10-19 04:14:42 +00:00
parent ae82737445
commit 5874de4743
25 changed files with 193 additions and 176 deletions
+8 -7
View File
@@ -22,6 +22,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
@@ -30,7 +31,7 @@ use Friendica\Module\BaseProfile;
function notes_init(App $a)
{
if (! local_user()) {
if (! Session::getLocalUser()) {
return;
}
@@ -40,7 +41,7 @@ function notes_init(App $a)
function notes_content(App $a, bool $update = false)
{
if (!local_user()) {
if (!Session::getLocalUser()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
@@ -52,7 +53,7 @@ function notes_content(App $a, bool $update = false)
$x = [
'lockstate' => 'lock',
'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(local_user(), DI::l10n()->t('Personal notes are visible only by yourself.')),
'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(Session::getLocalUser(), DI::l10n()->t('Personal notes are visible only by yourself.')),
'button' => DI::l10n()->t('Save'),
'acl_data' => '',
];
@@ -60,14 +61,14 @@ function notes_content(App $a, bool $update = false)
$o .= DI::conversation()->statusEditor($x, $a->getContactId());
}
$condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
$condition = ['uid' => Session::getLocalUser(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
'contact-id'=> $a->getContactId()];
if (DI::mode()->isMobile()) {
$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
$itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
} else {
$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
$itemsPerPage = DI::pConfig()->get(Session::getLocalUser(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
}
@@ -75,7 +76,7 @@ function notes_content(App $a, bool $update = false)
$params = ['order' => ['created' => true],
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$r = Post::selectThreadForUser(local_user(), ['uri-id'], $condition, $params);
$r = Post::selectThreadForUser(Session::getLocalUser(), ['uri-id'], $condition, $params);
$count = 0;