mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
Merge pull request #6325 from turbo124/v5-develop
Alternate company logo presenter
This commit is contained in:
commit
29d2be3021
@ -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 = '';
|
||||
|
Loading…
Reference in New Issue
Block a user