From 270308822aa48fe789a9deb1ebf20ee7de46e584 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 28 Sep 2017 11:00:44 +0200 Subject: [PATCH] Improve profile layout --- Models/Profile.php | 3 ++- Theme/Backend/profile-single.tpl.php | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Models/Profile.php b/Models/Profile.php index 50b2cce..dd50d31 100644 --- a/Models/Profile.php +++ b/Models/Profile.php @@ -15,6 +15,7 @@ declare(strict_types=1); namespace Modules\Profile\Models; use Modules\Admin\Models\Account; +use Modules\Admin\Models\NullAccount; use Modules\Media\Models\Media; use Modules\Media\Models\NullMedia; @@ -78,7 +79,7 @@ class Profile public function getAccount() : Account { - return $this->account; + return $this->account ?? new NullAccount(); } public function setBirthday(\DateTime $birthday) /* : void */ diff --git a/Theme/Backend/profile-single.tpl.php b/Theme/Backend/profile-single.tpl.php index 7043272..ddcfe98 100644 --- a/Theme/Backend/profile-single.tpl.php +++ b/Theme/Backend/profile-single.tpl.php @@ -29,13 +29,12 @@ echo $this->getData('nav')->render();
-

getHtml('Profile') ?>

+

printHtml($account->getAccount()->getName3()); ?>, printHtml($account->getAccount()->getName1()); ?>

+ <?= $this->getHtml('ProfileImage'); ?> + - -
getHtml('Name') ?><?= $this->getHtml('ProfileImage'); ?> - printHtml($account->getAccount()->getName3()); ?>, printHtml($account->getAccount()->getName1()); ?>
getHtml('Occupation') ?> Sailor