Remove helper function "get_string_replaced"
This commit is contained in:
parent
56e63b8c38
commit
7f46e1510b
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Exceptions\PrettyPageException;
|
||||
use App\Services;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
|
|
|
|||
|
|
@ -49,16 +49,11 @@ class ViewServiceProvider extends ServiceProvider
|
|||
View::composer('shared.user-panel', Composers\UserPanelComposer::class);
|
||||
|
||||
View::composer('shared.copyright', function ($view) {
|
||||
$customCopyright = get_string_replaced(
|
||||
option_localized('copyright_text'),
|
||||
[
|
||||
'{site_name}' => option_localized('site_name'),
|
||||
'{site_url}' => option('site_url'),
|
||||
]
|
||||
);
|
||||
$view->with([
|
||||
'copyright' => option_localized('copyright_prefer', 0),
|
||||
'custom_copyright' => $customCopyright,
|
||||
'custom_copyright' => option_localized('copyright_text'),
|
||||
'site_name' => option_localized('site_name'),
|
||||
'site_url' => option('site_url'),
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -83,20 +83,6 @@ if (!function_exists('option_localized')) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!function_exists('get_string_replaced')) {
|
||||
/**
|
||||
* Replace content of string according to given rules.
|
||||
*/
|
||||
function get_string_replaced(string $str, array $rules): string
|
||||
{
|
||||
foreach ($rules as $search => $replace) {
|
||||
$str = str_replace($search, $replace, $str);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('png')) {
|
||||
function png($resource)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{ custom_copyright|raw }}
|
||||
{% set rules = {'{site_name}': site_name, '{site_url}': site_url} %}
|
||||
{{ custom_copyright|replace(rules)|raw }}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user