@include('App::layouts.themes.header-right')
diff --git a/app/Themes/CodeFec/resources/views/layouts/themes/header-7.blade.php b/app/Themes/CodeFec/resources/views/layouts/themes/header-7.blade.php
index bcb3c76b2..293c056a2 100755
--- a/app/Themes/CodeFec/resources/views/layouts/themes/header-7.blade.php
+++ b/app/Themes/CodeFec/resources/views/layouts/themes/header-7.blade.php
@@ -15,8 +15,8 @@
@include('App::layouts.themes.header-right')
diff --git a/app/Themes/CodeFec/resources/views/layouts/themes/header-8.blade.php b/app/Themes/CodeFec/resources/views/layouts/themes/header-8.blade.php
index d0bf276aa..e3818ca8a 100755
--- a/app/Themes/CodeFec/resources/views/layouts/themes/header-8.blade.php
+++ b/app/Themes/CodeFec/resources/views/layouts/themes/header-8.blade.php
@@ -15,8 +15,8 @@
@include('App::layouts.themes.header-right')
diff --git a/app/helpers.php b/app/helpers.php
index f60e6646d..e12796a88 100755
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -1,7 +1,6 @@
get(Redis::class);
@@ -94,7 +93,7 @@ function redis()
/*
* server 实例 基于 swoole server
*/
-if (!function_exists('server')) {
+if (! function_exists('server')) {
function server()
{
return container()->get(ServerFactory::class)->getServer()->getServer();
@@ -104,7 +103,7 @@ function server()
/*
* 缓存实例 简单的缓存
*/
-if (!function_exists('cache')) {
+if (! function_exists('cache')) {
function cache()
{
return container()->get(Psr\SimpleCache\CacheInterface::class);
@@ -114,7 +113,7 @@ function cache()
/*
* 控制台日志
*/
-if (!function_exists('stdLog')) {
+if (! function_exists('stdLog')) {
function stdLog()
{
return container()->get(StdoutLoggerInterface::class);
@@ -124,49 +123,49 @@ function stdLog()
/*
* 文件日志
*/
-if (!function_exists('logger')) {
+if (! function_exists('logger')) {
function logger()
{
return container()->get(LoggerFactory::class)->make();
}
}
-if (!function_exists('response')) {
+if (! function_exists('response')) {
function response()
{
return container()->get(ResponseInterface::class);
}
}
-if (!function_exists('PsrResponse')) {
+if (! function_exists('PsrResponse')) {
function PsrResponse()
{
return container()->get(\Psr\Http\Message\ResponseInterface::class);
}
}
-if (!function_exists('ResponseObj')) {
+if (! function_exists('ResponseObj')) {
function ResponseObj(): Response
{
return new Response();
}
}
-if (!function_exists('SwooleStream')) {
+if (! function_exists('SwooleStream')) {
function SwooleStream($contents): SwooleStream
{
return new SwooleStream($contents);
}
}
-if (!function_exists('request')) {
+if (! function_exists('request')) {
function request(): Hyperf\HttpServer\Request
{
return new Hyperf\HttpServer\Request();
}
}
-if (!function_exists('path_class')) {
+if (! function_exists('path_class')) {
function path_class()
{
$path = request()->path();
@@ -179,14 +178,14 @@ function path_class()
}
}
-if (!function_exists('menu')) {
+if (! function_exists('menu')) {
function menu()
{
return \Hyperf\Utils\ApplicationContext::getContainer()->get(MenuInterface::class);
}
}
-if (!function_exists('view')) {
+if (! function_exists('view')) {
function view(string $view, array $data = [], int $code = 200)
{
$container = \Hyperf\Utils\ApplicationContext::getContainer();
@@ -194,12 +193,12 @@ function view(string $view, array $data = [], int $code = 200)
if (env('APP_ENV') === 'dev') {
return $result;
}
- $body = minify_html((string)$result->getBody());
+ $body = minify_html((string) $result->getBody());
return $container->get(RenderInterface::class)->renderR($body, $code);
}
}
-if (!function_exists('menu_pd')) {
+if (! function_exists('menu_pd')) {
function menu_pd($id)
{
$i = 0;
@@ -214,7 +213,7 @@ function menu_pd($id)
}
}
-if (!function_exists('menu_pdArr')) {
+if (! function_exists('menu_pdArr')) {
function menu_pdArr($id)
{
$arr = [];
@@ -229,8 +228,8 @@ function menu_pdArr($id)
}
}
-if (!function_exists('Json_Api')) {
- function Json_Api(int $code = 200, bool $success = true, object|array|string $result = []): array
+if (! function_exists('Json_Api')) {
+ function Json_Api(int $code = 200, bool $success = true, object | array | string $result = []): array
{
return [
'code' => $code,
@@ -241,7 +240,7 @@ function Json_Api(int $code = 200, bool $success = true, object|array|string $re
}
}
-if (!function_exists('session')) {
+if (! function_exists('session')) {
function session()
{
return \Hyperf\Utils\ApplicationContext::getContainer()->get(SessionInterface::class);
@@ -249,10 +248,10 @@ function session()
}
// 获取目录下的所有文件夹
-if (!function_exists('getPath')) {
+if (! function_exists('getPath')) {
function getPath($path)
{
- if (!is_dir($path)) {
+ if (! is_dir($path)) {
return false;
}
$arr = [];
@@ -266,37 +265,37 @@ function getPath($path)
}
}
-if (!function_exists('plugin_path')) {
+if (! function_exists('plugin_path')) {
function plugin_path($path = null): string
{
- if (!$path) {
+ if (! $path) {
return BASE_PATH . '/app/Plugins';
}
return BASE_PATH . '/app/Plugins/' . $path;
}
}
-if (!function_exists('theme_path')) {
+if (! function_exists('theme_path')) {
function theme_path($path = null): string
{
- if (!$path) {
+ if (! $path) {
return BASE_PATH . '/app/Themes';
}
return BASE_PATH . '/app/Themes/' . $path;
}
}
-if (!function_exists('lang_path')) {
+if (! function_exists('lang_path')) {
function lang_path($path = null): string
{
- if (!$path) {
+ if (! $path) {
return BASE_PATH . '/app/Languages';
}
return BASE_PATH . '/app/Languages/' . $path;
}
}
-if (!function_exists('read_file')) {
+if (! function_exists('read_file')) {
function read_file($file_path): ?string
{
if (file_exists($file_path)) {
@@ -307,12 +306,12 @@ function read_file($file_path): ?string
}
}
-if (!function_exists('admin_abort')) {
+if (! function_exists('admin_abort')) {
/**
* @param array|string $data
* @return \Psr\Http\Message\ResponseInterface
*/
- function admin_abort(array|string $data, int $code = 403, string $redirect = null): Psr\Http\Message\ResponseInterface
+ function admin_abort(array | string $data, int $code = 403, string $redirect = null): Psr\Http\Message\ResponseInterface
{
if (is_string($data)) {
$array = ['msg' => $data];
@@ -328,7 +327,7 @@ function admin_abort(array|string $data, int $code = 403, string $redirect = nul
}
}
-if (!function_exists('get_plugins_doc')) {
+if (! function_exists('get_plugins_doc')) {
function get_plugins_doc($class): array
{
$re = new ReflectionClass(new $class());
@@ -353,7 +352,7 @@ function get_plugins_doc($class): array
}
}
-if (!function_exists('deldir')) {
+if (! function_exists('deldir')) {
function deldir($path)
{
//如果是目录则继续
@@ -382,7 +381,7 @@ function deldir($path)
}
}
-if (!function_exists('copy_dir')) {
+if (! function_exists('copy_dir')) {
function copy_dir($src, $dst)
{
$dir = opendir($src);
@@ -401,14 +400,14 @@ function copy_dir($src, $dst)
}
}
-if (!function_exists('verify_ip')) {
+if (! function_exists('verify_ip')) {
function verify_ip($realip)
{
return filter_var($realip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
}
}
-if (!function_exists('get_client_ip')) {
+if (! function_exists('get_client_ip')) {
function get_client_ip()
{
/**
@@ -435,7 +434,7 @@ function get_client_ip()
}
}
-if (!function_exists('make_page')) {
+if (! function_exists('make_page')) {
function make_page($page, $default = 'default'): Psr\Http\Message\ResponseInterface
{
$window = UrlWindow::make($page);
@@ -451,20 +450,20 @@ function make_page($page, $default = 'default'): Psr\Http\Message\ResponseInterf
}
}
-if (!function_exists('get_options')) {
+if (! function_exists('get_options')) {
function get_options($name, $default = '')
{
- if (!cache()->has('admin.options.' . $name)) {
+ if (! cache()->has('admin.options.' . $name)) {
cache()->set('admin.options.' . $name, @AdminOption::query()->where('name', $name)->first()->value);
}
return core_default(cache()->get('admin.options.' . $name), $default);
}
}
-if (!function_exists('get_options_nocache')) {
+if (! function_exists('get_options_nocache')) {
function get_options_nocache($name, $default = '')
{
- if (!AdminOption::query()->where('name', $name)->exists() || !AdminOption::query()->where('name', $name)->first()->value) {
+ if (! AdminOption::query()->where('name', $name)->exists() || ! AdminOption::query()->where('name', $name)->first()->value) {
return $default;
}
@@ -472,7 +471,7 @@ function get_options_nocache($name, $default = '')
}
}
-if (!function_exists('options_clear')) {
+if (! function_exists('options_clear')) {
function options_clear()
{
foreach (AdminOption::query()->get() as $value) {
@@ -481,14 +480,14 @@ function options_clear()
}
}
-if (!function_exists('admin_auth')) {
+if (! function_exists('admin_auth')) {
function admin_auth(): Admin
{
return new Admin();
}
}
-if (!function_exists('de_stringify')) {
+if (! function_exists('de_stringify')) {
function de_stringify(string $stringify): array
{
$result = [];
@@ -501,13 +500,13 @@ function de_stringify(string $stringify): array
}
}
-if (!function_exists('csrf_token')) {
+if (! function_exists('csrf_token')) {
function csrf_token()
{
- if (!session()->has('CSRF_TOKEN')) {
+ if (! session()->has('CSRF_TOKEN')) {
session()->set('CSRF_TOKEN', Str::random());
}
- if (!cache()->has('CSRF_TOKEN' . session()->get('CSRF_TOKEN'))) {
+ if (! cache()->has('CSRF_TOKEN' . session()->get('CSRF_TOKEN'))) {
$k = \Hyperf\Utils\Str::random(25);
cache()->set('CSRF_TOKEN' . session()->get('CSRF_TOKEN'), $k);
}
@@ -515,10 +514,10 @@ function csrf_token()
}
}
-if (!function_exists('recsrf_token')) {
+if (! function_exists('recsrf_token')) {
function recsrf_token()
{
- if (!session()->has('CSRF_TOKEN')) {
+ if (! session()->has('CSRF_TOKEN')) {
session()->set('CSRF_TOKEN', Str::random());
}
$k = \Hyperf\Utils\Str::random(25);
@@ -527,7 +526,7 @@ function recsrf_token()
}
}
-if (!function_exists('modifyEnv')) {
+if (! function_exists('modifyEnv')) {
function modifyEnv(array $data)
{
$envPath = BASE_PATH . '/.env';
@@ -550,49 +549,49 @@ function modifyEnv(array $data)
}
}
-if (!function_exists('Itf_Setting')) {
+if (! function_exists('Itf_Setting')) {
function Itf_Setting()
{
return \Hyperf\Utils\ApplicationContext::getContainer()->get(SettingInterface::class);
}
}
-if (!function_exists('Router')) {
+if (! function_exists('Router')) {
function Router()
{
return \Hyperf\Utils\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Route\RouteInterface::class);
}
}
-if (!function_exists('Themes')) {
+if (! function_exists('Themes')) {
function Themes()
{
return \Hyperf\Utils\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Theme\ThemeInterface::class);
}
}
-if (!function_exists('Theme')) {
+if (! function_exists('Theme')) {
function Theme(): App\CodeFec\Themes
{
return new \App\CodeFec\Themes();
}
}
-if (!function_exists('Helpers_Str')) {
+if (! function_exists('Helpers_Str')) {
function Helpers_Str(): Str
{
return new Str();
}
}
-if (!function_exists('Itf')) {
+if (! function_exists('Itf')) {
function Itf()
{
return \Hyperf\Utils\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Itf\ItfInterface::class);
}
}
-if (!function_exists('file_hash')) {
+if (! function_exists('file_hash')) {
function file_hash($path): string
{
if (file_exists(BASE_PATH . '/public/' . $path)) {
@@ -602,7 +601,7 @@ function file_hash($path): string
}
}
-if (!function_exists('errors')) {
+if (! function_exists('errors')) {
function errors()
{
if (cache()->has('errors')) {
@@ -612,48 +611,48 @@ function errors()
}
}
-if (!function_exists('url')) {
+if (! function_exists('url')) {
function url($path = null)
{
$url = get_options('APP_URL', 'http://' . request()->getHeader('host')[0]);
- if (!$path) {
+ if (! $path) {
return $url;
}
return null;
}
}
-if (!function_exists('url_source')) {
+if (! function_exists('url_source')) {
function url_source($path = null)
{
$url = 'http://' . request()->getHeader('host')[0];
- if (!$path) {
+ if (! $path) {
return $url;
}
return $url . $path;
}
}
-if (!function_exists('ws_url')) {
+if (! function_exists('ws_url')) {
function ws_url($path = null)
{
$url = get_options('APP_WS_URL');
- if (!$path) {
+ if (! $path) {
return $url;
}
return $url . $path;
}
}
-if (!function_exists('get_num')) {
- function get_num($string): array|string|null
+if (! function_exists('get_num')) {
+ function get_num($string): array | string | null
{
return preg_replace('/[^0-9]/', '', $string);
}
}
// 已启动插件列表
-if (!function_exists('getEnPlugins')) {
+if (! function_exists('getEnPlugins')) {
function getEnPlugins()
{
return (new Plugins())->getEnPlugins();
@@ -661,14 +660,14 @@ function getEnPlugins()
}
// 已启动插件列表
-if (!function_exists('plugins')) {
+if (! function_exists('plugins')) {
function plugins(): Plugins
{
return new Plugins();
}
}
-if (!function_exists('http')) {
+if (! function_exists('http')) {
function http($response_type = 'array'): Client
{
return Client::create([
@@ -678,28 +677,28 @@ function http($response_type = 'array'): Client
}
}
-if (!function_exists('EventDispatcher')) {
+if (! function_exists('EventDispatcher')) {
function EventDispatcher()
{
return container()->get(EventDispatcherInterface::class);
}
}
-if (!function_exists('captcha')) {
+if (! function_exists('captcha')) {
function captcha(): App\CodeFec\Captcha
{
return new \App\CodeFec\Captcha();
}
}
-if (!function_exists('fileUtil')) {
+if (! function_exists('fileUtil')) {
function fileUtil(): App\CodeFec\FileUtil
{
return new \App\CodeFec\FileUtil();
}
}
-if (!function_exists('allDir')) {
+if (! function_exists('allDir')) {
function allDir($dir)
{ //遍历目录下的文件夹
$data = scandir($dir);
@@ -719,7 +718,7 @@ function allDir($dir)
}
// --压缩-- 美化html
-function minify_html($html): array|string|null
+function minify_html($html): array | string | null
{
$beautify = new Beautify_Html([
'indent_inner_html' => false,
@@ -734,7 +733,7 @@ function minify_html($html): array|string|null
return $beautify->beautify($html);
}
-if (!function_exists('build_info')) {
+if (! function_exists('build_info')) {
function build_info()
{
$data = include BASE_PATH . '/build-info.php';
@@ -743,14 +742,14 @@ function build_info()
}
// 获取系统名
-if (!function_exists('system_name')) {
- function system_name(): bool|string|null
+if (! function_exists('system_name')) {
+ function system_name(): bool | string | null
{
return str_replace("\n", '', shell_exec('echo $(uname)'));
}
}
-if (!function_exists('cmd_which')) {
- function cmd_which($bin): bool|string|null
+if (! function_exists('cmd_which')) {
+ function cmd_which($bin): bool | string | null
{
$cmd = shell_exec('which ' . $bin);
if ($cmd) {
@@ -760,7 +759,7 @@ function cmd_which($bin): bool|string|null
}
}
-if (!function_exists('get_user_agent')) {
+if (! function_exists('get_user_agent')) {
/**
* 获取客户端user agent信息.
* @return mixed|string
@@ -771,7 +770,7 @@ function get_user_agent()
}
}
-if (!function_exists('get_client_ip_data')) {
+if (! function_exists('get_client_ip_data')) {
/**
* 获取ip 信息.
* @param null $ip
@@ -796,17 +795,17 @@ function get_client_ip_data($ip = null): array
}
}
-if (!function_exists('language')) {
+if (! function_exists('language')) {
function language(): App\CodeFec\Language
{
return new \App\CodeFec\Language();
}
}
-if (!function_exists('content_brief')) {
- function content_brief($content, string|int $len = 100): string
+if (! function_exists('content_brief')) {
+ function content_brief($content, string | int $len = 100): string
{
- $len = (int)$len;
+ $len = (int) $len;
// hook post_brief_start.php
$content = strip_tags($content);
$content = htmlspecialchars($content);
@@ -815,14 +814,14 @@ function content_brief($content, string|int $len = 100): string
}
}
-if (!function_exists('admin_log')) {
+if (! function_exists('admin_log')) {
function admin_log(): App\CodeFec\Admin\LogServer
{
return new \App\CodeFec\Admin\LogServer();
}
}
-if (!function_exists('pay')) {
+if (! function_exists('pay')) {
/**
* 支付服务
* @return \App\Plugins\Core\src\Lib\Pay\PayService
@@ -833,24 +832,24 @@ function pay(): App\Plugins\Core\src\Lib\Pay\PayService
}
}
-if (!function_exists('qr_code')) {
+if (! function_exists('qr_code')) {
function qr_code(): SimpleSoftwareIO\QrCode\Generator
{
return new \SimpleSoftwareIO\QrCode\Generator();
}
}
-if (!function_exists('backup')) {
+if (! function_exists('backup')) {
/**
* 备份网站数据.
* @param null|mixed $filename backup压缩文件 文件名
*/
function backup(mixed $filename = null): string
{
- if (!is_dir(BASE_PATH . '/runtime/backup')) {
+ if (! is_dir(BASE_PATH . '/runtime/backup')) {
System::exec('cd ' . BASE_PATH . '/runtime' . '&& mkdir ' . 'backup');
}
- if (!$filename) {
+ if (! $filename) {
$filename = BASE_PATH . '/runtime/backup/backup.zip';
} else {
$filename = BASE_PATH . '/runtime/backup/' . $filename;
@@ -880,7 +879,7 @@ function backup(mixed $filename = null): string
}
}
-if (!function_exists('system_clear_cache')) {
+if (! function_exists('system_clear_cache')) {
function system_clear_cache()
{
removeFiles(BASE_PATH . '/runtime/container', BASE_PATH . '/runtime/view');
@@ -888,7 +887,7 @@ function system_clear_cache()
}
}
-if (!function_exists('removeFiles')) {
+if (! function_exists('removeFiles')) {
function removeFiles(...$values): void
{
foreach ($values as $value) {
@@ -897,34 +896,46 @@ function removeFiles(...$values): void
}
}
-if (!function_exists('_menu')) {
+if (! function_exists('_menu')) {
function _menu()
{
return call_user_func([new \App\Plugins\Core\Menu(), 'get']);
}
}
-if (!function_exists('_menu_keys')) {
+if (! function_exists('_menu_keys')) {
function _menu_keys()
{
return call_user_func([new \App\Plugins\Core\Menu(), 'get_keys']);
}
}
-if (!function_exists('_menu_data')) {
+if (! function_exists('_menu_data')) {
/**
* @param int|string $id menu id
* @return mixed
*/
- function _menu_get_data(int|string $id)
+ function _menu_get_data(int | string $id)
{
return call_user_func([new \App\Plugins\Core\Menu(), 'get_data'], $id);
}
}
-if (!function_exists('_menu_instance')) {
- function _menu_instance(): \App\Plugins\Core\Menu
+if (! function_exists('_menu_instance')) {
+ function _menu_instance(): App\Plugins\Core\Menu
{
return new \App\Plugins\Core\Menu();
}
-}
\ No newline at end of file
+}
+if (! function_exists('get_component_view_name')) {
+ function get_component_view_name($name): string
+ {
+ $view = 'customize.component.' . $name;
+ $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $factory = $container->get(FactoryInterface::class);
+ if (!$factory->exists($view)) {
+ return 'shared.viewIsNull';
+ };
+ return $view;
+ }
+}
diff --git a/resources/views/admin/setting/core/1.blade.php b/resources/views/admin/setting/core/1.blade.php
index 6912621f6..de12dd822 100755
--- a/resources/views/admin/setting/core/1.blade.php
+++ b/resources/views/admin/setting/core/1.blade.php
@@ -80,8 +80,9 @@
{{__('app.default')}}: 简体中文(zh_CN)
-
网站logo地址
+
网站logo小部件调用代码
+
请输入小部件调用代码, 点我进入小部件页面