diff options
| author | 2013-04-17 19:45:16 +0200 | |
|---|---|---|
| committer | 2013-04-17 19:45:16 +0200 | |
| commit | ae7c9787cd8afd4313d356c6525e40d4ce79f99b (patch) | |
| tree | dbac8b756486c5266e914026ef5a679002d0eb85 /app/App_FrontController.php | |
| parent | 044908439bdd7280f7539e12441d7dfa6c4d4c63 (diff) | |
| parent | 23dd73ddeec2473c3e8a3c517317e074ac53a1d8 (diff) | |
Merge branch 'releases'0.2.0
Diffstat (limited to 'app/App_FrontController.php')
| -rw-r--r-- | app/App_FrontController.php | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/app/App_FrontController.php b/app/App_FrontController.php index 0ff7bf182..5a66ae1dd 100644 --- a/app/App_FrontController.php +++ b/app/App_FrontController.php @@ -9,42 +9,47 @@ class App_FrontController extends FrontController { public function init () { $this->loadLibs (); $this->loadModels (); - + Session::init (); // lancement de la session doit se faire après chargement des modèles sinon bug (pourquoi ?) $this->loadParamsView (); $this->loadStylesAndScripts (); $this->loadNotifications (); } - + private function loadLibs () { require (LIB_PATH . '/lib_phpQuery.php'); require (LIB_PATH . '/lib_rss.php'); - require (LIB_PATH . '/lib_simplepie.php'); + require (LIB_PATH . '/SimplePie_autoloader.php'); require (LIB_PATH . '/lib_text.php'); } - + private function loadModels () { + include (APP_PATH . '/models/Exception/FeedException.php'); include (APP_PATH . '/models/RSSConfiguration.php'); include (APP_PATH . '/models/Days.php'); include (APP_PATH . '/models/Category.php'); include (APP_PATH . '/models/Feed.php'); include (APP_PATH . '/models/Entry.php'); } - - private function loadStylesAndScripts () { - View::prependStyle (Url::display ('/theme/base.css')); - View::appendScript ('https://login.persona.org/include.js'); - View::appendScript (Url::display ('/scripts/jquery.js')); - View::appendScript (Url::display ('/scripts/notification.js')); - } - + private function loadParamsView () { - View::_param ('conf', Session::param ('conf', new RSSConfiguration ())); - + $this->conf = Session::param ('conf', new RSSConfiguration ()); + View::_param ('conf', $this->conf); + $entryDAO = new EntryDAO (); View::_param ('nb_not_read', $entryDAO->countNotRead ()); } - + + private function loadStylesAndScripts () { + View::appendStyle (Url::display ('/theme/global.css')); + View::appendStyle (Url::display ('/theme/freshrss.css')); + if (login_is_conf ($this->conf)) { + View::appendScript ('https://login.persona.org/include.js'); + } + View::appendScript (Url::display ('/scripts/jquery.js')); + View::appendScript (Url::display ('/scripts/notification.js')); + } + private function loadNotifications () { $notif = Session::param ('notification'); if ($notif) { |
