-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInternal.class.php
More file actions
91 lines (66 loc) · 3.06 KB
/
Internal.class.php
File metadata and controls
91 lines (66 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* Клас 'page_Internal' - Шаблон за страница на приложението, видима за вътрешни потребители
*
* Файлът може да се подмени с друг
*
*
* @category ef
* @package page
* @author Milen Georgiev <milen@download.bg>
* @copyright 2006 - 2012 Experta OOD
* @license GPL 3
* @since v 0.1
* @link
*/
class page_Internal extends page_Html {
/**
* Конструктор за страницата по подразбиране
* Тази страница използва internal layout, header и footer за да
* покаже една обща обвивка за съдържанието за вътрешни потребители
*/
function page_Internal()
{
$conf = core_Packs::getConfig('core');
$this->page_Html();
$this->replace("UTF-8", 'ENCODING');
$this->push(array(Mode::is('screenMode', 'narrow') ? "css/narrowCommon.css" : 'css/wideCommon.css',
Mode::is('screenMode', 'narrow') ? "css/narrowApplication.css" : 'css/wideApplication.css'), 'CSS');
$this->push('js/efCommon.js', 'JS');
$this->appendOnce("\n<link rel=\"shortcut icon\" href=" . sbf("img/favicon.ico") . " type=\"image/x-icon\">", "HEAD");
$this->appendOnce("\n<link rel=\"icon\" href=" . sbf("img/favicon.ico") . " type=\"image/x-icon\">", "HEAD");
$this->prepend($conf->EF_APP_TITLE, 'PAGE_TITLE');
$this->replace(cls::get('page_InternalLayout'), 'PAGE_CONTENT');
$navBar = cls::get('page_Navbar');
$navBar = $navBar->getContent();
if(!empty($navBar)) {
$this->replace($navBar, 'NAV_BAR');
}
// Вкарваме хедър-а и футъра
$this->replace(cls::get('page_InternalHeader'), 'PAGE_HEADER');
$this->replace(cls::get('page_InternalFooter'), 'PAGE_FOOTER');
}
/**
* Прихваща изпращането към изхода, за да постави нотификации, ако има
*/
static function on_Output(&$invoker)
{
if (!Mode::get('lastNotificationTime')) {
Mode::setPermanent('lastNotificationTime', time());
}
$invoker->append(core_Statuses::show(), 'STATUSES');
$Nid = Request::get('Nid', 'int');
if($Nid && $msg = Mode::get('Notification_' . $Nid)) {
$msgType = Mode::get('NotificationType_' . $Nid);
if($msgType) {
$invoker->append("<div class='notification-{$msgType}'>", 'NOTIFICATION');
}
$invoker->append($msg, 'NOTIFICATION');
if($msgType) {
$invoker->append("</div>", 'NOTIFICATION');
}
Mode::setPermanent('Notification_' . $Nid, NULL);
Mode::setPermanent('NotificationType_' . $Nid, NULL);
}
}
}