blob: 05c8ec8e0a9ab759e7e38a6fb5c82cd35a9ce460 (
plain)
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
|
<?php
class FreshRSS extends Minz_FrontController {
public function init () {
Minz_Session::init ('FreshRSS');
$this->loadParamsView ();
$this->loadStylesAndScripts ();
$this->loadNotifications ();
}
private function loadParamsView () {
try {
$this->conf = new FreshRSS_Configuration();
} catch (Minz_Exception $e) {
// Permission denied or conf file does not exist
// it's critical!
die($e->getMessage());
}
Minz_View::_param ('conf', $this->conf);
Minz_Session::_param ('language', $this->conf->language);
Minz_Translate::init();
$output = Minz_Request::param ('output');
if (!$output) {
$output = $this->conf->view_mode;
Minz_Request::_param ('output', $output);
}
}
private function loadStylesAndScripts () {
$theme = FreshRSS_Themes::get_infos($this->conf->theme);
if ($theme) {
foreach($theme["files"] as $file) {
Minz_View::appendStyle (Minz_Url::display ('/themes/' . $theme['path'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['path'] . '/' . $file)));
}
}
if (login_is_conf ($this->conf)) {
Minz_View::appendScript ('https://login.persona.org/include.js');
}
$includeLazyLoad = $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param ('output') === 'reader');
Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js')), false, !$includeLazyLoad, !$includeLazyLoad);
if ($includeLazyLoad) {
Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.lazyload.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js')));
}
Minz_View::appendScript (Minz_Url::display ('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js')));
}
private function loadNotifications () {
$notif = Minz_Session::param ('notification');
if ($notif) {
Minz_View::_param ('notification', $notif);
Minz_Session::_param ('notification');
}
}
}
|