mirror of
https://github.com/Karaka-Management/oms-Profile.git
synced 2026-02-18 00:08:41 +00:00
create default profile image
This commit is contained in:
parent
4c28981f1f
commit
08d382cfce
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<div>
|
||||
<div class="ipt-wrap wf-100">
|
||||
<div class="ipt-first">
|
||||
<span class="input">
|
||||
|
|
@ -52,3 +53,4 @@
|
|||
</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -57,14 +57,16 @@ $next = empty($accounts) ? '{/prefix}profile/list' : '{/prefix}profile/list?
|
|||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach ($accounts as $key => $account) : ++$count;
|
||||
$url = UriFactory::build('{/prefix}profile/single?{?}&id=' . $account->getId()); ?>
|
||||
<?php $count = 0;
|
||||
foreach ($accounts as $key => $account) : ++$count;
|
||||
$url = UriFactory::build('{/prefix}profile/single?{?}&id=' . $account->getId());
|
||||
?>
|
||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><img width="30" loading="lazy" class="profile-image"
|
||||
src="<?=
|
||||
$account->image instanceof NullMedia ?
|
||||
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
|
||||
UriFactory::build('{/prefix}' . $account->image->getPath()); ?>"></a>
|
||||
$account->image instanceof NullMedia
|
||||
? UriFactory::build('{/prefix}' . $this->getData('defaultImage')->getPath())
|
||||
: UriFactory::build('{/prefix}' . $account->image->getPath()); ?>"></a>
|
||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->account->name3 . ' ' . $account->account->name2 . ' ' . $account->account->name1); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Activity'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($account->account->getLastActive()->format('Y-m-d')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
|
|
@ -71,9 +71,9 @@ echo $this->getData('nav')->render();
|
|||
alt="<?= $this->getHtml('ProfileImage'); ?>"
|
||||
itemprop="logo" loading="lazy"
|
||||
src="<?=
|
||||
$profile->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"></div>
|
||||
<?php if ($this->request->header->account === $account->getId()) : ?>
|
||||
<div><a id="iProfileUploadButton" href="#upload" data-action='[
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user