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)
{
$default_tpl = 'home.twig';
$views = array(
'install', 'import', 'export', 'config', 'tags',
'edit-tags', 'view', 'login', 'error'
);
switch ($view) {
case 'install':
$tpl_file = 'install.twig';
break;
case 'import';
$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;
if (in_array($view, $views)) {
return $view . '.twig';
}
return $tpl_file;
return 'home.twig';
}
public static function getFile($url)