*/
function setting($key = null, $default = false)
{
- $settingService = app(\BookStack\Services\SettingService::class);
+ $settingService = resolve(\BookStack\Services\SettingService::class);
if (is_null($key)) return $settingService;
return $settingService->get($key, $default);
}
return app('redirect')->to($to, $status, $headers, $secure);
}
+function icon($name, $attrs = []) {
+ $iconPath = resource_path('assets/icons/' . $name . '.svg');
+ $attrString = ' ';
+ foreach ($attrs as $attrName => $attr) {
+ $attrString .= $attrName . '="' . $attr . '" ';
+ }
+ $fileContents = file_get_contents($iconPath);
+ return str_replace('<svg', '<svg' . $attrString, $fileContents);
+}
+
/**
* Generate a url with multiple parameters for sorting purposes.
* Works out the logic to set the correct sorting direction
if (count($queryStringSections) === 0) return $path;
return baseUrl($path . '?' . implode('&', $queryStringSections));
-}
+}
\ No newline at end of file