diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-11-12 12:37:50 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-11-12 13:07:23 +0100 |
commit | 952abdc51ae19e05cf428e911d55de92c6ecc52f (patch) | |
tree | a3d30cd5d3ec208db6581d33e25a05869a829944 /lib/private/template | |
parent | c998f620d0b19e3f832ca7a65134035cf81e6d6f (diff) | |
download | nextcloud-server-952abdc51ae19e05cf428e911d55de92c6ecc52f.tar.gz nextcloud-server-952abdc51ae19e05cf428e911d55de92c6ecc52f.zip |
Drop form_factor that is appended to JS, CSS and template filenames
Diffstat (limited to 'lib/private/template')
-rw-r--r-- | lib/private/template/cssresourcelocator.php | 10 | ||||
-rw-r--r-- | lib/private/template/jsresourcelocator.php | 9 | ||||
-rw-r--r-- | lib/private/template/resourcelocator.php | 8 | ||||
-rw-r--r-- | lib/private/template/templatefilelocator.php | 12 |
4 files changed, 7 insertions, 32 deletions
diff --git a/lib/private/template/cssresourcelocator.php b/lib/private/template/cssresourcelocator.php index e26daa25827..cb129261b51 100644 --- a/lib/private/template/cssresourcelocator.php +++ b/lib/private/template/cssresourcelocator.php @@ -12,9 +12,7 @@ class CSSResourceLocator extends ResourceLocator { public function doFind( $style ) { if (strpos($style, '3rdparty') === 0 && $this->appendIfExist($this->thirdpartyroot, $style.'.css') - || $this->appendIfExist($this->serverroot, $style.$this->form_factor.'.css') || $this->appendIfExist($this->serverroot, $style.'.css') - || $this->appendIfExist($this->serverroot, 'core/'.$style.$this->form_factor.'.css') || $this->appendIfExist($this->serverroot, 'core/'.$style.'.css') ) { return; @@ -23,8 +21,7 @@ class CSSResourceLocator extends ResourceLocator { $style = substr($style, strpos($style, '/')+1); $app_path = \OC_App::getAppPath($app); $app_url = \OC_App::getAppWebPath($app); - if ($this->appendIfExist($app_path, $style.$this->form_factor.'.css', $app_url) - || $this->appendIfExist($app_path, $style.'.css', $app_url) + if ($this->appendIfExist($app_path, $style.'.css', $app_url) ) { return; } @@ -33,11 +30,8 @@ class CSSResourceLocator extends ResourceLocator { public function doFindTheme( $style ) { $theme_dir = 'themes/'.$this->theme.'/'; - $this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$style.$this->form_factor.'.css') - || $this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$style.'.css') - || $this->appendIfExist($this->serverroot, $theme_dir.$style.$this->form_factor.'.css') + $this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$style.'.css') || $this->appendIfExist($this->serverroot, $theme_dir.$style.'.css') - || $this->appendIfExist($this->serverroot, $theme_dir.'core/'.$style.$this->form_factor.'.css') || $this->appendIfExist($this->serverroot, $theme_dir.'core/'.$style.'.css'); } } diff --git a/lib/private/template/jsresourcelocator.php b/lib/private/template/jsresourcelocator.php index 507f31327a6..5a6672429cf 100644 --- a/lib/private/template/jsresourcelocator.php +++ b/lib/private/template/jsresourcelocator.php @@ -13,15 +13,10 @@ class JSResourceLocator extends ResourceLocator { $theme_dir = 'themes/'.$this->theme.'/'; if (strpos($script, '3rdparty') === 0 && $this->appendIfExist($this->thirdpartyroot, $script.'.js') - || $this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$script.$this->form_factor.'.js') || $this->appendIfExist($this->serverroot, $theme_dir.'apps/'.$script.'.js') - || $this->appendIfExist($this->serverroot, $theme_dir.$script.$this->form_factor.'.js') || $this->appendIfExist($this->serverroot, $theme_dir.$script.'.js') - || $this->appendIfExist($this->serverroot, $script.$this->form_factor.'.js') || $this->appendIfExist($this->serverroot, $script.'.js') - || $this->appendIfExist($this->serverroot, $theme_dir.'core/'.$script.$this->form_factor.'.js') || $this->appendIfExist($this->serverroot, $theme_dir.'core/'.$script.'.js') - || $this->appendIfExist($this->serverroot, 'core/'.$script.$this->form_factor.'.js') || $this->appendIfExist($this->serverroot, 'core/'.$script.'.js') ) { return; @@ -30,9 +25,7 @@ class JSResourceLocator extends ResourceLocator { $script = substr($script, strpos($script, '/')+1); $app_path = \OC_App::getAppPath($app); $app_url = \OC_App::getAppWebPath($app); - if ($this->appendIfExist($app_path, $script.$this->form_factor.'.js', $app_url) - || $this->appendIfExist($app_path, $script.'.js', $app_url) - ) { + if ($this->appendIfExist($app_path, $script.'.js', $app_url)) { return; } // missing translations files fill be ignored diff --git a/lib/private/template/resourcelocator.php b/lib/private/template/resourcelocator.php index 7976c415922..919665df704 100644 --- a/lib/private/template/resourcelocator.php +++ b/lib/private/template/resourcelocator.php @@ -10,7 +10,6 @@ namespace OC\Template; abstract class ResourceLocator { protected $theme; - protected $form_factor; protected $mapping; protected $serverroot; @@ -21,11 +20,9 @@ abstract class ResourceLocator { /** * @param string $theme - * @param string $form_factor */ - public function __construct( $theme, $form_factor, $core_map, $party_map ) { + public function __construct( $theme, $core_map, $party_map ) { $this->theme = $theme; - $this->form_factor = $form_factor; $this->mapping = $core_map + $party_map; $this->serverroot = key($core_map); $this->thirdpartyroot = key($party_map); @@ -46,8 +43,7 @@ abstract class ResourceLocator { } } } catch (\Exception $e) { - throw new \Exception($e->getMessage().' formfactor:'.$this->form_factor - .' serverroot:'.$this->serverroot); + throw new \Exception($e->getMessage().' serverroot:'.$this->serverroot); } } diff --git a/lib/private/template/templatefilelocator.php b/lib/private/template/templatefilelocator.php index 8e9f3bd8100..042298389c8 100644 --- a/lib/private/template/templatefilelocator.php +++ b/lib/private/template/templatefilelocator.php @@ -9,16 +9,13 @@ namespace OC\Template; class TemplateFileLocator { - protected $form_factor; protected $dirs; private $path; /** * @param string[] $dirs - * @param string $form_factor */ - public function __construct( $form_factor, $dirs ) { - $this->form_factor = $form_factor; + public function __construct( $dirs ) { $this->dirs = $dirs; } @@ -33,18 +30,13 @@ class TemplateFileLocator { } foreach($this->dirs as $dir) { - $file = $dir.$template.$this->form_factor.'.php'; - if (is_file($file)) { - $this->path = $dir; - return $file; - } $file = $dir.$template.'.php'; if (is_file($file)) { $this->path = $dir; return $file; } } - throw new \Exception('template file not found: template:'.$template.' formfactor:'.$this->form_factor); + throw new \Exception('template file not found: template:'.$template); } public function getPath() { |