From 319076b682663e626b4c5087fe52d7cc0d79dc5b Mon Sep 17 00:00:00 2001 From: Little Fluffy Clouds Date: Wed, 9 Jul 2025 18:55:20 +0300 Subject: [PATCH] Change some names around --- composer.json | 108 +-- .../deeproots/system/controllers/core.php | 75 ++ .../deeproots/system/controllers/index.php | 6 +- .../deeproots/system/databases/.gitignore | 0 .../system/localizations/english.php | 184 +++++ .../system/localizations/russian.php | 0 .../deeproots/system/models/account.php | 20 +- .../deeproots/system/models/answer.php | 10 +- .../deeproots/system/models/connection.php | 6 +- .../deeproots/system/models/core.php | 5 +- .../system/models/enumerations/language.php | 4 +- .../deeproots/system/models/question.php | 10 +- .../system/models/question/localization.php | 10 +- .../deeproots/system/models/telegram.php | 192 +++++ .../buttons/account/localization/create.php | 0 .../buttons/account/localization/update.php | 0 .../telegram/buttons/question/search.php | 24 +- .../system/models/telegram/commands.php | 741 ++++++++++++++++++ .../system/models/telegram/middlewares.php | 12 +- .../telegram/processes/language/select.php | 14 +- .../telegram/processes/question/create.php | 24 +- .../question/localization/create.php | 44 +- .../telegram/processes/question/search.php | 66 +- .../system/models/telegram/settings.php | 18 +- .../system/models/telegram/traits/escape.php | 4 +- .../system/public/css/fonts/dejavu.css | 0 .../system/public/css/fonts/fira.css | 0 .../system/public/css/fonts/hack.css | 0 .../system/public/fonts/commissioner.ttf | Bin .../fonts/dejavu/DejaVuLGCSans-Bold.ttf | Bin .../dejavu/DejaVuLGCSans-BoldOblique.ttf | Bin .../fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf | Bin .../fonts/dejavu/DejaVuLGCSans-Oblique.ttf | Bin .../public/fonts/dejavu/DejaVuLGCSans.ttf | Bin .../dejavu/DejaVuLGCSansCondensed-Bold.ttf | Bin .../DejaVuLGCSansCondensed-BoldOblique.ttf | Bin .../dejavu/DejaVuLGCSansCondensed-Oblique.ttf | Bin .../fonts/dejavu/DejaVuLGCSansCondensed.ttf | Bin .../fonts/dejavu/DejaVuLGCSansMono-Bold.ttf | Bin .../dejavu/DejaVuLGCSansMono-BoldOblique.ttf | Bin .../dejavu/DejaVuLGCSansMono-Oblique.ttf | Bin .../public/fonts/dejavu/DejaVuLGCSansMono.ttf | Bin .../fonts/dejavu/DejaVuLGCSerif-Bold.ttf | Bin .../dejavu/DejaVuLGCSerif-BoldItalic.ttf | Bin .../fonts/dejavu/DejaVuLGCSerif-Italic.ttf | Bin .../public/fonts/dejavu/DejaVuLGCSerif.ttf | Bin .../dejavu/DejaVuLGCSerifCondensed-Bold.ttf | Bin .../DejaVuLGCSerifCondensed-BoldItalic.ttf | Bin .../dejavu/DejaVuLGCSerifCondensed-Italic.ttf | Bin .../fonts/dejavu/DejaVuLGCSerifCondensed.ttf | Bin .../public/fonts/fira/FiraMono-Bold.woff | Bin .../public/fonts/fira/FiraMono-Bold.woff2 | Bin .../public/fonts/fira/FiraMono-Medium.woff | Bin .../public/fonts/fira/FiraMono-Medium.woff2 | Bin .../public/fonts/fira/FiraMono-Regular.woff | Bin .../public/fonts/fira/FiraMono-Regular.woff2 | Bin .../public/fonts/fira/FiraSans-Bold.woff | Bin .../public/fonts/fira/FiraSans-Bold.woff2 | Bin .../fonts/fira/FiraSans-BoldItalic.woff | Bin .../fonts/fira/FiraSans-BoldItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Book.woff | Bin .../public/fonts/fira/FiraSans-Book.woff2 | Bin .../fonts/fira/FiraSans-BookItalic.woff | Bin .../fonts/fira/FiraSans-BookItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Eight.woff | Bin .../public/fonts/fira/FiraSans-Eight.woff2 | Bin .../fonts/fira/FiraSans-EightItalic.woff | Bin .../fonts/fira/FiraSans-EightItalic.woff2 | Bin .../public/fonts/fira/FiraSans-ExtraBold.woff | Bin .../fonts/fira/FiraSans-ExtraBold.woff2 | Bin .../fonts/fira/FiraSans-ExtraBoldItalic.woff | Bin .../fonts/fira/FiraSans-ExtraBoldItalic.woff2 | Bin .../fonts/fira/FiraSans-ExtraLight.woff | Bin .../fonts/fira/FiraSans-ExtraLight.woff2 | Bin .../fonts/fira/FiraSans-ExtraLightItalic.woff | Bin .../fira/FiraSans-ExtraLightItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Four.woff | Bin .../public/fonts/fira/FiraSans-Four.woff2 | Bin .../fonts/fira/FiraSans-FourItalic.woff | Bin .../fonts/fira/FiraSans-FourItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Hair.woff | Bin .../public/fonts/fira/FiraSans-Hair.woff2 | Bin .../fonts/fira/FiraSans-HairItalic.woff | Bin .../fonts/fira/FiraSans-HairItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Heavy.woff | Bin .../public/fonts/fira/FiraSans-Heavy.woff2 | Bin .../fonts/fira/FiraSans-HeavyItalic.woff | Bin .../fonts/fira/FiraSans-HeavyItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Italic.woff | Bin .../public/fonts/fira/FiraSans-Italic.woff2 | Bin .../public/fonts/fira/FiraSans-Light.woff | Bin .../public/fonts/fira/FiraSans-Light.woff2 | Bin .../fonts/fira/FiraSans-LightItalic.woff | Bin .../fonts/fira/FiraSans-LightItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Medium.woff | Bin .../public/fonts/fira/FiraSans-Medium.woff2 | Bin .../fonts/fira/FiraSans-MediumItalic.woff | Bin .../fonts/fira/FiraSans-MediumItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Regular.woff | Bin .../public/fonts/fira/FiraSans-Regular.woff2 | Bin .../public/fonts/fira/FiraSans-SemiBold.woff | Bin .../public/fonts/fira/FiraSans-SemiBold.woff2 | Bin .../fonts/fira/FiraSans-SemiBoldItalic.woff | Bin .../fonts/fira/FiraSans-SemiBoldItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Thin.woff | Bin .../public/fonts/fira/FiraSans-Thin.woff2 | Bin .../fonts/fira/FiraSans-ThinItalic.woff | Bin .../fonts/fira/FiraSans-ThinItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Two.woff | Bin .../public/fonts/fira/FiraSans-Two.woff2 | Bin .../public/fonts/fira/FiraSans-TwoItalic.woff | Bin .../fonts/fira/FiraSans-TwoItalic.woff2 | Bin .../public/fonts/fira/FiraSans-Ultra.woff | Bin .../public/fonts/fira/FiraSans-Ultra.woff2 | Bin .../fonts/fira/FiraSans-UltraItalic.woff | Bin .../fonts/fira/FiraSans-UltraItalic.woff2 | Bin .../fonts/fira/FiraSans-UltraLight.woff | Bin .../fonts/fira/FiraSans-UltraLight.woff2 | Bin .../fonts/fira/FiraSans-UltraLightItalic.woff | Bin .../fira/FiraSans-UltraLightItalic.woff2 | Bin .../public/fonts/hack/hack-bold-subset.woff | Bin .../public/fonts/hack/hack-bold-subset.woff2 | Bin .../system/public/fonts/hack/hack-bold.woff | Bin .../system/public/fonts/hack/hack-bold.woff2 | Bin .../fonts/hack/hack-bolditalic-subset.woff | Bin .../fonts/hack/hack-bolditalic-subset.woff2 | Bin .../public/fonts/hack/hack-bolditalic.woff | Bin .../public/fonts/hack/hack-bolditalic.woff2 | Bin .../public/fonts/hack/hack-italic-subset.woff | Bin .../fonts/hack/hack-italic-subset.woff2 | Bin .../system/public/fonts/hack/hack-italic.woff | Bin .../public/fonts/hack/hack-italic.woff2 | Bin .../fonts/hack/hack-regular-subset.woff | Bin .../fonts/hack/hack-regular-subset.woff2 | Bin .../public/fonts/hack/hack-regular.woff | Bin .../public/fonts/hack/hack-regular.woff2 | Bin .../deeproots/system/public/index.php | 12 +- .../deeproots/system/public/telegram.php | 34 +- .../public/themes/default/css/aside.css | 0 .../public/themes/default/css/colors.css | 0 .../public/themes/default/css/fonts.css | 0 .../public/themes/default/css/footer.css | 0 .../public/themes/default/css/header.css | 0 .../system/public/themes/default/css/main.css | 0 .../public/themes/default/css/system.css | 0 .../deeproots/system/settings/.gitignore | 0 .../system/settings/arangodb.php.sample | 0 .../system/settings/system.php.sample | 0 .../system/settings/telegram.php.sample | 0 .../system/storage/images/mushroom.jpg | Bin .../deeproots/system/views/templater.php | 210 +++++ .../system/views/themes/default/aside.html | 2 +- .../system/views/themes/default/core.html | 0 .../system/views/themes/default/footer.html | 0 .../system/views/themes/default/head.html | 0 .../system/views/themes/default/header.html | 0 .../system/views/themes/default/index.html | 0 .../system/views/themes/default/js.html | 0 mirzaev/deeproots/system/controllers/core.php | 75 -- .../system/localizations/english.php | 184 ----- mirzaev/deeproots/system/models/telegram.php | 192 ----- .../system/models/telegram/commands.php | 741 ------------------ mirzaev/deeproots/system/views/templater.php | 211 ----- 163 files changed, 1618 insertions(+), 1620 deletions(-) create mode 100755 deeproots/deeproots/system/controllers/core.php rename {mirzaev => deeproots}/deeproots/system/controllers/index.php (89%) rename {mirzaev => deeproots}/deeproots/system/databases/.gitignore (100%) create mode 100644 deeproots/deeproots/system/localizations/english.php rename {mirzaev => deeproots}/deeproots/system/localizations/russian.php (100%) rename {mirzaev => deeproots}/deeproots/system/models/account.php (95%) rename {mirzaev => deeproots}/deeproots/system/models/answer.php (91%) rename {mirzaev => deeproots}/deeproots/system/models/connection.php (95%) rename {mirzaev => deeproots}/deeproots/system/models/core.php (89%) rename {mirzaev => deeproots}/deeproots/system/models/enumerations/language.php (93%) rename {mirzaev => deeproots}/deeproots/system/models/question.php (89%) rename {mirzaev => deeproots}/deeproots/system/models/question/localization.php (92%) create mode 100755 deeproots/deeproots/system/models/telegram.php rename {mirzaev => deeproots}/deeproots/system/models/telegram/buttons/account/localization/create.php (100%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/buttons/account/localization/update.php (100%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/buttons/question/search.php (96%) create mode 100755 deeproots/deeproots/system/models/telegram/commands.php rename {mirzaev => deeproots}/deeproots/system/models/telegram/middlewares.php (98%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/processes/language/select.php (92%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/processes/question/create.php (82%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/processes/question/localization/create.php (97%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/processes/question/search.php (98%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/settings.php (92%) rename {mirzaev => deeproots}/deeproots/system/models/telegram/traits/escape.php (89%) rename {mirzaev => deeproots}/deeproots/system/public/css/fonts/dejavu.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/css/fonts/fira.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/css/fonts/hack.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/commissioner.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSans.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraMono-Bold.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraMono-Bold.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraMono-Medium.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraMono-Medium.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraMono-Regular.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraMono-Regular.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Bold.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Bold.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Book.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Book.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Eight.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Eight.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Four.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Four.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Hair.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Hair.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Italic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Italic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Light.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Light.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Medium.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Medium.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Regular.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Regular.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Thin.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Thin.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Two.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Two.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bold-subset.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bold-subset.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bold.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bold.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bolditalic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-bolditalic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-italic-subset.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-italic-subset.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-italic.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-italic.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-regular-subset.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-regular-subset.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-regular.woff (100%) rename {mirzaev => deeproots}/deeproots/system/public/fonts/hack/hack-regular.woff2 (100%) rename {mirzaev => deeproots}/deeproots/system/public/index.php (82%) rename {mirzaev => deeproots}/deeproots/system/public/telegram.php (79%) rename {mirzaev => deeproots}/deeproots/system/public/themes/default/css/aside.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/themes/default/css/colors.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/themes/default/css/fonts.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/themes/default/css/footer.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/themes/default/css/header.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/themes/default/css/main.css (100%) rename {mirzaev => deeproots}/deeproots/system/public/themes/default/css/system.css (100%) rename {mirzaev => deeproots}/deeproots/system/settings/.gitignore (100%) rename {mirzaev => deeproots}/deeproots/system/settings/arangodb.php.sample (100%) rename {mirzaev => deeproots}/deeproots/system/settings/system.php.sample (100%) rename {mirzaev => deeproots}/deeproots/system/settings/telegram.php.sample (100%) rename {mirzaev => deeproots}/deeproots/system/storage/images/mushroom.jpg (100%) create mode 100755 deeproots/deeproots/system/views/templater.php rename {mirzaev => deeproots}/deeproots/system/views/themes/default/aside.html (86%) rename {mirzaev => deeproots}/deeproots/system/views/themes/default/core.html (100%) rename {mirzaev => deeproots}/deeproots/system/views/themes/default/footer.html (100%) rename {mirzaev => deeproots}/deeproots/system/views/themes/default/head.html (100%) rename {mirzaev => deeproots}/deeproots/system/views/themes/default/header.html (100%) rename {mirzaev => deeproots}/deeproots/system/views/themes/default/index.html (100%) rename {mirzaev => deeproots}/deeproots/system/views/themes/default/js.html (100%) delete mode 100755 mirzaev/deeproots/system/controllers/core.php delete mode 100644 mirzaev/deeproots/system/localizations/english.php delete mode 100755 mirzaev/deeproots/system/models/telegram.php delete mode 100755 mirzaev/deeproots/system/models/telegram/commands.php delete mode 100755 mirzaev/deeproots/system/views/templater.php diff --git a/composer.json b/composer.json index 0c05d9f..b84fe18 100755 --- a/composer.json +++ b/composer.json @@ -1,56 +1,56 @@ { - "name": "mirzaev/deeproots", - "description": "", - "homepage": "https://git.svoboda.works/mirzaev/deeproots", - "type": "site", - "keywords": [ - "minimal", - "baza" - ], - "readme": "README.md", - "license": "WTFPL", - "authors": [ - { - "name": "mirzaev", - "email": "mirzaev@gmail.com", - "homepage": "https://mirzaev.page", - "role": "Programmer" - } - ], - "support": { - "wiki": "https://git.svoboda.works/mirzaev/deeproots/wiki", - "issues": "https://git.svoboda.works/mirzaev/deeproots/issues" - }, - "require": { - "php": "^8.4", - "mirzaev/minimal": "^3.4", - "mirzaev/baza": "^3.3", - "twig/twig": "^3.10", - "twig/extra-bundle": "^3.7", - "twig/intl-extra": "^3.10", - "svoboda/time": "^1.0", - "badfarm/zanzara": "^0.9.1", - "nyholm/psr7": "^1.8", - "react/filesystem": "^0.1.2", - "react/async": "^4.3" - }, - "autoload": { - "psr-4": { - "mirzaev\\deeproots\\": "mirzaev/deeproots/system" - } - }, - "autoload-dev": { - "psr-4": { - "mirzaev\\deeproots\\tests\\": "mirzaev/deeproots/tests" - } - }, - "scripts": { - "pre-update-cmd": "./install.sh" - }, - "config": { - "allow-plugins": { - "php-http/discovery": true, - "wyrihaximus/composer-update-bin-autoload-path": true - } - } + "name": "deeproots/deeproots", + "description": "", + "homepage": "https://t.me/deeproots_bot", + "type": "site", + "keywords": [ + "minimal", + "baza" + ], + "readme": "README.md", + "license": "WTFPL", + "authors": [ + { + "name": "deeproots", + "email": "deeproots@goatse.cx", + "homepage": "https://t.me/deeproots_bot", + "role": "Triumvirate" + } + ], + "support": { + "wiki": "https://git.svoboda.works/lfclouds/deeproots/wiki", + "issues": "https://git.svoboda.works/lfclouds/deeproots/issues" + }, + "require": { + "php": "^8.4", + "mirzaev/minimal": "^3.4", + "mirzaev/baza": "^3.3", + "twig/twig": "^3.10", + "twig/extra-bundle": "^3.7", + "twig/intl-extra": "^3.10", + "svoboda/time": "^1.0", + "badfarm/zanzara": "^0.9.1", + "nyholm/psr7": "^1.8", + "react/filesystem": "^0.1.2", + "react/async": "^4.3" + }, + "autoload": { + "psr-4": { + "deeproots\\deeproots\\": "mirzaev/deeproots/system" + } + }, + "autoload-dev": { + "psr-4": { + "deeproots\\deeproots\\tests\\": "mirzaev/deeproots/tests" + } + }, + "scripts": { + "pre-update-cmd": "./install.sh" + }, + "config": { + "allow-plugins": { + "php-http/discovery": true, + "wyrihaximus/composer-update-bin-autoload-path": true + } + } } diff --git a/deeproots/deeproots/system/controllers/core.php b/deeproots/deeproots/system/controllers/core.php new file mode 100755 index 0000000..2a24f2e --- /dev/null +++ b/deeproots/deeproots/system/controllers/core.php @@ -0,0 +1,75 @@ + + */ +class core extends controller +{ + /** + * Language + * + * @var language $language Language + */ + protected language $language = language::en; + + /** + * Response + * + * @see https://wiki.php.net/rfc/property-hooks (find a table about backed and virtual hooks) + * + * @var response $response Response + */ + protected response $response { + // Read + get => $this->response ??= $this->request->response(); + } + + /** + * Errors + * + * @var array $errors Registry of errors + */ + protected array $errors = [ + ]; + + /** + * Constructor + * + * @param minimal $core Instance of the MINIMAL + * @param bool $initialize Initialize a controller? + * + * @return void + */ + public function __construct(minimal $core, bool $initialize = true) + { + // Blocking requests from CloudFlare (better to write this blocking into nginx config file) + if (isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] === 'nginx-ssl early hints') return status::bruh->label; + + // For the extends system + parent::__construct(core: $core); + } +} diff --git a/mirzaev/deeproots/system/controllers/index.php b/deeproots/deeproots/system/controllers/index.php similarity index 89% rename from mirzaev/deeproots/system/controllers/index.php rename to deeproots/deeproots/system/controllers/index.php index 8cbe57d..d3f91dd 100755 --- a/mirzaev/deeproots/system/controllers/index.php +++ b/deeproots/deeproots/system/controllers/index.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace mirzaev\deeproots\controllers; +namespace deeproots\deeproots\controllers; // Files of the project -use mirzaev\deeproots\controllers\core; +use deeproots\deeproots\controllers\core; // Framework for PHP use mirzaev\minimal\http\enumerations\content, @@ -14,7 +14,7 @@ use mirzaev\minimal\http\enumerations\content, /** * Index * - * @package mirzaev\deeproots\controllers + * @package deeproots\deeproots\controllers * * @param array $errors Registry of errors * diff --git a/mirzaev/deeproots/system/databases/.gitignore b/deeproots/deeproots/system/databases/.gitignore similarity index 100% rename from mirzaev/deeproots/system/databases/.gitignore rename to deeproots/deeproots/system/databases/.gitignore diff --git a/deeproots/deeproots/system/localizations/english.php b/deeproots/deeproots/system/localizations/english.php new file mode 100644 index 0000000..7fd4fc2 --- /dev/null +++ b/deeproots/deeproots/system/localizations/english.php @@ -0,0 +1,184 @@ + 'DeepRoots', + 'empty' => 'Empty', + 'yes' => 'Yes', + 'no' => 'No', + + // Main menu + 'menu_title' => 'Main menu', + 'menu_button_start' => 'Start', + 'menu_button_rating' => 'Rating', + 'menu_button_balance' => 'Balance', + 'menu_button_system_accounts' => 'Accounts', + 'menu_button_system_questions' => 'Questions', + 'menu_button_system_settings' => 'Settings', + 'menu_system_authorized' => 'System authorization found', + + // Account + 'account_title' => 'Account', + 'account_identifier' => 'Identifier', + 'account_authorized_system' => 'Access to the system', + 'account_authorized_game_play' => 'Access to play games', + 'account_authorized_rating_display' => 'Access to display in the rating', + 'account_authorized_balance_deposit' => 'Access to deposit into the balance', + 'account_authorized_balance_withdraw' => 'Access to withdraw from the balance', + 'account_authorized_settings' => 'Access to settings', + 'account_authorized_system_accounts' => 'System access to accounts', + 'account_authorized_system_questions' => 'System access to questions', + 'account_authorized_system_settings' => 'System access to system settings', + + // Language setting + 'settings_select_language_title' => 'Select language', + 'settings_select_language_description' => 'The selected language will be writed in your account settings', + 'settings_language_update_success' => 'Language replaced:', + 'settings_language_update_fail' => 'Failed to replace language', + + // Language selection + 'select_language_title' => 'Select language', + 'select_language_description' => 'The selected language will be used in the current process', + 'select_language_button_add' => 'Add a language', + + // Repository + 'repository_title' => 'Repository', + 'repository_text' => << 'The code', + 'repository_button_issues' => 'Issues', + 'repository_button_suggestions' => 'Suggestions', + + // Author + 'author_title' => 'Author', + 'author_text' => << 'Neurojournal', + 'author_button_projects' => 'Projects', + 'author_button_twitter' => 'Twitter', + 'author_button_bluesky' => 'Bluesky', + 'author_button_bastyon' => 'Bastyon', + 'author_button_youtube_english' => 'YouTube', + 'author_button_youtube_russian' => 'YouTube', + 'author_button_message' => 'Send a message', + + // Questions (system) + 'system_questions_title' => 'The questions registry', + 'system_questions_questions' => 'Questions', + 'system_questions_answers' => 'Answers', + 'system_questions_answers_amount_matches' => 'The amount of questions matches the amount of answers', + 'system_questions_answers_amount_different' => 'The amount of questions does not match the amount of answers', + 'system_questions_amount_matches' => 'The amount of questions matches the amount of localizations', + 'system_questions_amount_different' => 'The amount of questions does not match the amount of localizations', + 'system_questions_localizations_amount_matches' => 'Amounts of localizations matches with each other', + 'system_questions_localizations_amount_different' => 'Amounts of localizations does not match with each other', + 'system_questions_button_search' => 'Search', + 'system_questions_button_create' => 'Create', + + // Question create (system) + 'system_questions_create_created' => 'The question was created', + + // Question search (system) + 'system_questions_search_title' => 'The question search process', + 'system_questions_search_continued' => 'The process of the question search found and continued', + 'system_questions_search_started' => 'The process of the question search started', + 'system_questions_search_not_started' => 'The process of the question search is not started', + 'system_questions_search_ended' => 'The process of the question search ended', + 'system_questions_search_page_next_exists' => 'There are more questions in the registry', + 'system_questions_search_page_next_not_exists' => 'There are no more questions in the registry', + 'system_questions_search_empty' => 'No questions found', + 'system_questions_search_question_title' => 'Question', + 'system_questions_search_question_answer' => 'Answer', + 'system_questions_search_identifier_request_title' => 'Enter identifier', + 'system_questions_search_identifier_request_not_acceptable' => 'Failed to process the identifier', + 'system_questions_search_identifier_request_too_short' => 'Identifier length must be \>\= 1 and \<\= 12', + 'system_questions_search_identifier_request_too_long' => 'Identifier length must be \>\= 1 and \<\= 12', + 'system_questions_search_identifier_request_restricted_characters_title' => "Restricted any characters except digits", + 'system_questions_search_identifier_request_restricted_characters_description' => "Remove these characters:", + 'system_questions_search_identifier_cancel_success' => 'Cancelled the identifier replacing process', + 'system_questions_search_identifier_delete_success' => 'Identifier deleted', + 'system_questions_search_identifier_update_success' => 'Identifier replaced:', + 'system_questions_search_identifier_update_fail' => 'Failed to replace identifier', + 'system_questions_search_text_request_title' => 'Enter text', + 'system_questions_search_text_request_not_acceptable' => 'Failed to process the text', + 'system_questions_search_text_request_too_short' => 'Text length must be \>\= 3 and \<\= 256', + 'system_questions_search_text_request_too_long' => 'Text length must be \>\= 3 and \<\= 256', + 'system_questions_search_text_cancel_success' => 'Cancelled the text replacing process', + 'system_questions_search_text_delete_success' => 'Text deleted', + 'system_questions_search_text_update_success' => 'Text replaced:', + 'system_questions_search_text_update_fail' => 'Failed to replace text', + 'system_questions_search_a_request_title' => 'Enter A\-answer', + 'system_questions_search_a_request_not_acceptable' => 'Failed to process the A\-answer', + 'system_questions_search_a_request_too_short' => 'A\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_a_request_too_long' => 'A\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_a_cancel_success' => 'Cancelled the A\-answer replacing process', + 'system_questions_search_a_delete_success' => 'A\-answer deleted', + 'system_questions_search_a_update_success' => 'A\-answer replaced:', + 'system_questions_search_a_update_fail' => 'Failed to replace A\-answer', + 'system_questions_search_b_request_title' => 'Enter B\-answer', + 'system_questions_search_b_request_not_acceptable' => 'Failed to process the B\-answer', + 'system_questions_search_b_request_too_short' => 'B\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_b_request_too_long' => 'B\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_b_cancel_success' => 'Cancelled the B\-answer replacing process', + 'system_questions_search_b_delete_success' => 'B\-answer deleted', + 'system_questions_search_b_update_success' => 'B\-answer replaced:', + 'system_questions_search_b_update_fail' => 'Failed to replace B\-answer', + 'system_questions_search_c_request_title' => 'Enter C\-answer', + 'system_questions_search_c_request_not_acceptable' => 'Failed to process the C\-answer', + 'system_questions_search_c_request_too_short' => 'C\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_c_request_too_long' => 'C\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_c_cancel_success' => 'Cancelled the C\-answer replacing process', + 'system_questions_search_c_delete_success' => 'C\-answer deleted', + 'system_questions_search_c_update_success' => 'C\-answer replaced:', + 'system_questions_search_c_update_fail' => 'Failed to replace C\-answer', + 'system_questions_search_d_request_title' => 'Enter D\-answer', + 'system_questions_search_d_request_not_acceptable' => 'Failed to process the D\-answer', + 'system_questions_search_d_request_too_short' => 'D\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_d_request_too_long' => 'D\-answer length must be \>\= 3 and \<\= 128', + 'system_questions_search_d_cancel_success' => 'Cancelled the D\-answer replacing process', + 'system_questions_search_d_delete_success' => 'D\-answer deleted', + 'system_questions_search_d_update_success' => 'D\-answer replaced:', + 'system_questions_search_d_update_fail' => 'Failed to replace D\-answer', + 'system_questions_search_button_delete' => 'Delete', + 'system_questions_search_button_author' => 'Author', + 'system_questions_search_button_active' => 'Active', + 'system_questions_search_button_inactive' => 'Inactive', + 'system_questions_search_button_answer' => 'Answer', + 'system_questions_search_button_localizations' => 'Localizations', + 'system_questions_search_button_identifier' => 'Identifier', + 'system_questions_search_button_text' => 'Text', + 'system_questions_search_button_a' => 'A', + 'system_questions_search_button_b' => 'B', + 'system_questions_search_button_c' => 'C', + 'system_questions_search_button_d' => 'D', + 'system_questions_search_button_delete' => 'Delete', + 'system_questions_search_button_cancel' => 'Cancel', + 'system_questions_search_button_page_next' => 'Next page', + 'system_questions_search_button_end' => 'End the search process', + 'system_questions_search_not_localized' => 'Failed to initialize the question localization', + + // Question localization create (system) + 'system_questions_localization_create_created' => 'The question localization was created', + + // Authorization + 'not_authorized_system' => 'You do not have access to the system', + 'not_authorized_game_play' => 'You do not have access to play games', + 'not_authorized_rating_display' => 'You do not have access to display in the rating', + 'not_authorized_balance_deposit' => 'You do not have access to deposit into the balance', + 'not_authorized_balance_withdraw' => 'You do not have access to withdraw from the balance', + 'not_authorized_settings' => 'You do not have access to the settings', + 'not_authorized_system_accounts' => 'You do not have system access to the accounts', + 'not_authorized_system_questions' => 'You do not have system access to the questions', + 'not_authorized_system_settings' => 'You do not have system access to the system settings', + + // Other + 'why_so_shroomious' => 'why so shroomious', +]; diff --git a/mirzaev/deeproots/system/localizations/russian.php b/deeproots/deeproots/system/localizations/russian.php similarity index 100% rename from mirzaev/deeproots/system/localizations/russian.php rename to deeproots/deeproots/system/localizations/russian.php diff --git a/mirzaev/deeproots/system/models/account.php b/deeproots/deeproots/system/models/account.php similarity index 95% rename from mirzaev/deeproots/system/models/account.php rename to deeproots/deeproots/system/models/account.php index 8932e5b..613ba7d 100755 --- a/mirzaev/deeproots/system/models/account.php +++ b/deeproots/deeproots/system/models/account.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models; +namespace deeproots\deeproots\models; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\connection, - mirzaev\deeproots\models\telegram, - mirzaev\deeproots\models\enumerations\language, - mirzaev\deeproots\models\account\localization; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\connection, + deeproots\deeproots\models\telegram, + deeproots\deeproots\models\enumerations\language, + deeproots\deeproots\models\account\localization; // Svoboda time use svoboda\time\statement as svoboda; @@ -28,7 +28,7 @@ use Exception as exception, /** * Account * - * @package mirzaev\deeproots\models + * @package deeproots\deeproots\models * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich @@ -81,7 +81,7 @@ final class account extends core /** * Initialize * - * Searches for the account record by the telegram account in the database, + * Searches for the account record by the telegram account in the database, * and if it does not find it, then create the account record and the connection record * * @param record $telegram The telegram account @@ -117,7 +117,7 @@ final class account extends core // Deactivating the connection between missing account and the telegram account $deactivated = $connected->read( - filter: fn(record $record) => $record->identifier === $connected->identifier, + filter: fn(record $record) => $record->identifier === $connected->identifier, update: function (record &$record) { $record->active = 0; $record->updated = svoboda::timestamp(); @@ -126,7 +126,7 @@ final class account extends core if ($deactivated instanceof record && $deactivated->active === 0) { // Deactivated the connection between missing account and the telegram account - + // Creating the account goto create; } else { diff --git a/mirzaev/deeproots/system/models/answer.php b/deeproots/deeproots/system/models/answer.php similarity index 91% rename from mirzaev/deeproots/system/models/answer.php rename to deeproots/deeproots/system/models/answer.php index 7413ee9..e1a2453 100755 --- a/mirzaev/deeproots/system/models/answer.php +++ b/deeproots/deeproots/system/models/answer.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models; +namespace deeproots\deeproots\models; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\question, - mirzaev\deeproots\models\enumerations\language; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\question, + deeproots\deeproots\models\enumerations\language; // Svoboda time use svoboda\time\statement as svoboda; @@ -27,7 +27,7 @@ use Exception as exception, * Answer * * @uses question - * @package mirzaev\deeproots\models + * @package deeproots\deeproots\models * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich diff --git a/mirzaev/deeproots/system/models/connection.php b/deeproots/deeproots/system/models/connection.php similarity index 95% rename from mirzaev/deeproots/system/models/connection.php rename to deeproots/deeproots/system/models/connection.php index 3d60ba2..6dc87c4 100755 --- a/mirzaev/deeproots/system/models/connection.php +++ b/deeproots/deeproots/system/models/connection.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models; +namespace deeproots\deeproots\models; // Files of the project -use mirzaev\deeproots\models\core; +use deeproots\deeproots\models\core; // Svoboda time use svoboda\time\statement as svoboda; @@ -27,7 +27,7 @@ use Exception as exception, /** * Connection between account::class and telegram::class * - * @package mirzaev\deeproots\models + * @package deeproots\deeproots\models * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich diff --git a/mirzaev/deeproots/system/models/core.php b/deeproots/deeproots/system/models/core.php similarity index 89% rename from mirzaev/deeproots/system/models/core.php rename to deeproots/deeproots/system/models/core.php index 732a542..d1be175 100755 --- a/mirzaev/deeproots/system/models/core.php +++ b/deeproots/deeproots/system/models/core.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models; +namespace deeproots\deeproots\models; // Framework for PHP use mirzaev\minimal\model, @@ -14,7 +14,7 @@ use exception; /** * Models core * - * @package mirzaev\deeproots\models + * @package deeproots\deeproots\models * * @method void __construct() Constructor * @@ -41,4 +41,3 @@ class core extends model { } } - diff --git a/mirzaev/deeproots/system/models/enumerations/language.php b/deeproots/deeproots/system/models/enumerations/language.php similarity index 93% rename from mirzaev/deeproots/system/models/enumerations/language.php rename to deeproots/deeproots/system/models/enumerations/language.php index 4e00cb7..2095405 100755 --- a/mirzaev/deeproots/system/models/enumerations/language.php +++ b/deeproots/deeproots/system/models/enumerations/language.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\enumerations; +namespace deeproots\deeproots\models\enumerations; /** * Language * * Types of languages by ISO 639-1 standart @deprecated * - * @package mirzaev\deeproots\models\enumerations + * @package deeproots\deeproots\models\enumerations * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich diff --git a/mirzaev/deeproots/system/models/question.php b/deeproots/deeproots/system/models/question.php similarity index 89% rename from mirzaev/deeproots/system/models/question.php rename to deeproots/deeproots/system/models/question.php index b8476c4..e8e8e18 100755 --- a/mirzaev/deeproots/system/models/question.php +++ b/deeproots/deeproots/system/models/question.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models; +namespace deeproots\deeproots\models; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\question\localization, - mirzaev\deeproots\models\enumerations\language; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\question\localization, + deeproots\deeproots\models\enumerations\language; // Svoboda time use svoboda\time\statement as svoboda; @@ -27,7 +27,7 @@ use Exception as exception, * Question * * @uses localization - * @package mirzaev\deeproots\models + * @package deeproots\deeproots\models * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich diff --git a/mirzaev/deeproots/system/models/question/localization.php b/deeproots/deeproots/system/models/question/localization.php similarity index 92% rename from mirzaev/deeproots/system/models/question/localization.php rename to deeproots/deeproots/system/models/question/localization.php index cf6df79..0306497 100755 --- a/mirzaev/deeproots/system/models/question/localization.php +++ b/deeproots/deeproots/system/models/question/localization.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\question; +namespace deeproots\deeproots\models\question; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\question, - mirzaev\deeproots\models\enumerations\language; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\question, + deeproots\deeproots\models\enumerations\language; // Svoboda time use svoboda\time\statement as svoboda; @@ -27,7 +27,7 @@ use Exception as exception, * Question localization * * @uses question - * @package mirzaev\deeproots\models\question + * @package deeproots\deeproots\models\question * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich diff --git a/deeproots/deeproots/system/models/telegram.php b/deeproots/deeproots/system/models/telegram.php new file mode 100755 index 0000000..c6facd2 --- /dev/null +++ b/deeproots/deeproots/system/models/telegram.php @@ -0,0 +1,192 @@ + + */ +final class telegram extends core +{ + /** + * File + * + * @var string $database Path to the database file + */ + protected string $file = DATABASES . DIRECTORY_SEPARATOR . 'telegram.baza'; + + /** + * Database + * + * @var database $database The database + */ + public protected(set) database $database; + + /** + * Constructor + * + * @return void + */ + public function __construct() + { + // Initializing the database + $this->database = new database() + ->encoding(encoding::utf8) + ->columns( + new column('identifier', type::integer_unsigned), + new column('domain', type::string, ['length' => 32]), + new column('name_first', type::string, ['length' => 64]), + new column('name_second', type::string, ['length' => 64]), + new column('language', type::string, ['length' => 2]), + new column('robot', type::char), + new column('updated', type::integer_unsigned), + new column('created', type::integer_unsigned) + ) + ->connect($this->file); + } + + /** + * Initialize + * + * Searches for the telegram account record in the database, and if it does not find it, then create + * + * @param model $telegram The telegram account + * + * @throws exception_runtime if update the telegram account record in the database by the telegram account values + * @throws exception_runtime if failed to find the created telegram account + * @throws exception_runtime if failed to create the telegram account + * + * @return record The telegram account record from the database + */ + public function initialize(model $telegram): record + { + // Searching for the account in the database + $account = $this->database->read(filter: fn(record $record) => $record->identifier === $telegram->getId(), amount: 1)[0] ?? null; + + if ($account instanceof record) { + // Found the telegram account record + + if ( + $account->name_first !== $telegram->getFirstName() || + $account->name_second !== $telegram->getLastName() || + $account->domain !== $telegram->getUsername() + ) { + // The telegram account was updated + + // Updating the account in the database + $updated = $this->database->read( + filter: fn(record $record) => $record->identifier === $telegram->getId(), + update: function (record &$record) use ($telegram){ + // Writing new values into the record + $record->name_first = $telegram->getFirstName(); + $record->name_second = $telegram->getLastName(); + $record->domain = $telegram->getUsername(); + $record->updated = svoboda::timestamp(); + }, + amount: 1 + )[0] ?? null; + + if ($updated instanceof record && $updated->values() !== $account->values()) { + // Updated the account in the database + + // Exit (success) + return $updated; + } else { + // Not updated the account in the database + + // Exit (fail) + throw new exception_runtime('Failed to update the account record in the database by the telegram account values'); + } + } + + // Exit (success) + return $account; + } else { + // Not found the account record + + if ($this->create($telegram)) { + // Created the account + + // Searching for the created telegram account in the database + $account = $this->database->read(filter: fn(record $record) => $record->identifier === $telegram->getId(), amount: 1)[0] ?? null; + + if ($account instanceof record) { + // Found the created telegram account + + // Exit (success) + return $account; + } else { + // Not found the created telegram account + + // Exit (fail) + throw new exception_runtime('Failed to find the created telegram account'); + } + } else { + // Not created the telegram account + + // Exit (fail) + throw new exception_runtime('Failed to create the telegram account'); + } + } + } + + /** + * Create + * + * Creates the account record in the database + * + * @param model $telegram The telegram account + * + * @return int|false The record identifier, if created + */ + public function create(model $telegram): int|false + { + // Initializing the identifier + $identifier = (int) $telegram->getId(); + + // Initializing the record + $record = $this->database->record( + $identifier, + $telegram->getUsername(), + $telegram->getFirstName(), + $telegram->getLastName(), + $telegram->getLanguageCode(), + (int) $telegram->isBot(), + svoboda::timestamp(), + svoboda::timestamp() + ); + + // Creating the record in the database + $created = $this->database->write($record); + + // Exit (success) + return $created ? $identifier : false; + } +} diff --git a/mirzaev/deeproots/system/models/telegram/buttons/account/localization/create.php b/deeproots/deeproots/system/models/telegram/buttons/account/localization/create.php similarity index 100% rename from mirzaev/deeproots/system/models/telegram/buttons/account/localization/create.php rename to deeproots/deeproots/system/models/telegram/buttons/account/localization/create.php diff --git a/mirzaev/deeproots/system/models/telegram/buttons/account/localization/update.php b/deeproots/deeproots/system/models/telegram/buttons/account/localization/update.php similarity index 100% rename from mirzaev/deeproots/system/models/telegram/buttons/account/localization/update.php rename to deeproots/deeproots/system/models/telegram/buttons/account/localization/update.php diff --git a/mirzaev/deeproots/system/models/telegram/buttons/question/search.php b/deeproots/deeproots/system/models/telegram/buttons/question/search.php similarity index 96% rename from mirzaev/deeproots/system/models/telegram/buttons/question/search.php rename to deeproots/deeproots/system/models/telegram/buttons/question/search.php index 2a3889a..92fe754 100755 --- a/mirzaev/deeproots/system/models/telegram/buttons/question/search.php +++ b/deeproots/deeproots/system/models/telegram/buttons/question/search.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\telegram\buttons\question; +namespace deeproots\deeproots\models\telegram\buttons\question; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\question, - mirzaev\deeproots\models\telegram\processes\question\search as process_question_search, - mirzaev\deeproots\models\enumerations\membership\status; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\question, + deeproots\deeproots\models\telegram\processes\question\search as process_question_search, + deeproots\deeproots\models\enumerations\membership\status; // Framework for Telegram use Zanzara\Context as context, @@ -23,7 +23,7 @@ use mirzaev\baza\record; /** * Telegram system question search buttons * - * @package mirzaev\deeproots\models\telegram\buttons\question + * @package deeproots\deeproots\models\telegram\buttons\question * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich @@ -54,7 +54,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -144,7 +144,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -234,7 +234,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -324,7 +324,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -414,7 +414,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -504,7 +504,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { diff --git a/deeproots/deeproots/system/models/telegram/commands.php b/deeproots/deeproots/system/models/telegram/commands.php new file mode 100755 index 0000000..2d2faef --- /dev/null +++ b/deeproots/deeproots/system/models/telegram/commands.php @@ -0,0 +1,741 @@ + + */ +final class commands extends core +{ + /** + * Menu + * + * Response for the commands: "/start", '/menu' + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function menu(context $context): void + { + // Initializing the account + $account = $context->get('account'); + + if ($account instanceof record) { + // Initialized the account + + // Initializing localization + $localization = $context->get('localization'); + + if ($localization) { + // Initialized localization + + // Initializing the title + $title = 'πŸ“‹ *' . $localization['menu_title'] . '*'; + + // Sending the message + $context->sendMessage( + << [ + 'inline_keyboard' => [ + [ + [ + 'text' => '🧠 ' . $localization['menu_button_start'], + 'callback_data' => 'projects' + ] + ], + [ + [ + 'text' => 'πŸ“ˆ ' . $localization['menu_button_rating'], + 'callback_data' => 'rating' + ], + [ + 'text' => 'πŸ’° ' . $localization['menu_button_balance'], + 'callback_data' => 'balance' + ] + ] + ], + 'disable_notification' => true, + 'remove_keyboard' => true + ], + ] + )->then(function (message $message) use ($context, $localization, $account) { + // Sended the message + + if ( + $account->authorized_system_accounts || + $account->authorized_system_questions || + $account->authorized_system_settings + ) { + // Found at least one system authorization + + // Initializing the keyboard buffer + $keyboard = []; + + if ($account->authorized_system_accounts) { + // Authorized to accounts + + // Generating the button and writing into the keyboard buffer + $keyboard[] = [ + [ + 'text' => '🐣 ' . $localization['menu_button_system_accounts'], + 'callback_data' => 'system_accounts' + ] + ]; + } + + if ($account->authorized_system_questions) { + // Authorized to questions + + // Generating the button and writing into the keyboard buffer + $keyboard[] = [ + [ + 'text' => 'πŸ—‚ ' . $localization['menu_button_system_questions'], + 'callback_data' => 'system_questions' + ] + ]; + } + + if ($account->authorized_system_settings) { + // Authorized to system settings + + // Generating the button and writing into the keyboard buffer + $keyboard[] = [ + [ + 'text' => 'βš™οΈ ' . $localization['menu_button_system_settings'], + 'callback_data' => 'system_settings' + ] + ]; + } + + // Sending the message + $context->sendMessage( + 'πŸ›  ' . $localization['menu_system_authorized'], + [ + 'reply_markup' => [ + 'inline_keyboard' => $keyboard, + 'disable_notification' => true, + 'remove_keyboard' => true + ], + ] + ); + } + }); + } else { + // Not initialized localization + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize localization*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the account*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } + + /** + * Account + * + * Responce for the command: "/account" + * + * Sends information about account with menu + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function account(context $context): void + { + // Initializing the telegram account + $telegram = $context->get('telegram'); + + if ($telegram instanceof record) { + // Initialized the telegram account + + // Initializing the account + $account = $context->get('account'); + + if ($account instanceof record) { + // Initialized the account + + // Initializing localization + $localization = $context->get('localization'); + + if ($localization) { + // Initialized localization + + // Initializing title for the message + $title = '🫡 ' . $localization['account_title']; + + // Initializing the account identifier row for the message + $identifier = '*' . $localization['account_identifier'] . ":* $account->identifier \($telegram->identifier\)"; + + // Declaring buufer of rows about authorizations + $authorizations = ''; + + // Initializing rows about authorization + foreach ($account->values() as $key => $value) { + // Iterating over account parameters + + if (str_starts_with($key, 'authorized_')) { + // Iterating over account authorizations + + if (str_starts_with($key, 'authorized_system_') && $value) { + // A system authorization + + // Writing into buffer of rows about authorizations + $authorizations .= 'βœ… ⚠️ *' . ($localization["account_$key"] ?? $key) . ':* ' . $localization['yes'] . "\n"; + } else { + // Not a system authorization + + // Writing into buffer of rows about authorizations + $authorizations .= ($value ? 'βœ…' : '❎') . ' *' . ($localization["account_$key"] ?? $key) . ':* ' . ($value ? $localization['yes'] : $localization['no']) . "\n"; + } + } + } + + // Trimming the last line break character + $authorizations = trim($authorizations, "\n"); + + // Sending the message + $context->sendMessage( + <<sendMessage('⚠️ *Failed to initialize localization*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the account*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the telegram account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the telegram account*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } + + /** + * Language + * + * Responce for the command: "/language" + * + * Send the language selection menu + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function language(context $context): void + { + // Initializing the account + $account = $context->get('account'); + + if ($account instanceof record) { + // Initialized the account + + // Initializing language + $language = $context->get('language'); + + if ($language instanceof language) { + // Initialized language + + // Initializing localization + $localization = $context->get('localization'); + + if ($localization) { + // Initialized localization + + // Sending the language selection + process_language_select::menu( + context: $context, + prefix: 'settings_language_', + title: '🌏 *' . $localization['settings_select_language_title'] . '*', + description: '🌏 *' . $localization['settings_select_language_description'] . '*' + ); + } else { + // Not initialized localization + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize localization*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized language + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize language*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the account*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } + + /** + * Repository + * + * Responce for the command: "/repository" + * + * Sends information about project and menu + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function repository(context $context): void + { + // Initializing the account + $account = $context->get('account'); + + if ($account instanceof record) { + // Initialized the account + + // Initializing localization + $localization = $context->get('localization'); + + if ($localization) { + // Initialized localization + + // Initializing title of the message + $title = 'πŸ›οΈ ' . $localization['repository_title']; + + // Sending the message + $context->sendMessage($title . "\n\n" . $localization['repository_text'], [ + 'reply_markup' => [ + 'inline_keyboard' => [ + [ + [ + 'text' => 'πŸ›οΈ ' . $localization['repository_button_code'], + 'url' => 'https://git.mirzaev.sexy/mirzaev/deeproots' + ] + ], + [ + [ + 'text' => '⚠️ ' . $localization['repository_button_issues'], + 'url' => 'https://git.mirzaev.sexy/mirzaev/deeproots/issues' + ], + [ + 'text' => '🌱 ' . $localization['repository_button_suggestions'], + 'url' => 'https://git.mirzaev.sexy/mirzaev/deeproots/issues' + ] + ] + ], + 'remove_keyboard' => true, + 'disable_notification' => true + ], + 'link_preview_options' => [ + 'is_disabled' => true + ] + ]); + } else { + // Not initialized localization + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize localization*') + ->then(function (message $message) use ($context) { + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the account*') + ->then(function (message $message) use ($context) { + // Ending the conversation process + $context->endConversation(); + }); + } + } + + /** + * Author + * + * Responce for the command: "/author" + * + * Sends + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function author(context $context): void + { + // Initializing the account + $account = $context->get('account'); + + if ($account instanceof record) { + // Initialized the account + + // Initializing localization + $localization = $context->get('localization'); + + if ($localization) { + // Initialized localization + + // Initializing title of the message + $title = 'πŸ‘½ ' . $localization['author_title']; + + // Sending the message + $context->sendMessage($title . "\n\n" . $localization['author_text'], [ + 'reply_markup' => [ + 'inline_keyboard' => [ + [ + [ + 'text' => 'πŸ“š ' . $localization['author_button_neurojournal'], + 'url' => 'https://mirzaev.sexy' + ], + [ + 'text' => '🀟 ' . $localization['author_button_projects'], + 'url' => 'https://git.svoboda.works/mirzaev?tab=activity' + ] + ], + [ + [ + 'text' => 'βœ–οΈ ' . $localization['author_button_twitter'], + 'url' => 'https://x.com/mirzaev_sexy' + ], + [ + 'text' => 'πŸ¦‹ ' . $localization['author_button_bluesky'], + 'url' => 'https://bsky.app/profile/mirzaev.bsky.social' + ], + [ + 'text' => '⛓️ ' . $localization['author_button_bastyon'], + 'url' => 'https://bsky.app/profile/mirzaev.bsky.social' + ] + ], + [ + [ + 'text' => 'πŸ‡ΊπŸ‡Έ ' . $localization['author_button_youtube_english'], + 'url' => 'https://www.youtube.com/@MIRZAEV' + ], + [ + 'text' => 'πŸ‡·πŸ‡Ί ' . $localization['author_button_youtube_russian'], + 'url' => 'https://www.youtube.com/@MIRZAEV' + ] + ], + [ + [ + 'text' => 'βœ‰οΈ ' . $localization['author_button_message'], + 'url' => 'https://t.me/mirzaev_sexy' + ] + ] + ], + 'remove_keyboard' => true, + 'disable_notification' => true + ], + 'link_preview_options' => [ + 'is_disabled' => true + ] + ]); + } else { + // Not initialized localization + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize localization*') + ->then(function (message $message) use ($context) { + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the account*') + ->then(function (message $message) use ($context) { + // Ending the conversation process + $context->endConversation(); + }); + } + } + + /** + * Society + * + * Responce for the command: "/society" + * + * Sends the "mushroom" image and the localized text "why so shroomious" + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function society(context $context): void + { + // Initializing the account + $account = $context->get('account'); + + if ($account instanceof record) { + // Initialized the account + + // Initializing localization + $localization = $context->get('localization'); + + if ($localization) { + // Initialized localization + + // Sending the message + $context->sendPhoto( + new file_input(STORAGE . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'mushroom.jpg'), + [ + 'caption' => $localization['why_so_shroomious'], + 'disable_notification' => true + ] + ); + } else { + // Not initialized localization + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize localization*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the account*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } + + /** + * Questions (system) + * + * Sends questions. answers and localizations management menu + * + * @param context $context Request data from Telegram + * + * @return void + */ + public static function system_questions(context $context): void + { + // Initializing the account + $account = $context->get('account'); + + if ($account instanceof record) { + // Initialized the account + + // Initializing localization + $localization = $context->get('localization'); + + if ($localization) { + // Initialized localization + + // Initializing the question model + $model_question = new question(); + + // Counting questions + $questions = $model_question->database->count(); + + // Initializing the answer model + $model_answer = new answer(); + + // Counting answers + $answers = $model_answer->database->count(); + + // Declaring the localizations amounts buffer + $localizations = []; + + // Declaring the questions list + $list = ''; + + foreach (language::cases() as $case) { + // Iterating over language + + // Initializing the localization model by the language + $model_question_localization = new question_localization(language: $case); + + // Counting localizations for the language + $amount = $model_question_localization->database->count(); + + // Writing into the localizations amounts buffer + $localizations[] = $amount; + + // Writing into the questions list + $list .= PHP_EOL . $case->flag() . ' *' . $case->label(language::{$account->language ?? LANGUAGE_DEFAULT} ?? language::{LANGUAGE_DEFAULT}) . ':* ' . $amount; + } + + // Deinitializing unnecessary variables + unset($case, $model_question, $model_question_localization, $model_answer, $amount); + + // Searching for unique values in uhe buffer of questions localizations amounts + $uniques = array_unique($localizations, SORT_REGULAR); + + // Is questions amounts matches? + $matches = count($uniques) === 1; + + // Sending the message + $context->sendMessage( + sprintf( + << [ + 'inline_keyboard' => [ + [ + [ + 'text' => 'πŸ” ' . $localization['system_questions_button_search'], + 'callback_data' => 'system_questions_search' + ], + [ + 'text' => '✏️ ' . $localization['system_questions_button_create'], + 'callback_data' => 'system_questions_create' + ] + ] + ], + 'remove_keyboard' => true, + 'disable_notification' => true + ], + 'link_preview_options' => [ + 'is_disabled' => true + ] + ] + ); + } else { + // Not initialized localization + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize localization*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } else { + // Not initialized the account + + // Sending the message + $context->sendMessage('⚠️ *Failed to initialize the account*') + ->then(function (message $message) use ($context) { + // Sended the message + + // Ending the conversation process + $context->endConversation(); + }); + } + } +} diff --git a/mirzaev/deeproots/system/models/telegram/middlewares.php b/deeproots/deeproots/system/models/telegram/middlewares.php similarity index 98% rename from mirzaev/deeproots/system/models/telegram/middlewares.php rename to deeproots/deeproots/system/models/telegram/middlewares.php index 4269615..abb438d 100755 --- a/mirzaev/deeproots/system/models/telegram/middlewares.php +++ b/deeproots/deeproots/system/models/telegram/middlewares.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\telegram; +namespace deeproots\deeproots\models\telegram; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\account, - mirzaev\deeproots\models\telegram, - mirzaev\deeproots\models\enumerations\language; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\account, + deeproots\deeproots\models\telegram, + deeproots\deeproots\models\enumerations\language; // Framework for Telegram use Zanzara\Context as context, @@ -24,7 +24,7 @@ use Error as error; /** * Telegram middlewares * - * @package mirzaev\deeproots\models\telegram + * @package deeproots\deeproots\models\telegram * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich diff --git a/mirzaev/deeproots/system/models/telegram/processes/language/select.php b/deeproots/deeproots/system/models/telegram/processes/language/select.php similarity index 92% rename from mirzaev/deeproots/system/models/telegram/processes/language/select.php rename to deeproots/deeproots/system/models/telegram/processes/language/select.php index 02f15e4..d5543fb 100755 --- a/mirzaev/deeproots/system/models/telegram/processes/language/select.php +++ b/deeproots/deeproots/system/models/telegram/processes/language/select.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\telegram\processes\language; +namespace deeproots\deeproots\models\telegram\processes\language; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\enumerations\language; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\enumerations\language; // Framework for Telegram use Zanzara\Context as context, @@ -16,9 +16,9 @@ use Zanzara\Context as context, use mirzaev\baza\record; /** - * Telegram language select + * Telegram language select * - * @package mirzaev\deeproots\models\telegram\processes\language + * @package deeproots\deeproots\models\telegram\processes\language * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich @@ -46,13 +46,13 @@ final class select extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language) { // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { diff --git a/mirzaev/deeproots/system/models/telegram/processes/question/create.php b/deeproots/deeproots/system/models/telegram/processes/question/create.php similarity index 82% rename from mirzaev/deeproots/system/models/telegram/processes/question/create.php rename to deeproots/deeproots/system/models/telegram/processes/question/create.php index 8938f2a..e40dc45 100755 --- a/mirzaev/deeproots/system/models/telegram/processes/question/create.php +++ b/deeproots/deeproots/system/models/telegram/processes/question/create.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\telegram\processes\question; +namespace deeproots\deeproots\models\telegram\processes\question; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\question, - mirzaev\deeproots\models\question\localization, - mirzaev\deeproots\models\answer, - mirzaev\deeproots\models\enumerations\language, - mirzaev\deeproots\models\telegram\commands, - mirzaev\deeproots\models\telegram\processes\question\search as process_question_search; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\question, + deeproots\deeproots\models\question\localization, + deeproots\deeproots\models\answer, + deeproots\deeproots\models\enumerations\language, + deeproots\deeproots\models\telegram\commands, + deeproots\deeproots\models\telegram\processes\question\search as process_question_search; // Framework for Telegram use Zanzara\Context as context, @@ -21,9 +21,9 @@ use Zanzara\Context as context, use mirzaev\baza\record; /** - * Question create (system) + * Question create (system) * - * @package mirzaev\deeproots\models\telegram\processes\question + * @package deeproots\deeproots\models\telegram\processes\question * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich @@ -54,13 +54,13 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language instanceof language) { // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { diff --git a/mirzaev/deeproots/system/models/telegram/processes/question/localization/create.php b/deeproots/deeproots/system/models/telegram/processes/question/localization/create.php similarity index 97% rename from mirzaev/deeproots/system/models/telegram/processes/question/localization/create.php rename to deeproots/deeproots/system/models/telegram/processes/question/localization/create.php index f441380..8f7ee32 100755 --- a/mirzaev/deeproots/system/models/telegram/processes/question/localization/create.php +++ b/deeproots/deeproots/system/models/telegram/processes/question/localization/create.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\telegram\processes\question\localization; +namespace deeproots\deeproots\models\telegram\processes\question\localization; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\question, - mirzaev\deeproots\models\question\localization, - mirzaev\deeproots\models\answer, - mirzaev\deeproots\models\enumerations\language, - mirzaev\deeproots\models\telegram\commands; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\question, + deeproots\deeproots\models\question\localization, + deeproots\deeproots\models\answer, + deeproots\deeproots\models\enumerations\language, + deeproots\deeproots\models\telegram\commands; // Framework for Telegram use Zanzara\Context as context, @@ -20,9 +20,9 @@ use Zanzara\Context as context, use mirzaev\baza\record; /** - * Question localization create (system) + * Question localization create (system) * - * @package mirzaev\deeproots\models\telegram\processes\question\localization + * @package deeproots\deeproots\models\telegram\processes\question\localization * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich @@ -53,13 +53,13 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language instanceof language) { // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -161,7 +161,7 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -252,13 +252,13 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language instanceof language) { // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -414,13 +414,13 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language) { // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -572,13 +572,13 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language instanceof language) { - // Initialized language + // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -688,7 +688,7 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -724,7 +724,7 @@ final class create extends core $spaces = 0; foreach ($matches[0] as $match) { - // Iterating over found restricted characters + // Iterating over found restricted characters if ($match === ' ') { // Space-character @@ -918,7 +918,7 @@ final class create extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { diff --git a/mirzaev/deeproots/system/models/telegram/processes/question/search.php b/deeproots/deeproots/system/models/telegram/processes/question/search.php similarity index 98% rename from mirzaev/deeproots/system/models/telegram/processes/question/search.php rename to deeproots/deeproots/system/models/telegram/processes/question/search.php index 659851d..9a28fde 100755 --- a/mirzaev/deeproots/system/models/telegram/processes/question/search.php +++ b/deeproots/deeproots/system/models/telegram/processes/question/search.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\telegram\processes\question; +namespace deeproots\deeproots\models\telegram\processes\question; // Files of the project -use mirzaev\deeproots\models\core, - mirzaev\deeproots\models\question, - mirzaev\deeproots\models\question\localization as question_localization, - mirzaev\deeproots\models\answer, - mirzaev\deeproots\models\enumerations\language, - mirzaev\deeproots\models\telegram\commands, - mirzaev\deeproots\models\telegram\buttons\question\search as buttons_question_search, - mirzaev\deeproots\models\telegram\traits\escape; +use deeproots\deeproots\models\core, + deeproots\deeproots\models\question, + deeproots\deeproots\models\question\localization as question_localization, + deeproots\deeproots\models\answer, + deeproots\deeproots\models\enumerations\language, + deeproots\deeproots\models\telegram\commands, + deeproots\deeproots\models\telegram\buttons\question\search as buttons_question_search, + deeproots\deeproots\models\telegram\traits\escape; // Baza database use mirzaev\baza\record; @@ -25,9 +25,9 @@ use Zanzara\Context as context, use function React\Async\await; /** - * Question create (system) + * Question create (system) * - * @package mirzaev\deeproots\models\telegram\processes\question + * @package deeproots\deeproots\models\telegram\processes\question * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich @@ -61,13 +61,13 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language instanceof language) { // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -174,7 +174,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -258,13 +258,13 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing language + // Initializing language $language = $context->get('language'); if ($language) { // Initialized language - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -590,7 +590,7 @@ final class search extends core // Initializing the next page existence status $next = count($questions) > $page; - // Deleting the additional readed questions + // Deleting the additional readed questions unset($questions[$page]); // Sending the message @@ -676,7 +676,7 @@ final class search extends core } if ($next) { - // Exists the next page + // Exists the next page // Sending the message $context->sendMessage( @@ -835,7 +835,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -919,7 +919,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -951,7 +951,7 @@ final class search extends core static::search($context); }); } else if ($button === 'delete') { - // Delete + // Delete // Writing into the question search process buffer $search['identifier'] = null; @@ -995,7 +995,7 @@ final class search extends core $characters = []; foreach ($matches[0] as $match) { - // Iterating over found restricted characters + // Iterating over found restricted characters // Writing into the buffer of found restricted characers $characters[] = $match; @@ -1155,7 +1155,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -1187,7 +1187,7 @@ final class search extends core static::search($context); }); } else if ($button === 'delete') { - // Delete + // Delete // Writing into the question search process buffer $search['text'] = null; @@ -1348,7 +1348,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -1380,7 +1380,7 @@ final class search extends core static::search($context); }); } else if ($button === 'delete') { - // Delete + // Delete // Writing into the question search process buffer $search['A'] = null; @@ -1543,7 +1543,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -1575,7 +1575,7 @@ final class search extends core static::search($context); }); } else if ($button === 'delete') { - // Delete + // Delete // Writing into the question search process buffer $search['B'] = null; @@ -1737,7 +1737,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -1769,7 +1769,7 @@ final class search extends core static::search($context); }); } else if ($button === 'delete') { - // Delete + // Delete // Writing into the question search process buffer $search['C'] = null; @@ -1931,7 +1931,7 @@ final class search extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { @@ -1963,7 +1963,7 @@ final class search extends core static::search($context); }); } else if ($button === 'delete') { - // Delete + // Delete // Writing into the question search process buffer $search['D'] = null; @@ -2211,7 +2211,7 @@ final class search extends core unset($case, $model_question, $model_question_localization, $model_answer, $amount); // Exit (success) return sprintf( << @@ -50,12 +50,12 @@ final class settings extends core if ($account instanceof record) { // Initialized the account - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { // Initialized localization - + // Initializing the account model $model = new account(); @@ -81,7 +81,7 @@ final class settings extends core middlewares::localization($context, new node(function (context $context) use ($account, $updated) { // Updated localization - // Initializing localization + // Initializing localization $localization = $context->get('localization'); if ($localization) { diff --git a/mirzaev/deeproots/system/models/telegram/traits/escape.php b/deeproots/deeproots/system/models/telegram/traits/escape.php similarity index 89% rename from mirzaev/deeproots/system/models/telegram/traits/escape.php rename to deeproots/deeproots/system/models/telegram/traits/escape.php index a9dcf87..1963878 100644 --- a/mirzaev/deeproots/system/models/telegram/traits/escape.php +++ b/deeproots/deeproots/system/models/telegram/traits/escape.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace mirzaev\deeproots\models\telegram\traits; +namespace deeproots\deeproots\models\telegram\traits; /** * Escape * - * @package mirzaev\deeproots\models\telegram\traits + * @package deeproots\deeproots\models\telegram\traits * * @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License * @author Arsen Mirzaev Tatyano-Muradovich diff --git a/mirzaev/deeproots/system/public/css/fonts/dejavu.css b/deeproots/deeproots/system/public/css/fonts/dejavu.css similarity index 100% rename from mirzaev/deeproots/system/public/css/fonts/dejavu.css rename to deeproots/deeproots/system/public/css/fonts/dejavu.css diff --git a/mirzaev/deeproots/system/public/css/fonts/fira.css b/deeproots/deeproots/system/public/css/fonts/fira.css similarity index 100% rename from mirzaev/deeproots/system/public/css/fonts/fira.css rename to deeproots/deeproots/system/public/css/fonts/fira.css diff --git a/mirzaev/deeproots/system/public/css/fonts/hack.css b/deeproots/deeproots/system/public/css/fonts/hack.css similarity index 100% rename from mirzaev/deeproots/system/public/css/fonts/hack.css rename to deeproots/deeproots/system/public/css/fonts/hack.css diff --git a/mirzaev/deeproots/system/public/fonts/commissioner.ttf b/deeproots/deeproots/system/public/fonts/commissioner.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/commissioner.ttf rename to deeproots/deeproots/system/public/fonts/commissioner.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Bold.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans-Oblique.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSans.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSans.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansCondensed.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSansMono.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Bold.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif-Italic.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerif.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf diff --git a/mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf b/deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf similarity index 100% rename from mirzaev/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf rename to deeproots/deeproots/system/public/fonts/dejavu/DejaVuLGCSerifCondensed.ttf diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraMono-Bold.woff b/deeproots/deeproots/system/public/fonts/fira/FiraMono-Bold.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraMono-Bold.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraMono-Bold.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraMono-Bold.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraMono-Bold.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraMono-Bold.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraMono-Bold.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraMono-Medium.woff b/deeproots/deeproots/system/public/fonts/fira/FiraMono-Medium.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraMono-Medium.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraMono-Medium.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraMono-Medium.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraMono-Medium.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraMono-Medium.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraMono-Medium.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraMono-Regular.woff b/deeproots/deeproots/system/public/fonts/fira/FiraMono-Regular.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraMono-Regular.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraMono-Regular.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraMono-Regular.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraMono-Regular.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraMono-Regular.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraMono-Regular.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Bold.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Bold.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Bold.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Bold.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Bold.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Bold.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Bold.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Bold.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-BoldItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Book.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Book.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Book.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Book.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Book.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Book.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Book.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Book.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-BookItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Eight.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Eight.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Eight.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Eight.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Eight.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Eight.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Eight.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Eight.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-EightItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBold.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraBoldItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLight.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ExtraLightItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Four.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Four.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Four.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Four.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Four.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Four.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Four.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Four.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-FourItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Hair.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Hair.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Hair.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Hair.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Hair.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Hair.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Hair.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Hair.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-HairItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Heavy.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-HeavyItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Italic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Italic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Italic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Italic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Italic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Italic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Italic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Italic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Light.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Light.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Light.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Light.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Light.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Light.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Light.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Light.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-LightItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Medium.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Medium.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Medium.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Medium.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Medium.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Medium.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Medium.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Medium.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-MediumItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Regular.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Regular.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Regular.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Regular.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Regular.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Regular.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Regular.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Regular.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBold.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-SemiBoldItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Thin.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Thin.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Thin.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Thin.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Thin.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Thin.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Thin.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Thin.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-ThinItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Two.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Two.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Two.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Two.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Two.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Two.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Two.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Two.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-TwoItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-Ultra.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLight.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff b/deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 b/deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 rename to deeproots/deeproots/system/public/fonts/fira/FiraSans-UltraLightItalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bold-subset.woff b/deeproots/deeproots/system/public/fonts/hack/hack-bold-subset.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bold-subset.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-bold-subset.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bold-subset.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-bold-subset.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bold-subset.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-bold-subset.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bold.woff b/deeproots/deeproots/system/public/fonts/hack/hack-bold.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bold.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-bold.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bold.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-bold.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bold.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-bold.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff b/deeproots/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-bolditalic-subset.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic.woff b/deeproots/deeproots/system/public/fonts/hack/hack-bolditalic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-bolditalic.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-bolditalic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-bolditalic.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-bolditalic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-italic-subset.woff b/deeproots/deeproots/system/public/fonts/hack/hack-italic-subset.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-italic-subset.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-italic-subset.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-italic-subset.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-italic-subset.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-italic-subset.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-italic-subset.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-italic.woff b/deeproots/deeproots/system/public/fonts/hack/hack-italic.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-italic.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-italic.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-italic.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-italic.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-italic.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-italic.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-regular-subset.woff b/deeproots/deeproots/system/public/fonts/hack/hack-regular-subset.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-regular-subset.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-regular-subset.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-regular-subset.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-regular-subset.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-regular-subset.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-regular-subset.woff2 diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-regular.woff b/deeproots/deeproots/system/public/fonts/hack/hack-regular.woff similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-regular.woff rename to deeproots/deeproots/system/public/fonts/hack/hack-regular.woff diff --git a/mirzaev/deeproots/system/public/fonts/hack/hack-regular.woff2 b/deeproots/deeproots/system/public/fonts/hack/hack-regular.woff2 similarity index 100% rename from mirzaev/deeproots/system/public/fonts/hack/hack-regular.woff2 rename to deeproots/deeproots/system/public/fonts/hack/hack-regular.woff2 diff --git a/mirzaev/deeproots/system/public/index.php b/deeproots/deeproots/system/public/index.php similarity index 82% rename from mirzaev/deeproots/system/public/index.php rename to deeproots/deeproots/system/public/index.php index b8fa7e6..a226324 100755 --- a/mirzaev/deeproots/system/public/index.php +++ b/deeproots/deeproots/system/public/index.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace mirzaev\deeproots; +namespace deeproots\deeproots; // Framework for PHP use mirzaev\minimal\core, @@ -13,22 +13,22 @@ use mirzaev\minimal\core, ini_set('display_errors', 1); ini_set('display_startup_errors', 1); */ -// Initializing path to the public directory +// Initializing path to the public directory define('INDEX', __DIR__); // Initializing path to the project root directory define('ROOT', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR); -// Initializing path to the directory of views +// Initializing path to the directory of views define('VIEWS', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'views'); -// Initializing path to the directory of settings +// Initializing path to the directory of settings define('SETTINGS', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'settings'); -// Initializing system settings +// Initializing system settings require SETTINGS . DIRECTORY_SEPARATOR . 'system.php'; -// Initializing path to the directory of the storage +// Initializing path to the directory of the storage define('STORAGE', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'storage'); // Initializing path to the databases directory diff --git a/mirzaev/deeproots/system/public/telegram.php b/deeproots/deeproots/system/public/telegram.php similarity index 79% rename from mirzaev/deeproots/system/public/telegram.php rename to deeproots/deeproots/system/public/telegram.php index 6ab3b7a..451b57b 100755 --- a/mirzaev/deeproots/system/public/telegram.php +++ b/deeproots/deeproots/system/public/telegram.php @@ -2,32 +2,32 @@ declare(strict_types=1); -namespace mirzaev\deeproots; +namespace deeproots\deeproots; // Files of the project -use mirzaev\deeproots\models\telegram\middlewares, - mirzaev\deeproots\models\telegram\commands, - mirzaev\deeproots\models\telegram\settings, - mirzaev\deeproots\models\telegram\processes\question\search as process_question_search, - mirzaev\deeproots\models\telegram\buttons\question\search as buttons_question_search, - mirzaev\deeproots\models\telegram\processes\question\create as process_question_create, - mirzaev\deeproots\models\enumerations\language; +use deeproots\deeproots\models\telegram\middlewares, + deeproots\deeproots\models\telegram\commands, + deeproots\deeproots\models\telegram\settings, + deeproots\deeproots\models\telegram\processes\question\search as process_question_search, + deeproots\deeproots\models\telegram\buttons\question\search as buttons_question_search, + deeproots\deeproots\models\telegram\processes\question\create as process_question_create, + deeproots\deeproots\models\enumerations\language; // Framework for Telegram use Zanzara\Zanzara as zanzara, - Zanzara\Context as context, - Zanzara\Config as config; + Zanzara\Context as context, + Zanzara\Config as config; // Enabling debugging /* ini_set('error_reporting', E_ALL); -ini_set('display_errors', 1); -ini_set('display_startup_errors', 1); */ + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); */ -// Initializing path to the public directory +// Initializing path to the public directory define('INDEX', __DIR__); // Initializing path to the root directory -define('ROOT', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR); +define('ROOT', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR); // Initializing path to the settings directory define('SETTINGS', INDEX . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'settings'); @@ -82,10 +82,10 @@ $robot->onCommand('society', [commands::class, 'society']); // Initializing the robot settings language buttons handlers foreach (language::cases() as $language) { - // Iterating over languages + // Iterating over languages - // Initializing language buttons - $robot->onCbQueryData(['settings_language_' . $language->name], fn(context $context) => settings::language($context, $language)); + // Initializing language buttons + $robot->onCbQueryData(['settings_language_' . $language->name], fn(context $context) => settings::language($context, $language)); }; $robot->onCbQueryData(['system_questions_search_identifier'], [buttons_question_search::class, 'identifier'])->middleware([middlewares::class, 'system_questions']); diff --git a/mirzaev/deeproots/system/public/themes/default/css/aside.css b/deeproots/deeproots/system/public/themes/default/css/aside.css similarity index 100% rename from mirzaev/deeproots/system/public/themes/default/css/aside.css rename to deeproots/deeproots/system/public/themes/default/css/aside.css diff --git a/mirzaev/deeproots/system/public/themes/default/css/colors.css b/deeproots/deeproots/system/public/themes/default/css/colors.css similarity index 100% rename from mirzaev/deeproots/system/public/themes/default/css/colors.css rename to deeproots/deeproots/system/public/themes/default/css/colors.css diff --git a/mirzaev/deeproots/system/public/themes/default/css/fonts.css b/deeproots/deeproots/system/public/themes/default/css/fonts.css similarity index 100% rename from mirzaev/deeproots/system/public/themes/default/css/fonts.css rename to deeproots/deeproots/system/public/themes/default/css/fonts.css diff --git a/mirzaev/deeproots/system/public/themes/default/css/footer.css b/deeproots/deeproots/system/public/themes/default/css/footer.css similarity index 100% rename from mirzaev/deeproots/system/public/themes/default/css/footer.css rename to deeproots/deeproots/system/public/themes/default/css/footer.css diff --git a/mirzaev/deeproots/system/public/themes/default/css/header.css b/deeproots/deeproots/system/public/themes/default/css/header.css similarity index 100% rename from mirzaev/deeproots/system/public/themes/default/css/header.css rename to deeproots/deeproots/system/public/themes/default/css/header.css diff --git a/mirzaev/deeproots/system/public/themes/default/css/main.css b/deeproots/deeproots/system/public/themes/default/css/main.css similarity index 100% rename from mirzaev/deeproots/system/public/themes/default/css/main.css rename to deeproots/deeproots/system/public/themes/default/css/main.css diff --git a/mirzaev/deeproots/system/public/themes/default/css/system.css b/deeproots/deeproots/system/public/themes/default/css/system.css similarity index 100% rename from mirzaev/deeproots/system/public/themes/default/css/system.css rename to deeproots/deeproots/system/public/themes/default/css/system.css diff --git a/mirzaev/deeproots/system/settings/.gitignore b/deeproots/deeproots/system/settings/.gitignore similarity index 100% rename from mirzaev/deeproots/system/settings/.gitignore rename to deeproots/deeproots/system/settings/.gitignore diff --git a/mirzaev/deeproots/system/settings/arangodb.php.sample b/deeproots/deeproots/system/settings/arangodb.php.sample similarity index 100% rename from mirzaev/deeproots/system/settings/arangodb.php.sample rename to deeproots/deeproots/system/settings/arangodb.php.sample diff --git a/mirzaev/deeproots/system/settings/system.php.sample b/deeproots/deeproots/system/settings/system.php.sample similarity index 100% rename from mirzaev/deeproots/system/settings/system.php.sample rename to deeproots/deeproots/system/settings/system.php.sample diff --git a/mirzaev/deeproots/system/settings/telegram.php.sample b/deeproots/deeproots/system/settings/telegram.php.sample similarity index 100% rename from mirzaev/deeproots/system/settings/telegram.php.sample rename to deeproots/deeproots/system/settings/telegram.php.sample diff --git a/mirzaev/deeproots/system/storage/images/mushroom.jpg b/deeproots/deeproots/system/storage/images/mushroom.jpg similarity index 100% rename from mirzaev/deeproots/system/storage/images/mushroom.jpg rename to deeproots/deeproots/system/storage/images/mushroom.jpg diff --git a/deeproots/deeproots/system/views/templater.php b/deeproots/deeproots/system/views/templater.php new file mode 100755 index 0000000..6bd0467 --- /dev/null +++ b/deeproots/deeproots/system/views/templater.php @@ -0,0 +1,210 @@ + + * @author mirzaev + */ +final class templater extends controller implements array_access +{ + /** + * Twig + * + * @var twig $twig Instance of the twig templater + */ + readonly public twig $twig; + + /** + * Variables + * + * @var array $variables Registry of view global variables + */ + public array $variables = []; + + /** + * Constructor of an instance + * + * @return void + */ + public function __construct() + { + // Initializing the Twig instance + $this->twig = new twig(new FilesystemLoader(VIEWS)); + + // Initializing global variables + $this->twig->addGlobal('theme', 'default'); + $this->twig->addGlobal('server', $_SERVER); + $this->twig->addGlobal('cookies', $_COOKIE); + $this->twig->addGlobal('language', $language = $session?->buffer['language'] ?? language::en); + } + + /** + * Render + * + * Render the HTML-document + * + * @param string $file Related path to a HTML-document + * @param array $variables Registry of variables to push into registry of global variables + * + * @return ?string HTML-document + */ + public function render(string $file, array $variables = []): ?string + { + // Generation and exit (success) + return $this->twig->render('themes' . DIRECTORY_SEPARATOR . $this->twig->getGlobals()['theme'] . DIRECTORY_SEPARATOR . $file, $variables + $this->variables); + + } + + /** + * Write + * + * Write the variable into the registry of the view global variables + * + * @param string $name Name of the variable + * @param mixed $value Value of the variable + * + * @return void + */ + public function __set(string $name, mixed $value = null): void + { + // Write the variable and exit (success) + $this->variables[$name] = $value; + } + + /** + * Read + * + * Read the variable from the registry of the view global variables + * + * @param string $name Name of the variable + * + * @return mixed Content of the variable, if they are found + */ + public function __get(string $name): mixed + { + // Read the variable and exit (success) + return $this->variables[$name]; + } + + /** + * Delete + * + * Delete the variable from the registry of the view global variables + * + * @param string $name Name of the variable + * + * @return void + */ + public function __unset(string $name): void + { + // Delete the variable and exit (success) + unset($this->variables[$name]); + } + + /** + * Check of initialization + * + * Check of initialization in the registry of the view global variables + * + * @param string $name Name of the variable + * + * @return bool The variable is initialized? + */ + public function __isset(string $name): bool + { + // Check of initialization of the variable and exit (success) + return isset($this->variables[$name]); + } + + /** + * Write + * + * Write the variable into the registry of the view global variables + * + * @param mixed $name Name of an offset of the variable + * @param mixed $value Value of the variable + * + * @return void + */ + public function offsetSet(mixed $name, mixed $value): void + { + // Write the variable and exit (success) + $this->variables[$name] = $value; + } + + /** + * Read + * + * Read the variable from the registry of the view global variables + * + * @param mixed $name Name of the variable + * + * @return mixed Content of the variable, if they are found + */ + public function offsetGet(mixed $name): mixed + { + // Read the variable and exit (success) + return $this->variables[$name]; + } + + /** + * Delete + * + * Delete the variable from the registry of the view global variables + * + * @param mixed $name Name of the variable + * + * @return void + */ + public function offsetUnset(mixed $name): void + { + // Delete the variable and exit (success) + unset($this->variables[$name]); + } + + /** + * Check of initialization + * + * Check of initialization in the registry of the view global variables + * + * @param mixed $name Name of the variable + * + * @return bool The variable is initialized? + */ + public function offsetExists(mixed $name): bool + { + // Check of initialization of the variable and exit (success) + return isset($this->variables[$name]); + } +} diff --git a/mirzaev/deeproots/system/views/themes/default/aside.html b/deeproots/deeproots/system/views/themes/default/aside.html similarity index 86% rename from mirzaev/deeproots/system/views/themes/default/aside.html rename to deeproots/deeproots/system/views/themes/default/aside.html index afb2aa1..5490d9f 100644 --- a/mirzaev/deeproots/system/views/themes/default/aside.html +++ b/deeproots/deeproots/system/views/themes/default/aside.html @@ -7,4 +7,4 @@ {% endblock %} {% block js %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/mirzaev/deeproots/system/views/themes/default/core.html b/deeproots/deeproots/system/views/themes/default/core.html similarity index 100% rename from mirzaev/deeproots/system/views/themes/default/core.html rename to deeproots/deeproots/system/views/themes/default/core.html diff --git a/mirzaev/deeproots/system/views/themes/default/footer.html b/deeproots/deeproots/system/views/themes/default/footer.html similarity index 100% rename from mirzaev/deeproots/system/views/themes/default/footer.html rename to deeproots/deeproots/system/views/themes/default/footer.html diff --git a/mirzaev/deeproots/system/views/themes/default/head.html b/deeproots/deeproots/system/views/themes/default/head.html similarity index 100% rename from mirzaev/deeproots/system/views/themes/default/head.html rename to deeproots/deeproots/system/views/themes/default/head.html diff --git a/mirzaev/deeproots/system/views/themes/default/header.html b/deeproots/deeproots/system/views/themes/default/header.html similarity index 100% rename from mirzaev/deeproots/system/views/themes/default/header.html rename to deeproots/deeproots/system/views/themes/default/header.html diff --git a/mirzaev/deeproots/system/views/themes/default/index.html b/deeproots/deeproots/system/views/themes/default/index.html similarity index 100% rename from mirzaev/deeproots/system/views/themes/default/index.html rename to deeproots/deeproots/system/views/themes/default/index.html diff --git a/mirzaev/deeproots/system/views/themes/default/js.html b/deeproots/deeproots/system/views/themes/default/js.html similarity index 100% rename from mirzaev/deeproots/system/views/themes/default/js.html rename to deeproots/deeproots/system/views/themes/default/js.html diff --git a/mirzaev/deeproots/system/controllers/core.php b/mirzaev/deeproots/system/controllers/core.php deleted file mode 100755 index 982e8f9..0000000 --- a/mirzaev/deeproots/system/controllers/core.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -class core extends controller -{ - /** - * Language - * - * @var language $language Language - */ - protected language $language = language::en; - - /** - * Response - * - * @see https://wiki.php.net/rfc/property-hooks (find a table about backed and virtual hooks) - * - * @var response $response Response - */ - protected response $response { - // Read - get => $this->response ??= $this->request->response(); - } - - /** - * Errors - * - * @var array $errors Registry of errors - */ - protected array $errors = [ - ]; - - /** - * Constructor - * - * @param minimal $core Instance of the MINIMAL - * @param bool $initialize Initialize a controller? - * - * @return void - */ - public function __construct(minimal $core, bool $initialize = true) - { - // Blocking requests from CloudFlare (better to write this blocking into nginx config file) - if (isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] === 'nginx-ssl early hints') return status::bruh->label; - - // For the extends system - parent::__construct(core: $core); - } -} diff --git a/mirzaev/deeproots/system/localizations/english.php b/mirzaev/deeproots/system/localizations/english.php deleted file mode 100644 index 578a9f8..0000000 --- a/mirzaev/deeproots/system/localizations/english.php +++ /dev/null @@ -1,184 +0,0 @@ - 'DeepRoots', - 'empty' => 'Empty', - 'yes' => 'Yes', - 'no' => 'No', - - // Main menu - 'menu_title' => 'Main menu', - 'menu_button_start' => 'Start', - 'menu_button_rating' => 'Rating', - 'menu_button_balance' => 'Balance', - 'menu_button_system_accounts' => 'Accounts', - 'menu_button_system_questions' => 'Questions', - 'menu_button_system_settings' => 'Settings', - 'menu_system_authorized' => 'System authorization found', - - // Account - 'account_title' => 'Account', - 'account_identifier' => 'Identifier', - 'account_authorized_system' => 'Access to the system', - 'account_authorized_game_play' => 'Access to play games', - 'account_authorized_rating_display' => 'Access to display in the rating', - 'account_authorized_balance_deposit' => 'Access to deposit into the balance', - 'account_authorized_balance_withdraw' => 'Access to withdraw from the balance', - 'account_authorized_settings' => 'Access to settings', - 'account_authorized_system_accounts' => 'System access to accounts', - 'account_authorized_system_questions' => 'System access to questions', - 'account_authorized_system_settings' => 'System access to system settings', - - // Language setting - 'settings_select_language_title' => 'Select language', - 'settings_select_language_description' => 'The selected language will be writed in your account settings', - 'settings_language_update_success' => 'Language replaced:', - 'settings_language_update_fail' => 'Failed to replace language', - - // Language selection - 'select_language_title' => 'Select language', - 'select_language_description' => 'The selected language will be used in the current process', - 'select_language_button_add' => 'Add a language', - - // Repository - 'repository_title' => 'Repository', - 'repository_text' => << 'The code', - 'repository_button_issues' => 'Issues', - 'repository_button_suggestions' => 'Suggestions', - - // Author - 'author_title' => 'Author', - 'author_text' => << 'Neurojournal', - 'author_button_projects' => 'Projects', - 'author_button_twitter' => 'Twitter', - 'author_button_bluesky' => 'Bluesky', - 'author_button_bastyon' => 'Bastyon', - 'author_button_youtube_english' => 'YouTube', - 'author_button_youtube_russian' => 'YouTube', - 'author_button_message' => 'Send a message', - - // Questions (system) - 'system_questions_title' => 'The questions registry', - 'system_questions_questions' => 'Questions', - 'system_questions_answers' => 'Answers', - 'system_questions_answers_amount_matches' => 'The amount of questions matches the amount of answers', - 'system_questions_answers_amount_different' => 'The amount of questions does not match the amount of answers', - 'system_questions_amount_matches' => 'The amount of questions matches the amount of localizations', - 'system_questions_amount_different' => 'The amount of questions does not match the amount of localizations', - 'system_questions_localizations_amount_matches' => 'Amounts of localizations matches with each other', - 'system_questions_localizations_amount_different' => 'Amounts of localizations does not match with each other', - 'system_questions_button_search' => 'Search', - 'system_questions_button_create' => 'Create', - - // Question create (system) - 'system_questions_create_created' => 'The question was created', - - // Question search (system) - 'system_questions_search_title' => 'The question search process', - 'system_questions_search_continued' => 'The process of the question search found and continued', - 'system_questions_search_started' => 'The process of the question search started', - 'system_questions_search_not_started' => 'The process of the question search is not started', - 'system_questions_search_ended' => 'The process of the question search ended', - 'system_questions_search_page_next_exists' => 'There are more questions in the registry', - 'system_questions_search_page_next_not_exists' => 'There are no more questions in the registry', - 'system_questions_search_empty' => 'No questions found', - 'system_questions_search_question_title' => 'Question', - 'system_questions_search_question_answer' => 'Answer', - 'system_questions_search_identifier_request_title' => 'Enter identifier', - 'system_questions_search_identifier_request_not_acceptable' => 'Failed to process the identifier', - 'system_questions_search_identifier_request_too_short' => 'Identifier length must be \>\= 1 and \<\= 12', - 'system_questions_search_identifier_request_too_long' => 'Identifier length must be \>\= 1 and \<\= 12', - 'system_questions_search_identifier_request_restricted_characters_title' => "Restricted any characters except digits", - 'system_questions_search_identifier_request_restricted_characters_description' => "Remove these characters:", - 'system_questions_search_identifier_cancel_success' => 'Cancelled the identifier replacing process', - 'system_questions_search_identifier_delete_success' => 'Identifier deleted', - 'system_questions_search_identifier_update_success' => 'Identifier replaced:', - 'system_questions_search_identifier_update_fail' => 'Failed to replace identifier', - 'system_questions_search_text_request_title' => 'Enter text', - 'system_questions_search_text_request_not_acceptable' => 'Failed to process the text', - 'system_questions_search_text_request_too_short' => 'Text length must be \>\= 3 and \<\= 256', - 'system_questions_search_text_request_too_long' => 'Text length must be \>\= 3 and \<\= 256', - 'system_questions_search_text_cancel_success' => 'Cancelled the text replacing process', - 'system_questions_search_text_delete_success' => 'Text deleted', - 'system_questions_search_text_update_success' => 'Text replaced:', - 'system_questions_search_text_update_fail' => 'Failed to replace text', - 'system_questions_search_a_request_title' => 'Enter A\-answer', - 'system_questions_search_a_request_not_acceptable' => 'Failed to process the A\-answer', - 'system_questions_search_a_request_too_short' => 'A\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_a_request_too_long' => 'A\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_a_cancel_success' => 'Cancelled the A\-answer replacing process', - 'system_questions_search_a_delete_success' => 'A\-answer deleted', - 'system_questions_search_a_update_success' => 'A\-answer replaced:', - 'system_questions_search_a_update_fail' => 'Failed to replace A\-answer', - 'system_questions_search_b_request_title' => 'Enter B\-answer', - 'system_questions_search_b_request_not_acceptable' => 'Failed to process the B\-answer', - 'system_questions_search_b_request_too_short' => 'B\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_b_request_too_long' => 'B\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_b_cancel_success' => 'Cancelled the B\-answer replacing process', - 'system_questions_search_b_delete_success' => 'B\-answer deleted', - 'system_questions_search_b_update_success' => 'B\-answer replaced:', - 'system_questions_search_b_update_fail' => 'Failed to replace B\-answer', - 'system_questions_search_c_request_title' => 'Enter C\-answer', - 'system_questions_search_c_request_not_acceptable' => 'Failed to process the C\-answer', - 'system_questions_search_c_request_too_short' => 'C\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_c_request_too_long' => 'C\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_c_cancel_success' => 'Cancelled the C\-answer replacing process', - 'system_questions_search_c_delete_success' => 'C\-answer deleted', - 'system_questions_search_c_update_success' => 'C\-answer replaced:', - 'system_questions_search_c_update_fail' => 'Failed to replace C\-answer', - 'system_questions_search_d_request_title' => 'Enter D\-answer', - 'system_questions_search_d_request_not_acceptable' => 'Failed to process the D\-answer', - 'system_questions_search_d_request_too_short' => 'D\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_d_request_too_long' => 'D\-answer length must be \>\= 3 and \<\= 128', - 'system_questions_search_d_cancel_success' => 'Cancelled the D\-answer replacing process', - 'system_questions_search_d_delete_success' => 'D\-answer deleted', - 'system_questions_search_d_update_success' => 'D\-answer replaced:', - 'system_questions_search_d_update_fail' => 'Failed to replace D\-answer', - 'system_questions_search_button_delete' => 'Delete', - 'system_questions_search_button_author' => 'Author', - 'system_questions_search_button_active' => 'Active', - 'system_questions_search_button_inactive' => 'Inactive', - 'system_questions_search_button_answer' => 'Answer', - 'system_questions_search_button_localizations' => 'Localizations', - 'system_questions_search_button_identifier' => 'Identifier', - 'system_questions_search_button_text' => 'Text', - 'system_questions_search_button_a' => 'A', - 'system_questions_search_button_b' => 'B', - 'system_questions_search_button_c' => 'C', - 'system_questions_search_button_d' => 'D', - 'system_questions_search_button_delete' => 'Delete', - 'system_questions_search_button_cancel' => 'Cancel', - 'system_questions_search_button_page_next' => 'Next page', - 'system_questions_search_button_end' => 'End the search process', - 'system_questions_search_not_localized' => 'Failed to initialize the question localization', - - // Question localization create (system) - 'system_questions_localization_create_created' => 'The question localization was created', - - // Authorization - 'not_authorized_system' => 'You do not have access to the system', - 'not_authorized_game_play' => 'You do not have access to play games', - 'not_authorized_rating_display' => 'You do not have access to display in the rating', - 'not_authorized_balance_deposit' => 'You do not have access to deposit into the balance', - 'not_authorized_balance_withdraw' => 'You do not have access to withdraw from the balance', - 'not_authorized_settings' => 'You do not have access to the settings', - 'not_authorized_system_accounts' => 'You do not have system access to the accounts', - 'not_authorized_system_questions' => 'You do not have system access to the questions', - 'not_authorized_system_settings' => 'You do not have system access to the system settings', - - // Other - 'why_so_shroomious' => 'why so shroomious', -]; diff --git a/mirzaev/deeproots/system/models/telegram.php b/mirzaev/deeproots/system/models/telegram.php deleted file mode 100755 index 9bdb48d..0000000 --- a/mirzaev/deeproots/system/models/telegram.php +++ /dev/null @@ -1,192 +0,0 @@ - - */ -final class telegram extends core -{ - /** - * File - * - * @var string $database Path to the database file - */ - protected string $file = DATABASES . DIRECTORY_SEPARATOR . 'telegram.baza'; - - /** - * Database - * - * @var database $database The database - */ - public protected(set) database $database; - - /** - * Constructor - * - * @return void - */ - public function __construct() - { - // Initializing the database - $this->database = new database() - ->encoding(encoding::utf8) - ->columns( - new column('identifier', type::integer_unsigned), - new column('domain', type::string, ['length' => 32]), - new column('name_first', type::string, ['length' => 64]), - new column('name_second', type::string, ['length' => 64]), - new column('language', type::string, ['length' => 2]), - new column('robot', type::char), - new column('updated', type::integer_unsigned), - new column('created', type::integer_unsigned) - ) - ->connect($this->file); - } - - /** - * Initialize - * - * Searches for the telegram account record in the database, and if it does not find it, then create - * - * @param model $telegram The telegram account - * - * @throws exception_runtime if update the telegram account record in the database by the telegram account values - * @throws exception_runtime if failed to find the created telegram account - * @throws exception_runtime if failed to create the telegram account - * - * @return record The telegram account record from the database - */ - public function initialize(model $telegram): record - { - // Searching for the account in the database - $account = $this->database->read(filter: fn(record $record) => $record->identifier === $telegram->getId(), amount: 1)[0] ?? null; - - if ($account instanceof record) { - // Found the telegram account record - - if ( - $account->name_first !== $telegram->getFirstName() || - $account->name_second !== $telegram->getLastName() || - $account->domain !== $telegram->getUsername() - ) { - // The telegram account was updated - - // Updating the account in the database - $updated = $this->database->read( - filter: fn(record $record) => $record->identifier === $telegram->getId(), - update: function (record &$record) use ($telegram){ - // Writing new values into the record - $record->name_first = $telegram->getFirstName(); - $record->name_second = $telegram->getLastName(); - $record->domain = $telegram->getUsername(); - $record->updated = svoboda::timestamp(); - }, - amount: 1 - )[0] ?? null; - - if ($updated instanceof record && $updated->values() !== $account->values()) { - // Updated the account in the database - - // Exit (success) - return $updated; - } else { - // Not updated the account in the database - - // Exit (fail) - throw new exception_runtime('Failed to update the account record in the database by the telegram account values'); - } - } - - // Exit (success) - return $account; - } else { - // Not found the account record - - if ($this->create($telegram)) { - // Created the account - - // Searching for the created telegram account in the database - $account = $this->database->read(filter: fn(record $record) => $record->identifier === $telegram->getId(), amount: 1)[0] ?? null; - - if ($account instanceof record) { - // Found the created telegram account - - // Exit (success) - return $account; - } else { - // Not found the created telegram account - - // Exit (fail) - throw new exception_runtime('Failed to find the created telegram account'); - } - } else { - // Not created the telegram account - - // Exit (fail) - throw new exception_runtime('Failed to create the telegram account'); - } - } - } - - /** - * Create - * - * Creates the account record in the database - * - * @param model $telegram The telegram account - * - * @return int|false The record identifier, if created - */ - public function create(model $telegram): int|false - { - // Initializing the identifier - $identifier = (int) $telegram->getId(); - - // Initializing the record - $record = $this->database->record( - $identifier, - $telegram->getUsername(), - $telegram->getFirstName(), - $telegram->getLastName(), - $telegram->getLanguageCode(), - (int) $telegram->isBot(), - svoboda::timestamp(), - svoboda::timestamp() - ); - - // Creating the record in the database - $created = $this->database->write($record); - - // Exit (success) - return $created ? $identifier : false; - } -} diff --git a/mirzaev/deeproots/system/models/telegram/commands.php b/mirzaev/deeproots/system/models/telegram/commands.php deleted file mode 100755 index d7a8eb7..0000000 --- a/mirzaev/deeproots/system/models/telegram/commands.php +++ /dev/null @@ -1,741 +0,0 @@ - - */ -final class commands extends core -{ - /** - * Menu - * - * Responce for the commands: "/start", '/menu' - * - * @param context $context Request data from Telegram - * - * @return void - */ - public static function menu(context $context): void - { - // Initializing the account - $account = $context->get('account'); - - if ($account instanceof record) { - // Initialized the account - - // Initializing localization - $localization = $context->get('localization'); - - if ($localization) { - // Initialized localization - - // Initializing the title - $title = 'πŸ“‹ *' . $localization['menu_title'] . '*'; - - // Sending the message - $context->sendMessage( - << [ - 'inline_keyboard' => [ - [ - [ - 'text' => '🧠 ' . $localization['menu_button_start'], - 'callback_data' => 'projects' - ] - ], - [ - [ - 'text' => 'πŸ“ˆ ' . $localization['menu_button_rating'], - 'callback_data' => 'rating' - ], - [ - 'text' => 'πŸ’° ' . $localization['menu_button_balance'], - 'callback_data' => 'balance' - ] - ] - ], - 'disable_notification' => true, - 'remove_keyboard' => true - ], - ] - )->then(function (message $message) use ($context, $localization, $account) { - // Sended the message - - if ( - $account->authorized_system_accounts || - $account->authorized_system_questions || - $account->authorized_system_settings - ) { - // Found at least one system authorization - - // Initializing the keyboard buffer - $keyboard = []; - - if ($account->authorized_system_accounts) { - // Authorized to accounts - - // Generating the button and writing into the keyboard buffer - $keyboard[] = [ - [ - 'text' => '🐣 ' . $localization['menu_button_system_accounts'], - 'callback_data' => 'system_accounts' - ] - ]; - } - - if ($account->authorized_system_questions) { - // Authorized to questions - - // Generating the button and writing into the keyboard buffer - $keyboard[] = [ - [ - 'text' => 'πŸ—‚ ' . $localization['menu_button_system_questions'], - 'callback_data' => 'system_questions' - ] - ]; - } - - if ($account->authorized_system_settings) { - // Authorized to system settings - - // Generating the button and writing into the keyboard buffer - $keyboard[] = [ - [ - 'text' => 'βš™οΈ ' . $localization['menu_button_system_settings'], - 'callback_data' => 'system_settings' - ] - ]; - } - - // Sending the message - $context->sendMessage( - 'πŸ›  ' . $localization['menu_system_authorized'], - [ - 'reply_markup' => [ - 'inline_keyboard' => $keyboard, - 'disable_notification' => true, - 'remove_keyboard' => true - ], - ] - ); - } - }); - } else { - // Not initialized localization - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize localization*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the account*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } - - /** - * Account - * - * Responce for the command: "/account" - * - * Sends information about account with menu - * - * @param context $context Request data from Telegram - * - * @return void - */ - public static function account(context $context): void - { - // Initializing the telegram account - $telegram = $context->get('telegram'); - - if ($telegram instanceof record) { - // Initialized the telegram account - - // Initializing the account - $account = $context->get('account'); - - if ($account instanceof record) { - // Initialized the account - - // Initializing localization - $localization = $context->get('localization'); - - if ($localization) { - // Initialized localization - - // Initializing title for the message - $title = '🫡 ' . $localization['account_title']; - - // Initializing the account identifier row for the message - $identifier = '*' . $localization['account_identifier'] . ":* $account->identifier \($telegram->identifier\)"; - - // Declaring buufer of rows about authorizations - $authorizations = ''; - - // Initializing rows about authorization - foreach ($account->values() as $key => $value) { - // Iterating over account parameters - - if (str_starts_with($key, 'authorized_')) { - // Iterating over account authorizations - - if (str_starts_with($key, 'authorized_system_') && $value) { - // A system authorization - - // Writing into buffer of rows about authorizations - $authorizations .= 'βœ… ⚠️ *' . ($localization["account_$key"] ?? $key) . ':* ' . $localization['yes'] . "\n"; - } else { - // Not a system authorization - - // Writing into buffer of rows about authorizations - $authorizations .= ($value ? 'βœ…' : '❎') . ' *' . ($localization["account_$key"] ?? $key) . ':* ' . ($value ? $localization['yes'] : $localization['no']) . "\n"; - } - } - } - - // Trimming the last line break character - $authorizations = trim($authorizations, "\n"); - - // Sending the message - $context->sendMessage( - <<sendMessage('⚠️ *Failed to initialize localization*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the account*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the telegram account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the telegram account*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } - - /** - * Language - * - * Responce for the command: "/language" - * - * Send the language selection menu - * - * @param context $context Request data from Telegram - * - * @return void - */ - public static function language(context $context): void - { - // Initializing the account - $account = $context->get('account'); - - if ($account instanceof record) { - // Initialized the account - - // Initializing language - $language = $context->get('language'); - - if ($language instanceof language) { - // Initialized language - - // Initializing localization - $localization = $context->get('localization'); - - if ($localization) { - // Initialized localization - - // Sending the language selection - process_language_select::menu( - context: $context, - prefix: 'settings_language_', - title: '🌏 *' . $localization['settings_select_language_title'] . '*', - description: '🌏 *' . $localization['settings_select_language_description'] . '*' - ); - } else { - // Not initialized localization - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize localization*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized language - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize language*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the account*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } - - /** - * Repository - * - * Responce for the command: "/repository" - * - * Sends information about project and menu - * - * @param context $context Request data from Telegram - * - * @return void - */ - public static function repository(context $context): void - { - // Initializing the account - $account = $context->get('account'); - - if ($account instanceof record) { - // Initialized the account - - // Initializing localization - $localization = $context->get('localization'); - - if ($localization) { - // Initialized localization - - // Initializing title of the message - $title = 'πŸ›οΈ ' . $localization['repository_title']; - - // Sending the message - $context->sendMessage($title . "\n\n" . $localization['repository_text'], [ - 'reply_markup' => [ - 'inline_keyboard' => [ - [ - [ - 'text' => 'πŸ›οΈ ' . $localization['repository_button_code'], - 'url' => 'https://git.mirzaev.sexy/mirzaev/deeproots' - ] - ], - [ - [ - 'text' => '⚠️ ' . $localization['repository_button_issues'], - 'url' => 'https://git.mirzaev.sexy/mirzaev/deeproots/issues' - ], - [ - 'text' => '🌱 ' . $localization['repository_button_suggestions'], - 'url' => 'https://git.mirzaev.sexy/mirzaev/deeproots/issues' - ] - ] - ], - 'remove_keyboard' => true, - 'disable_notification' => true - ], - 'link_preview_options' => [ - 'is_disabled' => true - ] - ]); - } else { - // Not initialized localization - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize localization*') - ->then(function (message $message) use ($context) { - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the account*') - ->then(function (message $message) use ($context) { - // Ending the conversation process - $context->endConversation(); - }); - } - } - - /** - * Author - * - * Responce for the command: "/author" - * - * Sends - * - * @param context $context Request data from Telegram - * - * @return void - */ - public static function author(context $context): void - { - // Initializing the account - $account = $context->get('account'); - - if ($account instanceof record) { - // Initialized the account - - // Initializing localization - $localization = $context->get('localization'); - - if ($localization) { - // Initialized localization - - // Initializing title of the message - $title = 'πŸ‘½ ' . $localization['author_title']; - - // Sending the message - $context->sendMessage($title . "\n\n" . $localization['author_text'], [ - 'reply_markup' => [ - 'inline_keyboard' => [ - [ - [ - 'text' => 'πŸ“š ' . $localization['author_button_neurojournal'], - 'url' => 'https://mirzaev.sexy' - ], - [ - 'text' => '🀟 ' . $localization['author_button_projects'], - 'url' => 'https://git.svoboda.works/mirzaev?tab=activity' - ] - ], - [ - [ - 'text' => 'βœ–οΈ ' . $localization['author_button_twitter'], - 'url' => 'https://x.com/mirzaev_sexy' - ], - [ - 'text' => 'πŸ¦‹ ' . $localization['author_button_bluesky'], - 'url' => 'https://bsky.app/profile/mirzaev.bsky.social' - ], - [ - 'text' => '⛓️ ' . $localization['author_button_bastyon'], - 'url' => 'https://bsky.app/profile/mirzaev.bsky.social' - ] - ], - [ - [ - 'text' => 'πŸ‡ΊπŸ‡Έ ' . $localization['author_button_youtube_english'], - 'url' => 'https://www.youtube.com/@MIRZAEV' - ], - [ - 'text' => 'πŸ‡·πŸ‡Ί ' . $localization['author_button_youtube_russian'], - 'url' => 'https://www.youtube.com/@MIRZAEV' - ] - ], - [ - [ - 'text' => 'βœ‰οΈ ' . $localization['author_button_message'], - 'url' => 'https://t.me/mirzaev_sexy' - ] - ] - ], - 'remove_keyboard' => true, - 'disable_notification' => true - ], - 'link_preview_options' => [ - 'is_disabled' => true - ] - ]); - } else { - // Not initialized localization - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize localization*') - ->then(function (message $message) use ($context) { - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the account*') - ->then(function (message $message) use ($context) { - // Ending the conversation process - $context->endConversation(); - }); - } - } - - /** - * Society - * - * Responce for the command: "/society" - * - * Sends the "mushroom" image and the localized text "why so shroomious" - * - * @param context $context Request data from Telegram - * - * @return void - */ - public static function society(context $context): void - { - // Initializing the account - $account = $context->get('account'); - - if ($account instanceof record) { - // Initialized the account - - // Initializing localization - $localization = $context->get('localization'); - - if ($localization) { - // Initialized localization - - // Sending the message - $context->sendPhoto( - new file_input(STORAGE . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'mushroom.jpg'), - [ - 'caption' => $localization['why_so_shroomious'], - 'disable_notification' => true - ] - ); - } else { - // Not initialized localization - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize localization*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the account*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } - - /** - * Questions (system) - * - * Sends questions. answers and localizations management menu - * - * @param context $context Request data from Telegram - * - * @return void - */ - public static function system_questions(context $context): void - { - // Initializing the account - $account = $context->get('account'); - - if ($account instanceof record) { - // Initialized the account - - // Initializing localization - $localization = $context->get('localization'); - - if ($localization) { - // Initialized localization - - // Initializing the question model - $model_question = new question(); - - // Counting questions - $questions = $model_question->database->count(); - - // Initializing the answer model - $model_answer = new answer(); - - // Counting answers - $answers = $model_answer->database->count(); - - // Declaring the localizations amounts buffer - $localizations = []; - - // Declaring the questions list - $list = ''; - - foreach (language::cases() as $case) { - // Iterating over language - - // Initializing the localization model by the language - $model_question_localization = new question_localization(language: $case); - - // Counting localizations for the language - $amount = $model_question_localization->database->count(); - - // Writing into the localizations amounts buffer - $localizations[] = $amount; - - // Writing into the questions list - $list .= PHP_EOL . $case->flag() . ' *' . $case->label(language::{$account->language ?? LANGUAGE_DEFAULT} ?? language::{LANGUAGE_DEFAULT}) . ':* ' . $amount; - } - - // Deinitializing unnecessary variables - unset($case, $model_question, $model_question_localization, $model_answer, $amount); - - // Searching for unique values in uhe buffer of questions localizations amounts - $uniques = array_unique($localizations, SORT_REGULAR); - - // Is questions amounts matches? - $matches = count($uniques) === 1; - - // Sending the message - $context->sendMessage( - sprintf( - << [ - 'inline_keyboard' => [ - [ - [ - 'text' => 'πŸ” ' . $localization['system_questions_button_search'], - 'callback_data' => 'system_questions_search' - ], - [ - 'text' => '✏️ ' . $localization['system_questions_button_create'], - 'callback_data' => 'system_questions_create' - ] - ] - ], - 'remove_keyboard' => true, - 'disable_notification' => true - ], - 'link_preview_options' => [ - 'is_disabled' => true - ] - ] - ); - } else { - // Not initialized localization - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize localization*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } else { - // Not initialized the account - - // Sending the message - $context->sendMessage('⚠️ *Failed to initialize the account*') - ->then(function (message $message) use ($context) { - // Sended the message - - // Ending the conversation process - $context->endConversation(); - }); - } - } -} diff --git a/mirzaev/deeproots/system/views/templater.php b/mirzaev/deeproots/system/views/templater.php deleted file mode 100755 index 1052abe..0000000 --- a/mirzaev/deeproots/system/views/templater.php +++ /dev/null @@ -1,211 +0,0 @@ - - * @author mirzaev - */ -final class templater extends controller implements array_access -{ - /** - * Twig - * - * @var twig $twig Instance of the twig templater - */ - readonly public twig $twig; - - /** - * Variables - * - * @var array $variables Registry of view global variables - */ - public array $variables = []; - - /** - * Constructor of an instance - * - * @return void - */ - public function __construct() - { - // Initializing the Twig instance - $this->twig = new twig(new FilesystemLoader(VIEWS)); - - // Initializing global variables - $this->twig->addGlobal('theme', 'default'); - $this->twig->addGlobal('server', $_SERVER); - $this->twig->addGlobal('cookies', $_COOKIE); - $this->twig->addGlobal('language', $language = $session?->buffer['language'] ?? language::en); - } - - /** - * Render - * - * Render the HTML-document - * - * @param string $file Related path to a HTML-document - * @param array $variables Registry of variables to push into registry of global variables - * - * @return ?string HTML-document - */ - public function render(string $file, array $variables = []): ?string - { - // Generation and exit (success) - return $this->twig->render('themes' . DIRECTORY_SEPARATOR . $this->twig->getGlobals()['theme'] . DIRECTORY_SEPARATOR . $file, $variables + $this->variables); - - } - - /** - * Write - * - * Write the variable into the registry of the view global variables - * - * @param string $name Name of the variable - * @param mixed $value Value of the variable - * - * @return void - */ - public function __set(string $name, mixed $value = null): void - { - // Write the variable and exit (success) - $this->variables[$name] = $value; - } - - /** - * Read - * - * Read the variable from the registry of the view global variables - * - * @param string $name Name of the variable - * - * @return mixed Content of the variable, if they are found - */ - public function __get(string $name): mixed - { - // Read the variable and exit (success) - return $this->variables[$name]; - } - - /** - * Delete - * - * Delete the variable from the registry of the view global variables - * - * @param string $name Name of the variable - * - * @return void - */ - public function __unset(string $name): void - { - // Delete the variable and exit (success) - unset($this->variables[$name]); - } - - /** - * Check of initialization - * - * Check of initialization in the registry of the view global variables - * - * @param string $name Name of the variable - * - * @return bool The variable is initialized? - */ - public function __isset(string $name): bool - { - // Check of initialization of the variable and exit (success) - return isset($this->variables[$name]); - } - - /** - * Write - * - * Write the variable into the registry of the view global variables - * - * @param mixed $name Name of an offset of the variable - * @param mixed $value Value of the variable - * - * @return void - */ - public function offsetSet(mixed $name, mixed $value): void - { - // Write the variable and exit (success) - $this->variables[$name] = $value; - } - - /** - * Read - * - * Read the variable from the registry of the view global variables - * - * @param mixed $name Name of the variable - * - * @return mixed Content of the variable, if they are found - */ - public function offsetGet(mixed $name): mixed - { - // Read the variable and exit (success) - return $this->variables[$name]; - } - - /** - * Delete - * - * Delete the variable from the registry of the view global variables - * - * @param mixed $name Name of the variable - * - * @return void - */ - public function offsetUnset(mixed $name): void - { - // Delete the variable and exit (success) - unset($this->variables[$name]); - } - - /** - * Check of initialization - * - * Check of initialization in the registry of the view global variables - * - * @param mixed $name Name of the variable - * - * @return bool The variable is initialized? - */ - public function offsetExists(mixed $name): bool - { - // Check of initialization of the variable and exit (success) - return isset($this->variables[$name]); - } -} -