From c3a4bafc3f3f0984e8751e00e024ab8c09e0ff1b Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 18 Jun 2008 13:32:43 +0000 Subject: Fixes #18: Set default view type in admin http://trac.elgg.org/elgg/ticket/18 git-svn-id: https://code.elgg.org/elgg/trunk@963 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/admin/site/update_basic.php | 2 ++ actions/systemsettings/install.php | 1 + engine/lib/elgglib.php | 6 +++++- languages/en.php | 3 ++- views/default/settings/system.php | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php index 830df9ad1..ae48da8f8 100644 --- a/actions/admin/site/update_basic.php +++ b/actions/admin/site/update_basic.php @@ -31,6 +31,8 @@ set_config('language', get_input('language'), $site->getGUID()); + set_config('view', get_input('view'), $site->getGUID()); + $debug = get_input('debug'); if ($debug) set_config('debug', 1, $site->getGUID()); diff --git a/actions/systemsettings/install.php b/actions/systemsettings/install.php index 30f501f36..f18844ce1 100644 --- a/actions/systemsettings/install.php +++ b/actions/systemsettings/install.php @@ -33,6 +33,7 @@ datalist_set('default_site',$site->getGUID()); + set_config('view', get_input('view'), $site->getGUID()); set_config('language', get_input('language'), $site->getGUID()); $debug = get_input('debug'); diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 4377083af..3670cd884 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -128,7 +128,11 @@ // If we haven't been asked for a specific view, assume default if (empty($_SESSION['view'])) { - $_SESSION['view'] = "default"; + $_SESSION['view'] = "default"; + + // If we have a config default view for this site then use that instead of 'default' + if ((is_installed()) && (!empty($CONFIG->view))) + $_SESSION['view'] = $CONFIG->view; } if (empty($viewtype) && is_callable('get_input')) $viewtype = get_input('view'); diff --git a/languages/en.php b/languages/en.php index 0e359c561..1641c206d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -351,7 +351,8 @@ Alternatively, you can enter your database settings below and we will try and do 'dataroot' => "The full path to the directory where uploaded files will be stored, followed by a trailing slash:", 'language' => "The default language code for your site, e.g. 'en' for English, 'fr' for French, 'ru' for Russian:", 'debug' => "Debug mode provides extra information which can be used to diagnose faults, however it can slow your system down so should only be used if you are having problems:", - 'debug:label' => "Turn on debug mode", + 'debug:label' => "Turn on debug mode", + 'view' => "Enter the view which will be used as the default for your site (e.g. 'mobile') or leave this blank for the default view:", /** * Welcome diff --git a/views/default/settings/system.php b/views/default/settings/system.php index c956da0d4..7fba20947 100644 --- a/views/default/settings/system.php +++ b/views/default/settings/system.php @@ -27,7 +27,7 @@

-- cgit v1.2.3