1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-27 11:22:17 -05:00

[change] simplify Tools::getTplFile

This commit is contained in:
Nicolas Lœuillet 2013-12-06 14:07:00 +01:00
parent 6cab59c340
commit 74ec445a66

View File

@ -88,43 +88,16 @@ class Tools
public static function getTplFile($view) public static function getTplFile($view)
{ {
$default_tpl = 'home.twig'; $views = array(
'install', 'import', 'export', 'config', 'tags',
switch ($view) { 'edit-tags', 'view', 'login', 'error'
case 'install': );
$tpl_file = 'install.twig';
break; if (in_array($view, $views)) {
case 'import'; return $view . '.twig';
$tpl_file = 'import.twig';
break;
case 'export':
$tpl_file = 'export.twig';
break;
case 'config':
$tpl_file = 'config.twig';
break;
case 'tags':
$tpl_file = 'tags.twig';
break;
case 'edit-tags':
$tpl_file = 'edit-tags.twig';
break;
case 'view':
$tpl_file = 'view.twig';
break;
case 'login':
$tpl_file = 'login.twig';
break;
case 'error':
$tpl_file = 'error.twig';
break;
default:
$tpl_file = $default_tpl;
break;
} }
return $tpl_file; return 'home.twig';
} }
public static function getFile($url) public static function getFile($url)