+
+ private function init()
+ {
+ Tools::initPhp();
+ Session::$sessionName = 'poche';
+ Session::init();
+
+ if (isset($_SESSION['poche_user']) && $_SESSION['poche_user'] != array()) {
+ $this->user = $_SESSION['poche_user'];
+ } else {
+ # fake user, just for install & login screens
+ $this->user = new User();
+ $this->user->setConfig($this->getDefaultConfig());
+ }
+
+ # l10n
+ $language = $this->user->getConfigValue('language');
+ putenv('LC_ALL=' . $language);
+ setlocale(LC_ALL, $language);
+ bindtextdomain($language, LOCALE);
+ textdomain($language);
+
+ # Pagination
+ $this->pagination = new Paginator($this->user->getConfigValue('pager'), 'p');
+
+ # Set up theme
+ $themeDirectory = $this->user->getConfigValue('theme');
+
+ if ($themeDirectory === false) {
+ $themeDirectory = DEFAULT_THEME;
+ }
+
+ $this->currentTheme = $themeDirectory;
+ }
+
+ public function configFileIsAvailable() {
+ if (! self::$configFileAvailable) {
+ $this->notInstalledMessage = 'You have to rename <strong>inc/poche/config.inc.php.new</strong> to <strong>inc/poche/config.inc.php</strong>.';
+
+ return false;
+ }