From 00dbaf90bc44ef3ed0abaebb15307756e054a027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 20 Sep 2013 10:21:39 +0200 Subject: merge #224 --- inc/poche/Tools.class.php | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'inc/poche/Tools.class.php') diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1ab90be1..8eb988f4 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -84,9 +84,9 @@ class Tools public static function getTplFile($view) { - $tpl_file = 'home.twig'; - switch ($view) - { + $default_tpl = 'home.twig'; + + switch ($view) { case 'install': $tpl_file = 'install.twig'; break; @@ -102,9 +102,20 @@ class Tools case 'view': $tpl_file = 'view.twig'; break; + + case 'login': + $tpl_file = 'login.twig'; + break; + + case 'error': + $tpl_file = 'error.twig'; + break; + default: - break; + $tpl_file = $default_tpl; + break; } + return $tpl_file; } @@ -228,27 +239,6 @@ class Tools return $minutes; } - - public static function createMyConfig() - { - $myconfig_file = './inc/poche/myconfig.inc.php'; - - if (!is_writable('./inc/poche/')) { - self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php'); - die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); - } - - if (!file_exists($myconfig_file)) - { - $fp = fopen($myconfig_file, 'w'); - fwrite($fp, '