| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- Lib::loadClass('ThemeDefault');
- class Theme {
- public static function getInstance() {
- static $_theme = null;
- DBG::log($_theme, 'array', "Theme::getInstance()...");
- if (null !== $_theme) return $_theme;
- try {
- $clsName = "ThemeDefault";
- if ($activeProjectName = Config::getProjectName()) {
- $activeProjectPath = Config::getProjectPath();
- $clsName = "Theme_{$activeProjectName}";
- require_once "{$activeProjectPath}/theme/{$activeProjectName}.php";
- }
- DBG::log("Theme::getInstance() '{$clsName}'");
- $_theme = new $clsName();
- } catch (Exception $e) {
- DBG::log($e);
- $_theme = new ThemeDefault();
- }
- return $_theme;
- }
- public static function head() {
- return self::getInstance()->head(); // <link rel="stylesheet" href="stuff/bootstrap/css/bootstrap-theme.min.css" type="text/css" />';
- }
- public static function top() { // old menu
- return self::getInstance()->top();
- }
- public static function footer() {
- return self::getInstance()->footer();
- }
- public static function login($data) {
- return self::getInstance()->login($data);
- }
- public static function logout($data) {
- return self::getInstance()->logout($data);
- }
- public static function home($data) {
- return self::getInstance()->home($data);
- }
- }
|