From ed19b5dd7a4b4ba6191bd094f5fb7bcac14d0f89 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 25 May 2025 15:05:25 +0300 Subject: [PATCH] update controllers --- app/Controllers/MainController.php | 5 ++++ app/Controllers/ProfileController.php | 35 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/app/Controllers/MainController.php b/app/Controllers/MainController.php index 2fb8899..20cce68 100644 --- a/app/Controllers/MainController.php +++ b/app/Controllers/MainController.php @@ -26,6 +26,11 @@ class MainController { Page::set('About'); + } + public static function mapmedia() + { + Page::set('MapMedia'); + } public static function rules() { diff --git a/app/Controllers/ProfileController.php b/app/Controllers/ProfileController.php index cc5183e..73af4e3 100644 --- a/app/Controllers/ProfileController.php +++ b/app/Controllers/ProfileController.php @@ -8,6 +8,37 @@ use \App\Core\Page; class ProfileController { + static $file = 'Index'; + + public function __construct() + { + if (isset($_GET['type'])) { + switch (Page::exists('Profile/LK/Profile/' . $_GET['type'])) { + case true: + self::$file = $_GET['type']; + break; + case false: + self::$file = 'Index'; + break; + } + } else { + self::$file = 'Index'; + } + } + + public static function loadContent() + { + $fileName = $_GET['type']; + + + $filePath = $_SERVER['DOCUMENT_ROOT'] . '/views/pages/Profile/LK/Profile/' . $fileName . '.php'; + + if (file_exists($filePath)) { + Page::set('Profile/LK/Profile/' . self::$file); + } else { + Page::set('Profile/LK/Profile/Index'); + } + } public static function lk() { @@ -34,6 +65,10 @@ class ProfileController { Page::set('Profile/LK/Profile'); } + public static function editphoto() + { + Page::set('Profile/LK/EditImage'); + } } \ No newline at end of file