From 827ad27ac56e0b8a317733c0e9edb3c7ed7c2b7e Mon Sep 17 00:00:00 2001 From: Tiago Date: Thu, 10 Oct 2024 22:16:12 -0300 Subject: [PATCH 01/10] v2.4 --- core/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.php b/core/core.php index 806aa69..6aaceb9 100644 --- a/core/core.php +++ b/core/core.php @@ -1,6 +1,6 @@ Date: Thu, 10 Oct 2024 23:45:44 -0300 Subject: [PATCH 02/10] Suporte a estilos personalizados --- classes/AccessCheck.php | 8 ++ classes/Style.php | 72 ++++++++++++++ core/classes.php | 1 + core/init.php | 12 +-- index.php | 34 +++++-- media/admin.css | 15 --- media/custom-admin/blank/blank.css | 0 media/custom-admin/obs-panel/obs-panel.css | 55 +++++++++++ media/custom-admin/obs-panel/obs-panel.svg | 6 ++ .../full-screen-mode/full-screen-mode.css | 61 ++++++++++++ .../full-screen-mode/full-screen-mode.svg | 17 ++++ media/custom/obs-source/obs-source.css | 30 ++++++ media/custom/obs-source/obs-source.svg | 21 +++++ media/default-custom.svg | 7 ++ media/default.css | 89 +++++++----------- media/loading.png | Bin 0 -> 31594 bytes media/minimal.css | 77 +++++++++++++++ media/obs.css | 20 ---- media/user.css | 26 ----- scripts/default.js | 1 - 20 files changed, 413 insertions(+), 139 deletions(-) create mode 100644 classes/Style.php delete mode 100644 media/admin.css create mode 100644 media/custom-admin/blank/blank.css create mode 100644 media/custom-admin/obs-panel/obs-panel.css create mode 100644 media/custom-admin/obs-panel/obs-panel.svg create mode 100644 media/custom/full-screen-mode/full-screen-mode.css create mode 100644 media/custom/full-screen-mode/full-screen-mode.svg create mode 100644 media/custom/obs-source/obs-source.css create mode 100644 media/custom/obs-source/obs-source.svg create mode 100644 media/default-custom.svg create mode 100644 media/loading.png create mode 100644 media/minimal.css delete mode 100644 media/obs.css delete mode 100644 media/user.css diff --git a/classes/AccessCheck.php b/classes/AccessCheck.php index 9181307..487d726 100644 --- a/classes/AccessCheck.php +++ b/classes/AccessCheck.php @@ -49,4 +49,12 @@ public static function isRequestingInvalidDatabase() { public static function isRequestingNewDatabase() { return !Database::isValidDatabase(); } + + public static function isValidStyle(){ + if (!isset($_GET['s'])){ + return true; + } else { + return (file_exists(Style::getCurrentPathStyle() . '/' . $_GET['s'] . '/' . $_GET['s'] . '.css')); + } + } } diff --git a/classes/Style.php b/classes/Style.php new file mode 100644 index 0000000..7e55eb6 --- /dev/null +++ b/classes/Style.php @@ -0,0 +1,72 @@ +'; + Style::HTMLMenuItems('media/custom', FALSE); + if (AccessCheck::isValidAdminPage()){ + echo '
'; + Style::HTMLMenuItems('media/custom-admin', TRUE); + } + } + public static function HTMLMenuItems($path, $admin=FALSE){ + global $HIDE_STYLES; + $files = array_diff(scandir($path), array('..', '.')); + foreach ($files as $file){ + if (in_array($file, $HIDE_STYLES)){ + // + } else { + if (file_exists("$path/$file/$file.png")){ + $style_in_line = "background-image: url($path/$file/$file.png);"; + } else if (file_exists("$path/$file/$file.svg")){ + $style_in_line = "background-image: url($path/$file/$file.svg);"; + } else { + $style_in_line = ''; + } + ?> + +
+ +
+ + + + + + + + <?= @$APP_TITLE ?> - - + + + + + + + - + - - - +