summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-11-12 16:16:02 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-01-09 10:19:28 +0100
commit6552fec1134785e9a669f40820c2679f8e8c96c6 (patch)
tree1fdde088f066f73fc533054bf53a2c0ce282fc1d /lib
parentd859d1b6c758e6e1ee1214bb42a07b2b35fd84e4 (diff)
downloadnextcloud-server-6552fec1134785e9a669f40820c2679f8e8c96c6.tar.gz
nextcloud-server-6552fec1134785e9a669f40820c2679f8e8c96c6.zip
no need to store the form factor in the session - it's computation is rather cheep
Conflicts: lib/private/template.php
Diffstat (limited to 'lib')
-rw-r--r--lib/private/template.php36
1 files changed, 14 insertions, 22 deletions
diff --git a/lib/private/template.php b/lib/private/template.php
index 173345cc001..983c0e3628d 100644
--- a/lib/private/template.php
+++ b/lib/private/template.php
@@ -97,36 +97,28 @@ class OC_Template extends \OC\Template\Base {
}
/**
- * Returns the formfactor extension for current formfactor
+ * Returns the form factor extension for current form factor
*/
static public function getFormFactorExtension()
{
- if (!\OC::$session) {
- return '';
- }
- // if the formfactor is not yet autodetected do the
- // autodetection now. For possible formfactors check the
- // detectFormfactor documentation
- if (!\OC::$session->exists('formfactor')) {
- \OC::$session->set('formfactor', self::detectFormfactor());
- }
// allow manual override via GET parameter
if(isset($_GET['formfactor'])) {
- \OC::$session->set('formfactor', $_GET['formfactor']);
+ $formFactor = $_GET['formfactor'];
+ } else {
+ $formFactor = self::detectFormfactor();
}
- $formfactor = \OC::$session->get('formfactor');
- if($formfactor==='default') {
- $fext='';
- }elseif($formfactor==='mobile') {
- $fext='.mobile';
- }elseif($formfactor==='tablet') {
- $fext='.tablet';
- }elseif($formfactor==='standalone') {
- $fext='.standalone';
+ if($formFactor==='default') {
+ $formFactorExt='';
+ }elseif($formFactor==='mobile') {
+ $formFactorExt='.mobile';
+ }elseif($formFactor==='tablet') {
+ $formFactorExt='.tablet';
+ }elseif($formFactor==='standalone') {
+ $formFactorExt='.standalone';
}else{
- $fext='';
+ $formFactorExt='';
}
- return $fext;
+ return $formFactorExt;
}
/**