-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHtml.class.php
More file actions
80 lines (66 loc) · 3.28 KB
/
Html.class.php
File metadata and controls
80 lines (66 loc) · 3.28 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
<?php
/**
* Клас 'page_Html' - Общ шаблон за всички HTML страници
*
*
* @category ef
* @package page
* @author Milen Georgiev <milen@download.bg>
* @copyright 2006 - 2012 Experta OOD
* @license GPL 3
* @since v 0.1
*/
class page_Html extends core_ET {
/**
* Конструктор, който генерира лейаута на шаблона
*/
function page_Html() {
$this->core_ET(
//"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n \"http://www.w3.org/TR/html4/loose.dtd\">" .
(Mode::is('screenMode', 'narrow') ?
"<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">" .
"\n<html xmlns=\"http://www.w3.org/1999/xhtml\">" :
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n \"http://www.w3.org/TR/html4/strict.dtd\">" .
"\n<html>") .
"\n<head>" .
"\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=[#ENCODING#]\">" .
"<!--ET_BEGIN META_DESCRIPTION-->\n<meta name=\"description\" content=\"[#META_DESCRIPTION#]\"><!--ET_END META_DESCRIPTION-->" .
"<!--ET_BEGIN META_KEYWORDS-->\n<meta name=\"keywords\" content=\"[#META_KEYWORDS#]\"><!--ET_END META_KEYWORDS-->" .
"<!--ET_BEGIN PAGE_TITLE-->\n<title>[#NOT_CNT#][#PAGE_TITLE#]</title><!--ET_END PAGE_TITLE-->" .
"<!--ET_BEGIN STYLE_IMPORT-->\n<style type=\"text/css\">[#STYLE_IMPORT#]\n</style><!--ET_END STYLE_IMPORT-->" .
"<!--ET_BEGIN STYLES-->\n<style type=\"text/css\">[#STYLES#]\n</style><!--ET_END STYLES-->" .
"<!--ET_BEGIN HEAD-->[#HEAD#]<!--ET_END HEAD-->" .
"<!--ET_BEGIN SCRIPTS-->\n<script type=\"text/javascript\">[#SCRIPTS#]\n</script><!--ET_END SCRIPTS-->" .
"\n</head>" .
"\n<body<!--ET_BEGIN ON_LOAD--> onload=\"[#ON_LOAD#]\"<!--ET_END ON_LOAD-->" .
(Mode::is('screenMode', 'narrow') ? " class=\"narrow\"" : "") . ">" .
"<!--ET_BEGIN PAGE_CONTENT-->[#PAGE_CONTENT#]<!--ET_END PAGE_CONTENT-->" .
"<!--ET_BEGIN JQRUN-->\n<script type=\"text/javascript\">[#JQRUN#]\n</script><!--ET_END JQRUN-->" .
"\n</body>" .
"\n</html>");
}
/**
* Прихваща събитието 'output' на ЕТ, за да добави стиловете и javascripts
*/
static function on_Output(&$invoker)
{
$css = $invoker->getArray('CSS');
if(count($css)) {
foreach($css as $file) {
if(!preg_match('#^[^/]*//#', $file)) {
$file = sbf($file, '');
}
$invoker->appendOnce("\n@import url(\"{$file}\");", "STYLE_IMPORT", TRUE);
}
}
$js = $invoker->getArray('JS');
if(count($js)) {
foreach($js as $file) {
if(!preg_match('#^[^/]*//#', $file)) {
$file = sbf($file, '');
}
$invoker->appendOnce("\n<script type=\"text/javascript\" src=\"{$file}\"></script>", "HEAD", TRUE);
}
}
}
}