Code Duplication    Length = 5-5 lines in 3 locations

view/SSViewer.php 3 locations

@@ 893-897 (lines=5) @@
890
		if(!is_array($templateList) && substr((string) $templateList,-3) == '.ss') {
891
			$this->chosenTemplates['main'] = $templateList;
892
		} else {
893
			if(Config::inst()->get('SSViewer', 'theme_enabled')) {
894
				$theme = Config::inst()->get('SSViewer', 'theme');
895
			} else {
896
				$theme = null;
897
			}
898
			$this->chosenTemplates = SS_TemplateLoader::instance()->findTemplates(
899
				$templateList, $theme
900
			);
@@ 948-952 (lines=5) @@
945
	public static function hasTemplate($templates) {
946
		$manifest = SS_TemplateLoader::instance()->getManifest();
947
948
		if(Config::inst()->get('SSViewer', 'theme_enabled')) {
949
			$theme = Config::inst()->get('SSViewer', 'theme');
950
		} else {
951
			$theme = null;
952
		}
953
954
		foreach ((array) $templates as $template) {
955
			if ($manifest->getCandidateTemplate($template, $theme)) return true;
@@ 1036-1040 (lines=5) @@
1033
	 */
1034
	public static function getTemplateFileByType($identifier, $type) {
1035
		$loader = SS_TemplateLoader::instance();
1036
		if(Config::inst()->get('SSViewer', 'theme_enabled')) {
1037
			$theme = Config::inst()->get('SSViewer', 'theme');
1038
		} else {
1039
			$theme = null;
1040
		}
1041
		$found  = $loader->findTemplates("$type/$identifier", $theme);
1042
1043
		if (isset($found['main'])) {