aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/views.php
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-03 01:56:29 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-03 01:56:29 +0000
commit6307e6af3b4a717011570e71b844c4b1e366fae5 (patch)
tree59ea96760e4a93a24d4690c640448f22fb0024da /engine/lib/views.php
parent40f0b39c4397c21230e10ecc8ecf2549b06bf172 (diff)
downloadelgg-6307e6af3b4a717011570e71b844c4b1e366fae5.tar.gz
elgg-6307e6af3b4a717011570e71b844c4b1e366fae5.tar.bz2
Fixes #2151: Replaced elgg_get_viewtype() implementation with @cash's much simpler version
git-svn-id: http://code.elgg.org/elgg/trunk@7214 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r--engine/lib/views.php24
1 files changed, 6 insertions, 18 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php
index f9ceafd2d..21056db0e 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -96,32 +96,20 @@ function elgg_set_viewtype($viewtype = "") {
function elgg_get_viewtype() {
global $CURRENT_SYSTEM_VIEWTYPE, $CONFIG;
- $viewtype = NULL;
-
if ($CURRENT_SYSTEM_VIEWTYPE != "") {
return $CURRENT_SYSTEM_VIEWTYPE;
}
- // @todo what is this? Why would you want to save a viewtype to the session?
- if ((empty($_SESSION['view'])) || ( (trim($CONFIG->view != ""))
- && ($_SESSION['view'] != $CONFIG->view) )) {
-
- $_SESSION['view'] = "default";
- // If we have a config default view for this site then use that instead of 'default'
- if ((!empty($CONFIG->view)) && (trim($CONFIG->view) != "")) {
- $_SESSION['view'] = $CONFIG->view;
- }
- }
-
- if (empty($viewtype) && is_callable('get_input')) {
- $viewtype = get_input('view');
+ $viewtype = get_input('view', NULL);
+ if ($viewtype) {
+ return $viewtype;
}
- if (empty($viewtype)) {
- $viewtype = $_SESSION['view'];
+ if (isset($CONFIG->view) && !empty($CONFIG->view)) {
+ return $CONFIG->view;
}
- return $viewtype;
+ return 'default';
}
/**