mirror of
https://github.com/claradex/nativegallery.git
synced 2025-06-03 13:03:54 +03:00
update controllers
This commit is contained in:
parent
c2f82dd7d0
commit
ed19b5dd7a
2 changed files with 40 additions and 0 deletions
|
@ -26,6 +26,11 @@ class MainController
|
|||
{
|
||||
Page::set('About');
|
||||
|
||||
}
|
||||
public static function mapmedia()
|
||||
{
|
||||
Page::set('MapMedia');
|
||||
|
||||
}
|
||||
public static function rules()
|
||||
{
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue