Theme.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. Lib::loadClass('ThemeDefault');
  3. class Theme {
  4. public static function getInstance() {
  5. static $_theme = null;
  6. DBG::log($_theme, 'array', "Theme::getInstance()...");
  7. if (null !== $_theme) return $_theme;
  8. try {
  9. $themeName = ''; // TODO: read from config - theme
  10. // $themeName = 'Bocian'; // TODO: DBG
  11. DBG::log("Theme::getInstance({$themeName})");
  12. $clsName = ($themeName) ? "Theme_{$themeName}" : "ThemeDefault";
  13. Lib::loadClass($clsName);
  14. $_theme = new $clsName();
  15. } catch (Exception $e) {
  16. DBG::log($e);
  17. $_theme = new ThemeDefault();
  18. }
  19. return $_theme;
  20. }
  21. public static function head() {
  22. return self::getInstance()->head(); // <link rel="stylesheet" href="stuff/bootstrap/css/bootstrap-theme.min.css" type="text/css" />';
  23. }
  24. public static function top() { // old menu
  25. return self::getInstance()->top();
  26. }
  27. public static function footer() {
  28. return self::getInstance()->footer();
  29. }
  30. public static function login($data) {
  31. return self::getInstance()->login($data);
  32. }
  33. public static function logout($data) {
  34. return self::getInstance()->logout($data);
  35. }
  36. public static function home($data) {
  37. return self::getInstance()->home($data);
  38. }
  39. }