|
|
@@ -1,83 +1,16 @@
|
|
|
<?php
|
|
|
|
|
|
+Lib::loadClass('UI');
|
|
|
|
|
|
class SE_Layout {
|
|
|
|
|
|
- public static function getTitle() {
|
|
|
- $title = 'SE';
|
|
|
-
|
|
|
- $host = $_SERVER['SERVER_NAME'];
|
|
|
- if (substr($host, 0, 5) == 'biuro') {
|
|
|
- $host = substr($host, 6);
|
|
|
- }
|
|
|
-
|
|
|
- $title = "{$host}-SE";
|
|
|
-
|
|
|
- return $title;
|
|
|
- }
|
|
|
-
|
|
|
- public static function gora() {
|
|
|
- Lib::loadClass('S');
|
|
|
- SE_Layout::loadTemplate('_layout_gora');
|
|
|
- }
|
|
|
-
|
|
|
- public static function dol() {
|
|
|
- $version = (file_exists(APP_PATH_ROOT . '/VERSION'))? file_get_contents(APP_PATH_ROOT . '/VERSION') : null;
|
|
|
- if ($version) {
|
|
|
- echo '<div style="border-top:1px solid #ddd;margin-top:10px;padding:0 30px;font-size:xx-small;color:#888;">version: '.$version.'</div>';
|
|
|
- }
|
|
|
- echo "\n</body></html>";
|
|
|
- }
|
|
|
-
|
|
|
- public static function menu() {
|
|
|
- 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();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else {
|
|
|
- SE_Layout::loadTemplate('menuLevel6');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static function loadTemplate($tmplName, $data = array()) {
|
|
|
- if (is_array($data) && !empty($data)) {
|
|
|
- extract($data);
|
|
|
- }
|
|
|
- include APP_PATH_LIB . "/tmpl/{$tmplName}.php";
|
|
|
- }
|
|
|
-
|
|
|
- public static function hotKeyDBG($str) {
|
|
|
- if (User::hasAccess('dbg')) {
|
|
|
- echo '<span class="hidden-dbg">' . htmlspecialchars($str) . '</span>';
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static function showMessagesForTable($tblName) {
|
|
|
- if (empty($tblName)) return;
|
|
|
-
|
|
|
- $msgsRoute = Router::getRoute('Msgs');
|
|
|
- $msgs = $msgsRoute->getActiveMessagesForTable($tblName);
|
|
|
- if (!empty($msgs)) {
|
|
|
- self::loadTemplate('msgsForTable', array('msgs' => $msgs));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static function alert($alertType, $msg) {
|
|
|
- ?>
|
|
|
-<div class="alert alert-<?php echo $alertType; ?>">
|
|
|
- <?php echo $msg; ?>
|
|
|
-</div>
|
|
|
- <?php
|
|
|
- }
|
|
|
+ public static function getTitle() { return UI::getTitle(); }
|
|
|
+ public static function gora() { UI::startHtml(); }
|
|
|
+ public static function dol() { UI::endHtml(); }
|
|
|
+ public static function menu() { UI::menu(); }
|
|
|
+ public static function loadTemplate($tmplName, $data = array()) { UI::loadTemplate($tmplName, $data); }
|
|
|
+ public static function hotKeyDBG($str) { UI::hotKeyDBG($str); }
|
|
|
+ public static function showMessagesForTable($tblName) { UI::showMessagesForTable($tblName); }
|
|
|
+ public static function alert($alertType, $msg) { UI::alert($alertType, $msg); }
|
|
|
|
|
|
}
|