aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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';
}
/**