Theme.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. $clsName = "ThemeDefault";
  10. if ($activeProjectName = Config::getProjectName()) {
  11. $activeProjectPath = Config::getProjectPath();
  12. $clsName = "Theme_{$activeProjectName}";
  13. require_once "{$activeProjectPath}/theme/{$activeProjectName}.php";
  14. }
  15. DBG::log("Theme::getInstance() '{$clsName}'");
  16. $_theme = new $clsName();
  17. } catch (Exception $e) {
  18. DBG::log($e);
  19. $_theme = new ThemeDefault();
  20. }
  21. return $_theme;
  22. }
  23. public static function head() {
  24. return self::getInstance()->head(); // <link rel="stylesheet" href="stuff/bootstrap/css/bootstrap-theme.min.css" type="text/css" />';
  25. }
  26. public static function top() { // old menu
  27. return self::getInstance()->top();
  28. }
  29. public static function footer() {
  30. return self::getInstance()->footer();
  31. }
  32. public static function login($data) {
  33. return self::getInstance()->login($data);
  34. }
  35. public static function remind($data) {
  36. return self::getInstance()->remind($data);
  37. }
  38. public static function remindSent($data) {
  39. return self::getInstance()->remindSent($data);
  40. }
  41. public static function remindSetNewPassword($data) {
  42. return self::getInstance()->remindSetNewPassword($data);
  43. }
  44. public static function remindNewPasswordSet($data) {
  45. return self::getInstance()->remindNewPasswordSet($data);
  46. }
  47. public static function logout($data) {
  48. return self::getInstance()->logout($data);
  49. }
  50. public static function home($data) {
  51. return self::getInstance()->home($data);
  52. }
  53. }