|
@@ -1,5 +1,6 @@
|
|
|
<?php
|
|
|
|
|
|
+Lib::loadClass('Theme');
|
|
|
|
|
|
class UI {
|
|
|
|
|
@@ -16,27 +17,6 @@ class UI {
|
|
|
return $title;
|
|
|
}
|
|
|
|
|
|
-public static function topSection() {
|
|
|
- Lib::loadClass('S'); // todo: co to jest za klasa i czy jest wymagane dodanie klasy "S"
|
|
|
- UI::loadTemplate('_layout_top_section');
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-public static function footerSection() {
|
|
|
-
|
|
|
-//todo: jeśli chciałbym przekazać parametr do widoku to musze go jakoś przekazać w klasie UI? Np. chciałbym przekazać wersje systemu
|
|
|
-/* $version = (file_exists(APP_PATH_ROOT . '/VERSION'))? file_get_contents(APP_PATH_ROOT . '/VERSION') : null;
|
|
|
- if ($version) {
|
|
|
- echo '<div style="' . UI::fixFooterPosition('footer_style') . 'border-top:1px solid #ddd; margin-top:10px; padding:0 30px; font-size:xx-small; color:#888">version: '.$version.'</div>';
|
|
|
- }
|
|
|
-*/
|
|
|
-
|
|
|
-UI::loadTemplate('_layout_footer_section');
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public static function gora() {
|
|
|
UI::startHtml();
|
|
|
}
|
|
@@ -61,11 +41,9 @@ UI::loadTemplate('_layout_footer_section');
|
|
|
}
|
|
|
|
|
|
public static function endHtml() {
|
|
|
- $version = (file_exists(APP_PATH_ROOT . '/VERSION'))? file_get_contents(APP_PATH_ROOT . '/VERSION') : null;
|
|
|
- if ($version) {
|
|
|
- echo '<div style="' . UI::fixFooterPosition('footer_style') . 'border-top:1px solid #ddd; margin-top:10px; padding:0 30px; font-size:xx-small; color:#888">version: '.$version.'</div>';
|
|
|
- }
|
|
|
- echo UI::fixFooterPosition('footer_js_tag');
|
|
|
+ DBG::log('UI::dol...');
|
|
|
+ Theme::footer();
|
|
|
+ DBG::log('UI::dol .');
|
|
|
echo "\n</body></html>";
|
|
|
}
|
|
|
|
|
@@ -73,14 +51,7 @@ UI::loadTemplate('_layout_footer_section');
|
|
|
if (!User::logged()) return;
|
|
|
|
|
|
if (User::hasAccess('menu')) {
|
|
|
- Lib::loadClass('ProcesMenu');
|
|
|
- $procesMenu = ProcesMenu::getInstance();
|
|
|
- $procesMenu->show();
|
|
|
-
|
|
|
- // if (!V::get('MENU_INIT', '', $_GET)) {
|
|
|
- // Lib::loadClass('UserActivity');
|
|
|
- // //echo UserActivity::showListInContainer();
|
|
|
- // }
|
|
|
+ Theme::top();
|
|
|
}
|
|
|
else {
|
|
|
UI::loadTemplate('menuLevel6');
|
|
@@ -88,6 +59,10 @@ UI::loadTemplate('_layout_footer_section');
|
|
|
}
|
|
|
|
|
|
public static function loadTemplate($tmplName, $data = array()) {
|
|
|
+ if ('defaultPage' === $tmplName) { // TODO: replace UI::loadTemplate('defaultPage') => Theme::home($data)
|
|
|
+ Theme::home($data);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (is_array($data) && !empty($data)) {
|
|
|
extract($data);
|
|
|
}
|
|
@@ -790,8 +765,8 @@ UI::loadTemplate('_layout_footer_section');
|
|
|
$params['showMenu'] = V::get('showMenu', true, $params, 'bool');
|
|
|
$params['showContainer'] = V::get('showContainer', true, $params, 'bool');
|
|
|
$params['containerClass'] = V::get('containerClass', '', $params);
|
|
|
- UI::gora();
|
|
|
- if ($params['showMenu']) UI::menu();
|
|
|
+ UI::gora(); // Theme::head();
|
|
|
+ if ($params['showMenu']) UI::menu(); // TODO: Theme::top()
|
|
|
if ($params['showContainer']) UI::startContainer( $params['containerClass'] ? [ 'class' => $params['containerClass'] ] : [] );
|
|
|
try {
|
|
|
call_user_func($callback);
|
|
@@ -800,7 +775,7 @@ UI::loadTemplate('_layout_footer_section');
|
|
|
UI::alert('danger', $e->getMessage());
|
|
|
}
|
|
|
if ($params['showContainer']) UI::endContainer();
|
|
|
- UI::dol();
|
|
|
+ UI::dol(); // UI::dol must include Theme::footer();
|
|
|
}
|
|
|
|
|
|
}
|