1
0
Fork 0

old boot.php functions replaced in various places

This commit is contained in:
Michael 2022-10-19 05:06:28 +00:00 committed by Hypolite Petovan
commit 11944dda32
20 changed files with 183 additions and 105 deletions

View file

@ -281,7 +281,7 @@ $data = [
'submit' => [
'catavatar-usecat' => DI::l10n()->t('Use Cat as Avatar'),
'catavatar-morecat' => DI::l10n()->t('Another random Cat!'),
'catavatar-emailcat' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
'catavatar-emailcat' => DI::pConfig()->get(Session::getLocalUser(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
],
];
```

View file

@ -30,7 +30,7 @@ function doSomething(array $intros)
}
}
$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => local_user()]);
$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => Session::getLocalUser()]);
doSomething($intros);
```
@ -47,7 +47,7 @@ function doSomething(\Friendica\Contact\Introductions\Collection\Introductions $
}
/** @var $intros \Friendica\Contact\Introductions\Collection\Introductions */
$intros = \Friendica\DI::intro()->selecForUser(local_user());
$intros = \Friendica\DI::intro()->selecForUser(Session::getLocalUser());
doSomething($intros);
```

View file

@ -123,13 +123,13 @@ The selected 1st part will be saved in the database by the theme_post function.
function theme_post(App $a){
// non local users shall not pass
if (! local_user()) {
if (! Session::getLocalUser()) {
return;
}
// if the one specific submit button was pressed then proceed
if (isset($_POST['duepuntozero-settings-submit'])){
// and save the selection key into the personal config of the user
DI::pConfig()->set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
DI::pConfig()->set(Session::getLocalUser(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
}
@ -137,7 +137,7 @@ Now that this information is set in the database, what should friendica do with
For this, have a look at the theme.php file of the *duepunto zero*.
There you'll find somethink alike
$colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset');
$colorset = DI::pConfig()->get( Session::getLocalUser(), 'duepuntozero','colorset');
if (!$colorset)
$colorset = DI::config()->get('duepuntozero', 'colorset');
if ($colorset) {