ThemeDefault.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. Lib::loadClass('Request');
  3. class ThemeDefault {
  4. function __construct() {
  5. DBG::log("ThemeDefault()...");
  6. }
  7. function head() { // inside UI::gora()
  8. // echo '<link rel="stylesheet" href="stuff/bootstrap/css/bootstrap-theme.min.css" type="text/css" />'; // TODO: dodać bootsrap-theme?
  9. }
  10. function top() {
  11. // echo ''; // TODO: UI::menu + breacrumbs
  12. Lib::loadClass('ProcesMenu');
  13. $procesMenu = ProcesMenu::getInstance();
  14. $procesMenu->show();
  15. // if (!V::get('MENU_INIT', '', $_GET)) {
  16. // Lib::loadClass('UserActivity');
  17. // //echo UserActivity::showListInContainer();
  18. // }
  19. }
  20. function footer() { // inside UI::dol()
  21. $version = (file_exists(APP_PATH_ROOT . '/VERSION'))? file_get_contents(APP_PATH_ROOT . '/VERSION') : null;
  22. $footerHtml = (file_exists(APP_PATH_ROOT . '/config/.footer.html'))? file_get_contents(APP_PATH_ROOT . '/config/.footer.html') : null;
  23. if ($version || $footerHtml) {
  24. echo '<div style="' . UI::fixFooterPosition('footer_style') . 'border-top:1px solid #ddd; margin-top:10px; padding:0 30px; font-size:xx-small; color:#888">';
  25. if ($version) echo 'version: '.$version . ' ';
  26. if ($footerHtml) echo $footerHtml;
  27. echo '</div>';
  28. }
  29. if (User::logged() && '1' === V::get('TEST_FEEDBACK', '', $_GET)) {
  30. // 1. lib: html2canvas - not everything supported
  31. echo UI::h('script', [ 'type' => "text/javascript", 'src' => "https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js" ]);
  32. // 2. lib: html-screen-capture (MIT)
  33. UI::inlineJS(APP_PATH_ROOT . '/static/html-screen-capture.js');
  34. UI::inlineJS(APP_PATH_ROOT . '/static/p5UI/feedback.js', [
  35. 'URL_BASE_PATH' => Request::getPathUri(),
  36. ]);
  37. }
  38. echo UI::fixFooterPosition('footer_js_tag');
  39. }
  40. function login($data) {
  41. if (is_array($data) && !empty($data)) {
  42. extract($data);
  43. }
  44. include APP_PATH_WWW . '/se-lib/tmpl/login.php';
  45. }
  46. function remind($data) {
  47. if (is_array($data) && !empty($data)) {
  48. extract($data);
  49. }
  50. $loginLink = Request::getPathUri();
  51. die('TODO: remind password');
  52. // include APP_PATH_WWW . '/se-lib/tmpl/remind.php';
  53. }
  54. function remindSent($data) {
  55. if (is_array($data) && !empty($data)) {
  56. extract($data);
  57. }
  58. $loginLink = Request::getPathUri();
  59. die('TODO: remind password sent info');
  60. // include APP_PATH_WWW . '/se-lib/tmpl/remindSent.php';
  61. }
  62. function remindSetNewPassword($data) {
  63. if (is_array($data) && !empty($data)) {
  64. extract($data);
  65. }
  66. $loginLink = Request::getPathUri();
  67. die('TODO: remind set new password');
  68. // include APP_PATH_WWW . '/se-lib/tmpl/remindSetNewPass.php';
  69. }
  70. function remindNewPasswordSet($data) {
  71. if (is_array($data) && !empty($data)) {
  72. extract($data);
  73. }
  74. $loginLink = Request::getPathUri();
  75. die('TODO: remind new password set');
  76. // include APP_PATH_WWW . '/se-lib/tmpl/remindNewPassSetConfirm.php';
  77. }
  78. function logout($data) {
  79. if (is_array($data) && !empty($data)) {
  80. extract($data);
  81. }
  82. include APP_PATH_WWW . '/se-lib/tmpl/logout.php';
  83. }
  84. function home($data) {
  85. if (is_array($data) && !empty($data)) {
  86. extract($data);
  87. }
  88. include APP_PATH_WWW . '/se-lib/tmpl/defaultPage.php';
  89. }
  90. function asset($relativeUrl) {
  91. if ('ThemeDefault' === get_class($this)) return $relativeUrl;
  92. $projName = substr(get_class($this), strlen('Theme_'));
  93. return "projects/{$projName}/theme/{$relativeUrl}";
  94. }
  95. }