1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 01:11:34 +02:00

Merge pull request #6325 from turbo124/v5-develop

Alternate company logo presenter
This commit is contained in:
David Bomba 2021-07-24 17:29:57 +10:00 committed by GitHub
commit 29d2be3021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,10 @@ class CompanyPresenter extends EntityPresenter
//return $this->entity->name ?: ctrans('texts.untitled_account');
}
public function logo($settings = null)
/*
@deprecated
*/
public function logo2($settings = null)
{
if (! $settings) {
$settings = $this->entity->settings;
@ -45,6 +48,21 @@ class CompanyPresenter extends EntityPresenter
}
public function logo($settings = null)
{
if (! $settings) {
$settings = $this->entity->settings;
}
if(strlen($settings->company_logo) >= 1 && (strpos($settings->company_logo, 'http') !== false))
return "data:image/png;base64, ". base64_encode(file_get_contents($settings->company_logo));
else if(strlen($settings->company_logo) >= 1)
return "data:image/png;base64, ". base64_encode(file_get_contents(url('') . $settings->company_logo));
else
return "data:image/png;base64, ". base64_encode(file_get_contents(asset('images/new_logo.png')));
}
public function address($settings = null)
{
$str = '';