ThemeDefault.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. class ThemeDefault {
  3. function __construct() {
  4. DBG::log("ThemeDefault()...");
  5. }
  6. function head() { // inside UI::gora()
  7. // echo '<link rel="stylesheet" href="stuff/bootstrap/css/bootstrap-theme.min.css" type="text/css" />'; // TODO: dodać bootsrap-theme?
  8. }
  9. function top() {
  10. // echo ''; // TODO: UI::menu + breacrumbs
  11. Lib::loadClass('ProcesMenu');
  12. $procesMenu = ProcesMenu::getInstance();
  13. $procesMenu->show();
  14. // if (!V::get('MENU_INIT', '', $_GET)) {
  15. // Lib::loadClass('UserActivity');
  16. // //echo UserActivity::showListInContainer();
  17. // }
  18. }
  19. function footer() { // inside UI::dol()
  20. $version = (file_exists(APP_PATH_ROOT . '/VERSION'))? file_get_contents(APP_PATH_ROOT . '/VERSION') : null;
  21. $footerHtml = (file_exists(APP_PATH_ROOT . '/config/.footer.html'))? file_get_contents(APP_PATH_ROOT . '/config/.footer.html') : null;
  22. if ($version || $footerHtml) {
  23. echo '<div style="' . UI::fixFooterPosition('footer_style') . 'border-top:1px solid #ddd; margin-top:10px; padding:0 30px; font-size:xx-small; color:#888">';
  24. if ($version) echo 'version: '.$version . ' ';
  25. if ($footerHtml) echo $footerHtml;
  26. echo '</div>';
  27. }
  28. if (User::logged() && '1' === V::get('TEST_FEEDBACK', '', $_GET)) {
  29. echo UI::h('script', [ 'type' => "text/javascript", 'src' => "https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js" ]);
  30. UI::inlineJS(APP_PATH_ROOT . '/static/p5UI/feedback.js');
  31. }
  32. echo UI::fixFooterPosition('footer_js_tag');
  33. }
  34. function login($data) {
  35. if (is_array($data) && !empty($data)) {
  36. extract($data);
  37. }
  38. include APP_PATH_WWW . '/se-lib/tmpl/login.php';
  39. }
  40. function logout($data) {
  41. if (is_array($data) && !empty($data)) {
  42. extract($data);
  43. }
  44. include APP_PATH_WWW . '/se-lib/tmpl/logout.php';
  45. }
  46. function home($data) {
  47. if (is_array($data) && !empty($data)) {
  48. extract($data);
  49. }
  50. include APP_PATH_WWW . '/se-lib/tmpl/defaultPage.php';
  51. }
  52. function asset($relativeUrl) {
  53. if ('ThemeDefault' === get_class($this)) return $relativeUrl;
  54. $projName = substr(get_class($this), strlen('Theme_'));
  55. return "projects/{$projName}/theme/{$relativeUrl}";
  56. }
  57. }