public static function generate(array $params) { $action = is_array($params) ? array_shift($params) : null; Lib\Display::setLayout('admin'); $user = self::_checkLogin(); if ($user) { self::$_user = $user; Lib\Display::addKey('user', $user); $message = null; $force = false; if (Lib\Url::GetBool('created')) { $message = ['message' => 'Bracket was created successfully!', 'type' => 'success']; $force = true; } if (Lib\Url::GetBool('edited')) { $message = ['message' => 'Bracket was updated successfully!', 'type' => 'success']; $force = true; } // If there's an action, check for that page controller and use it if ($action && class_exists('Controller\\Admin\\' . $action, true)) { call_user_func(['Controller\\Admin\\' . $action, 'generate'], $params); } else { // Show the rollup page self::_main($message, $force); } } }
static function getInstanceMe() { if (self::$controllerme == null) { self::$controllerme = 1; return new static(); //self::$controllerme = new static; //return self::$controllerme; } else { //return self::$controllerme; return null; } }
<?php require_once "ControllerMe.php"; $kontrol = ControllerMe::getInstanceMe(); if ($kontrol == null) { die("<h4 style=color:#fff;>Sorry.. Access denied</h4><hr style=color:#f00;/>"); } else { if (!$kontrol->initDBInstanceController()) { die("<hr/><h5>Sorry.. Server Disconnected...</h5><hr/>"); } }