[Pkg-owncloud-commits] [owncloud] 40/90: no need to store the form factor in the session - it's computation is rather cheep
David Prévot
taffit at moszumanska.debian.org
Fri Feb 6 21:10:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 6552fec1134785e9a669f40820c2679f8e8c96c6
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date: Wed Nov 12 16:16:02 2014 +0100
no need to store the form factor in the session - it's computation is rather cheep
Conflicts:
lib/private/template.php
---
lib/private/template.php | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
diff --git a/lib/private/template.php b/lib/private/template.php
index 173345c..983c0e3 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;
}
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list