Site logo implementation

This commit is contained in:
Diego Najar 2018-12-21 20:16:00 +01:00
parent 7e6a5cd28c
commit 74b68e507a
2 changed files with 2 additions and 2 deletions

View File

@ -475,7 +475,7 @@
<label class="custom-file-label" for="jssiteLogoInputFile"><?php $L->p('Choose images to upload'); ?></label> <label class="custom-file-label" for="jssiteLogoInputFile"><?php $L->p('Choose images to upload'); ?></label>
</div> </div>
<div> <div>
<img id="jssiteLogoPreview" class="img-fluid img-thumbnail" alt="Site logo preview" src="<?php echo (Sanitize::pathFile(PATH_UPLOADS.$site->logo(false))?DOMAIN_UPLOADS.$site->logo(false).'?version='.time():HTML_PATH_ADMIN_THEME_IMG.'default.svg') ?>" /> <img id="jssiteLogoPreview" class="img-fluid img-thumbnail" alt="Site logo preview" src="<?php echo ($site->logo()?DOMAIN_UPLOADS.$site->logo(false).'?version='.time():HTML_PATH_ADMIN_THEME_IMG.'default.svg') ?>" />
</div> </div>
<script> <script>
$("#jssiteLogoInputFile").on("change", function() { $("#jssiteLogoInputFile").on("change", function() {

View File

@ -274,7 +274,7 @@ class Site extends dbJSON {
public function logo($absolute=true) public function logo($absolute=true)
{ {
$logo = $this->getField('logo'); $logo = $this->getField('logo');
if ($absolute) { if ($absolute && $logo) {
return DOMAIN_UPLOADS.$logo; return DOMAIN_UPLOADS.$logo;
} }
return $logo; return $logo;