Fix profile loading and style

This commit is contained in:
Dennis Eichhorn 2019-10-05 20:07:45 +02:00
parent 56264b6dc1
commit 6d07806a0a
3 changed files with 7 additions and 5 deletions

View File

@ -103,7 +103,7 @@ final class BackendController extends Controller
$calendarView->setTemplate('/Modules/Calendar/Theme/Backend/Components/Calendar/mini');
$view->addData('calendar', $calendarView);
$view->setData('account', ProfileMapper::getFor((int) $request->getData('id'), 'account'));
$view->setData('account', ProfileMapper::get((int) $request->getData('id')));
$accGrpSelector = new \Modules\Profile\Theme\Backend\Components\AccountGroupSelector\BaseView($this->app, $request, $response);
$view->addData('accGrpSelector', $accGrpSelector);

View File

@ -22,6 +22,6 @@ namespace Modules\Profile\Models;
* @link https://orange-management.org
* @since 1.0.0
*/
class NullProfile extends Profile
final class NullProfile extends Profile
{
}

View File

@ -16,8 +16,7 @@ use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
*/
$account = $this->getData('account');
$account = $this->getData('account');
$settings = $this->getData('settings') ?? [];
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
@ -66,7 +65,10 @@ echo $this->getData('nav')->render();
<img class="m-profile rf"
alt="<?= $this->getHtml('ProfileImage'); ?>"
itemprop="logo"
data-lazyload="<?= $account->getImage() instanceof NullMedia ? UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') : UriFactory::build('{/prefix}' . $account->getImage()->getPath()); ?>"
data-lazyload="<?=
$account->getImage() instanceof NullMedia ?
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
UriFactory::build('{/prefix}' . $account->getImage()->getPath()); ?>"
>
</span>
<table class="list" style="table-layout: fixed">