diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 3a31641..0efafd8 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -77,6 +77,11 @@ final class BackendController extends Controller $view->setData('accounts', ProfileMapper::getAfterPivot(0, null, 25)); } + $profileImage = $this->app->appSettings->get(null, 'default_profile_image', 'Profile'); + $image = MediaMapper::get((int) $profileImage['content']); + + $view->setData('defaultImage', $image); + return $view; } @@ -122,6 +127,11 @@ final class BackendController extends Controller $media = MediaMapper::getFor((int) $profile->account->getId(), 'createdBy'); $view->setData('media', $media instanceof NullMedia ? [] : (!\is_array($media) ? [$media] : $media)); + $profileImage = $this->app->appSettings->get(null, 'default_profile_image', 'Profile'); + $image = MediaMapper::get((int) $profileImage['content']); + + $view->setData('defaultImage', $image); + return $view; } diff --git a/Theme/Backend/Components/AccountGroupSelector/base.tpl.php b/Theme/Backend/Components/AccountGroupSelector/base.tpl.php index 9bd6baf..606aefb 100755 --- a/Theme/Backend/Components/AccountGroupSelector/base.tpl.php +++ b/Theme/Backend/Components/AccountGroupSelector/base.tpl.php @@ -1,54 +1,56 @@ -
-
- - -
- - -
-
diff --git a/Theme/Backend/profile-list.tpl.php b/Theme/Backend/profile-list.tpl.php index 5d86d6c..767067e 100755 --- a/Theme/Backend/profile-list.tpl.php +++ b/Theme/Backend/profile-list.tpl.php @@ -57,19 +57,21 @@ $next = empty($accounts) ? '{/prefix}profile/list' : '{/prefix}profile/list? - $account) : ++$count; - $url = UriFactory::build('{/prefix}profile/single?{?}&id=' . $account->getId()); ?> + $account) : ++$count; + $url = UriFactory::build('{/prefix}profile/single?{?}&id=' . $account->getId()); + ?> + $account->image instanceof NullMedia + ? UriFactory::build('{/prefix}' . $this->getData('defaultImage')->getPath()) + : UriFactory::build('{/prefix}' . $account->image->getPath()); ?>"> printHtml($account->account->name3 . ' ' . $account->account->name2 . ' ' . $account->account->name1); ?> - printHtml($account->account->getLastActive()->format('Y-m-d')); ?> + printHtml($account->account->getLastActive()->format('Y-m-d')); ?> - getHtml('Empty', '0', '0'); ?> + getHtml('Empty', '0', '0'); ?>
diff --git a/Theme/Backend/profile-single.tpl.php b/Theme/Backend/profile-single.tpl.php index aafa8c2..45db56f 100755 --- a/Theme/Backend/profile-single.tpl.php +++ b/Theme/Backend/profile-single.tpl.php @@ -71,9 +71,9 @@ echo $this->getData('nav')->render(); alt="getHtml('ProfileImage'); ?>" itemprop="logo" loading="lazy" src="image instanceof NullMedia ? - UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') : - UriFactory::build('{/prefix}' . $profile->image->getPath()); ?>" + $profile->image instanceof NullMedia + ? UriFactory::build('{/prefix}' . $this->getData('defaultImage')->getPath()) + : UriFactory::build('{/prefix}' . $profile->image->getPath()); ?>" width="100px">
request->header->account === $account->getId()) : ?>