UserSession class - Refactor addon
This commit is contained in:
parent
8eca74cfab
commit
b0eb28143a
46 changed files with 534 additions and 580 deletions
|
@ -12,7 +12,6 @@ use Friendica\Core\Hook;
|
|||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
|
||||
|
@ -37,23 +36,23 @@ function showmore_dyn_footer(App $a, string &$body)
|
|||
|
||||
function showmore_dyn_settings_post()
|
||||
{
|
||||
if(!Session::getLocalUser()) {
|
||||
if(!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($_POST['showmore_dyn-submit'])) {
|
||||
DI::pConfig()->set(Session::getLocalUser(), 'showmore_dyn', 'limitHeight', $_POST['limitHeight'] ?? 0);
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', $_POST['limitHeight'] ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
function showmore_dyn_settings(App &$a, array &$data)
|
||||
{
|
||||
if(!Session::getLocalUser()) {
|
||||
if(!DI::userSession()->getLocalUserId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$limitHeight = DI::pConfig()->get(Session::getLocalUser(), 'showmore_dyn', 'limitHeight', 250);
|
||||
DI::pConfig()->set(Session::getLocalUser(), 'showmore_dyn', 'limitHeight', $limitHeight);
|
||||
$limitHeight = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', 250);
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', $limitHeight);
|
||||
|
||||
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/');
|
||||
$html = Renderer::replaceMacros($t, [
|
||||
|
@ -69,7 +68,7 @@ function showmore_dyn_settings(App &$a, array &$data)
|
|||
|
||||
function showmore_dyn_script()
|
||||
{
|
||||
$limitHeight = intval(DI::pConfig()->get(Session::getLocalUser(), 'showmore_dyn', 'limitHeight', 250));
|
||||
$limitHeight = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'showmore_dyn', 'limitHeight', 250));
|
||||
$showmore_dyn_showmore_linktext = DI::l10n()->t('Show more...');
|
||||
DI::page()['htmlhead'] .= <<<EOT
|
||||
<script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue