forked from ostapetc/Yii-CMS-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
executable file
·122 lines (100 loc) · 4.01 KB
/
main.php
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><? echo $this->meta_title ?></title>
<meta name="description" content="<? echo $this->meta_description ?>">
<meta name="keywords" content="<? echo $this->meta_keywords ?>">
<meta name="author" content="">
<link rel="shortcut icon" href="/favicon.ico">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?
$params = Yii::app()->params;
$base = Yii::app()->baseUrl;
$cs = Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('jquery.ui');
//NodeJS only for loginned users
if (!Yii::app()->user->isGuest)
{
/*
$cs->registerScriptFile(
'http://' . $params['nodejs']['host'] . ':' . $params['nodejs']['port'] . '/socket.io/socket.io.js'
);
$cs->registerScriptFile(
Yii::app()->assetManager->publish(APP_PATH . 'components' . DS . 'nodejs' . DS . 'NodeJSClient.js')
);
$cs->registerScript('some_id',
"$('body').coreNodeJSClient(".CJSON::encode($params['nodejs']).")"
);
*/
}
Yii::app()->bootstrap->registerScripts();
$cs->registerScriptFile('/js/coreFunctions.js');
$cs->registerCssFile($base . '/css/icons.css');
$cs->registerCssFile($base . '/css/site/form.css');
$cs->registerCssFile($base . '/css/site/style.css');
$cs->registerCssFile($base . '/css/site/menu.css');
$cs->registerCssFile($base . '/css/site/page.css');
$cs->registerCssFile($base . '/css/site/comments.css');
$cs->registerCssFile($base . '/css/site/favorites.css');
$cs->registerCssFile($base . '/css/site/rating.css');
$cs->registerCssFile($base . '/css/site/user.css');
$cs->registerCssFile($base . '/css/site/fighters.css');
$cs->registerCssFile($base . '/css/site/tags.css');
$cs->registerScriptFile($base . '/js/site/modal-windows.js');
#toasmessage plugin, message notifier
$cs->registerScriptFile('/js/plugins/toastmessage/javascript/jquery.toastmessage.js');
$cs->registerCssFile('/js/plugins/toastmessage/resources/css/jquery.toastmessage.css');
$cs->registerScriptFile('/js/plugins/ajaxSetup.js');
$cs->registerScriptFile('/js/plugins/jquery.checkRights.js');
#social
$cs->registerScriptFile('/js/social/favorites.js');
$cs->registerScriptFile('/js/social/rating.js');
#comments
$cs->registerScriptFile('/js/comments/commentsPortlet.js');
$cs->registerScriptFile('/js/site/ready.js');
?>
</head>
<body>
<?
//user id
if (!Yii::app()->user->isGuest)
{
echo CHtml::hiddenField('app_user_id', Yii::app()->user->id);
}
?>
<div id='main-wrapper'>
<? $this->widget('main.portlets.MainMenu'); ?>
<? $this->widget('main.portlets.SubMenu'); ?>
<div class="container-fluid">
<div class="row-fluid">
<?
$sidebars = $this->widget('main.portlets.SidebarManager', array(), true);
$class = $sidebars ? 'span8' : 'span12';
?>
<div class="<?= $class ?> well">
<? if ($this->page_title): ?>
<h1><?= $this->page_title ?></h1>
<? endif ?>
<? foreach (Yii::app()->user->getFlashes() as $type => $msg): ?>
<div class="alert alert-<?= $type ?>"><?= $msg ?></div>
<? endforeach ?>
<?= $content ?>
</div>
<? if ($sidebars): ?>
<div class="span4 sidebar-manager">
<?= $sidebars ?>
</div>
<? endif ?>
</div>
<hr>
<footer>
<p>© Company 2012</p>
</footer>
</div>
</div>
</body>
</html>