From 4503c58bc954671503650223bbcabe7a2951d415 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 3 Feb 2011 02:55:41 +0000 Subject: Refs #2428 removed some uses of CONFIG in the views git-svn-id: http://code.elgg.org/elgg/trunk@7996 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/admin/site/advanced.php | 67 +++++++++++++++++----- views/default/admin/site/basic.php | 18 ++++-- views/default/core/account/login_box.php | 2 +- views/default/core/account/login_dropdown.php | 2 +- views/default/core/account/login_walled_garden.php | 22 +------ .../core/settings/account/default_access.php | 6 +- views/default/core/settings/account/language.php | 1 - views/default/forms/login.php | 2 +- views/default/input/button.php | 4 +- views/default/js/initialize_elgg.php | 2 +- views/default/page/elements/html_begin.php | 7 +-- views/default/page/elements/html_end.php | 3 - views/failsafe/messages/exceptions/exception.php | 4 +- views/opendd/messages/exceptions/exception.php | 3 +- views/rss/page/shells/default.php | 6 +- views/xml/messages/exceptions/exception.php | 3 +- 16 files changed, 83 insertions(+), 69 deletions(-) (limited to 'views') diff --git a/views/default/admin/site/advanced.php b/views/default/admin/site/advanced.php index 65c796fbd..49c5de6ac 100644 --- a/views/default/admin/site/advanced.php +++ b/views/default/admin/site/advanced.php @@ -10,57 +10,94 @@ $action = elgg_get_site_url() . "action/admin/site/update_advanced"; $form_body = ""; -foreach(array('wwwroot', 'path', 'dataroot', 'view') as $field) { +foreach (array('wwwroot', 'path', 'dataroot', 'view') as $field) { $form_body .= "

"; $form_body .= elgg_echo('installation:' . $field) . "
"; $warning = elgg_echo('installation:warning:' . $field); - if ($warning != 'installation:warning:' . $field) echo "" . $warning . "
"; - $value = $vars['config']->$field; + if ($warning != 'installation:warning:' . $field) { + echo "" . $warning . "
"; + } + $value = elgg_get_config($field); $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value)); $form_body .= "

"; } $form_body .= "

" . elgg_echo('admin:site:access:warning') . "
"; -$form_body .= elgg_echo('installation:sitepermissions') . elgg_view('input/access', array('internalname' => 'default_access','value' => $vars['config']->default_access)) . "

"; -$form_body .= "

" . elgg_echo('installation:allow_user_default_access:description') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:allow_user_default_access:label')), 'internalname' => 'allow_user_default_access', 'value' => ($vars['config']->allow_user_default_access ? elgg_echo('installation:allow_user_default_access:label') : "") )) . "

"; -$form_body .= "

" . elgg_echo('installation:simplecache:description') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:simplecache:label')), 'internalname' => 'simplecache_enabled', 'value' => ($vars['config']->simplecache_enabled ? elgg_echo('installation:simplecache:label') : "") )) . "

"; -$form_body .= "

" . elgg_echo('installation:viewpathcache:description') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:viewpathcache:label')), 'internalname' => 'viewpath_cache_enabled', 'value' => (($vars['config']->viewpath_cache_enabled) ? elgg_echo('installation:viewpathcache:label') : "") )) . "

"; +$form_body .= elgg_echo('installation:sitepermissions'); +$form_body .= elgg_view('input/access', array( + 'internalname' => 'default_access', + 'value' => elgg_get_config('default_access'), +)) . "

"; +$form_body .= "

" . elgg_echo('installation:allow_user_default_access:description') . "
"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:allow_user_default_access:label')), + 'internalname' => 'allow_user_default_access', + 'value' => (elgg_get_config('allow_user_default_access') ? elgg_echo('installation:allow_user_default_access:label') : ""), +)) . "

"; +$form_body .= "

" . elgg_echo('installation:simplecache:description') . "
"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:simplecache:label')), + 'internalname' => 'simplecache_enabled', + 'value' => (elgg_get_config('simplecache_enabled') ? elgg_echo('installation:simplecache:label') : ""), +)) . "

"; +$form_body .= "

" . elgg_echo('installation:viewpathcache:description') . "
"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:viewpathcache:label')), + 'internalname' => 'viewpath_cache_enabled', + 'value' => (elgg_get_config('viewpath_cache_enabled') ? elgg_echo('installation:viewpathcache:label') : ""), +)) . "

"; $debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); $form_body .= "

" . elgg_echo('installation:debug'); -$form_body .= elgg_view('input/pulldown', array('options_values' => $debug_options, 'internalname' => 'debug', 'value' => $vars['config']->debug)); +$form_body .= elgg_view('input/pulldown', array( + 'options_values' => $debug_options, + 'internalname' => 'debug', + 'value' => elgg_get_config('debug'), +)); $form_body .= '

'; // control new user registration $options = array( 'options' => array(elgg_echo('installation:registration:label')), 'internalname' => 'allow_registration', - 'value' => $vars['config']->allow_registration ? elgg_echo('installation:registration:label') : '', + 'value' => elgg_get_config('allow_registration') ? elgg_echo('installation:registration:label') : '', ); $form_body .= '

' . elgg_echo('installation:registration:description'); $form_body .= '
' .elgg_view('input/checkboxes', $options) . '

'; // control walled garden +$walled_garden = elgg_get_config(walled_garden); $options = array( 'options' => array(elgg_echo('installation:walled_garden:label')), 'internalname' => 'walled_garden', - 'value' => $vars['config']->walled_garden ? elgg_echo('installation:walled_garden:label') : '', + 'value' => $walled_garden ? elgg_echo('installation:walled_garden:label') : '', ); $form_body .= '

' . elgg_echo('installation:walled_garden:description'); $form_body .= '
' . elgg_view('input/checkboxes', $options) . '

'; -$form_body .= "

" . elgg_echo('installation:httpslogin') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:httpslogin:label')), 'internalname' => 'https_login', 'value' => ($vars['config']->https_login ? elgg_echo('installation:httpslogin:label') : "") )) . "

"; +$form_body .= "

" . elgg_echo('installation:httpslogin') . "
"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:httpslogin:label')), + 'internalname' => 'https_login', + 'value' => (elgg_get_config('https_login') ? elgg_echo('installation:httpslogin:label') : "") +)) . "

"; $form_body .= "

" . elgg_echo('installation:disableapi') . "
"; $on = elgg_echo('installation:disableapi:label'); -if ((isset($CONFIG->disable_api)) && ($CONFIG->disable_api == true)) { - $on = ($vars['config']->disable_api ? "" : elgg_echo('installation:disableapi:label')); +$disable_api = elgg_get_config('disable_api'); +if ($disable_api) { + $on = (disable_api ? "" : elgg_echo('installation:disableapi:label')); } -$form_body .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:disableapi:label')), 'internalname' => 'api', 'value' => $on )); +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:disableapi:label')), + 'internalname' => 'api', + 'value' => $on, +)); $form_body .= "

"; $form_body .= elgg_view('input/hidden', array('internalname' => 'settings', 'value' => 'go')); $form_body .= "
".elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = "
".$form_body."
"; +$form_body = "
" . $form_body . "
"; + echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/admin/site/basic.php b/views/default/admin/site/basic.php index d7d36f25b..2c50cf89f 100644 --- a/views/default/admin/site/basic.php +++ b/views/default/admin/site/basic.php @@ -10,19 +10,27 @@ $action = elgg_get_site_url() . "action/admin/site/update_basic"; $form_body = ""; -foreach(array('sitename','sitedescription', 'siteemail') as $field) { +foreach (array('sitename','sitedescription', 'siteemail') as $field) { $form_body .= "

"; $form_body .= elgg_echo('installation:' . $field) . "
"; $warning = elgg_echo('installation:warning:' . $field); - if ($warning != 'installation:warning:' . $field) echo "" . $warning . "
"; - $value = $vars['config']->$field; + if ($warning != 'installation:warning:' . $field) { + echo "" . $warning . "
"; + } + $value = elgg_get_config($field); $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value)); $form_body .= "

"; } $languages = get_installed_translations(); -$form_body .= "

" . elgg_echo('installation:language') . elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $vars['config']->language, 'options_values' => $languages)) . "

"; +$form_body .= "

" . elgg_echo('installation:language'); +$form_body .= elgg_view("input/pulldown", array( + 'internalname' => 'language', + 'value' => elgg_get_config('language'), + 'options_values' => $languages, +)) . "

"; $form_body .= "
".elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = "
".$form_body."
"; +$form_body = "
".$form_body."
"; + echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/core/account/login_box.php b/views/default/core/account/login_box.php index 0dee72328..a371ab0c8 100644 --- a/views/default/core/account/login_box.php +++ b/views/default/core/account/login_box.php @@ -9,7 +9,7 @@ $form_body = elgg_view('forms/login'); $login_url = elgg_get_site_url(); -if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { +if (elgg_get_config('https_login')) { $login_url = str_replace("http:", "https:", $login_url); } ?> diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php index 386a52a6c..356aa48de 100644 --- a/views/default/core/account/login_dropdown.php +++ b/views/default/core/account/login_dropdown.php @@ -12,7 +12,7 @@ $form_body = elgg_view('forms/login'); $form_body .= ""; $login_url = elgg_get_site_url(); -if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { +if (elgg_get_config('https_login')) { $login_url = str_replace("http", "https", elgg_get_site_url()); } diff --git a/views/default/core/account/login_walled_garden.php b/views/default/core/account/login_walled_garden.php index 8b801ed1d..9335c0dfd 100644 --- a/views/default/core/account/login_walled_garden.php +++ b/views/default/core/account/login_walled_garden.php @@ -2,30 +2,12 @@ /** * Walled Garden Login Form */ - -global $CONFIG; - -/* -$form_body = ""; -$form_body .= "
"; -$form_body .= "
"; - -$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))); -$form_body .= "
"; - -$register = elgg_echo('register'); -$lost_password = elgg_echo('user:password:lost'); -$form_body .= '

'; -$form_body .= $CONFIG->allow_registration ? "$register | " : ''; -$form_body .= "$lost_password"; -$form_body .= '

'; -*/ $form_body = elgg_view('forms/login'); $form_body .= elgg_view('input/hidden', array('internalname' => 'returntoreferer', 'value' => 'true')); $login_url = elgg_get_site_url(); -if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { +if (elgg_get_config('https_login')) { $login_url = str_replace("http", "https", elgg_get_site_url()); } ?> @@ -36,7 +18,7 @@ if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) { ?> allow_registration) { +if (elgg_get_config('allow_registration')) { $title = elgg_echo('register'); $body = elgg_view("account/forms/register", array( 'friend_guid' => (int) get_input('friend_guid', 0), diff --git a/views/default/core/settings/account/default_access.php b/views/default/core/settings/account/default_access.php index 678a68ba1..4c4e44757 100644 --- a/views/default/core/settings/account/default_access.php +++ b/views/default/core/settings/account/default_access.php @@ -5,12 +5,12 @@ * @package Elgg * @subpackage Core */ -if ($vars['config']->allow_user_default_access) { +if (elgg_get_config('allow_user_default_access')) { $user = elgg_get_page_owner_entity(); if ($user) { if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) { - $default_access = $vars['config']->default_access; + $default_access = elgg_get_config('default_access'); } ?>
@@ -22,7 +22,7 @@ if ($vars['config']->allow_user_default_access) { : 'default_access', 'value' => $default_access)); + echo elgg_view('input/access', array('internalname' => 'default_access', 'value' => $default_access)); ?>

diff --git a/views/default/core/settings/account/language.php b/views/default/core/settings/account/language.php index bac22fe34..3391a3733 100644 --- a/views/default/core/settings/account/language.php +++ b/views/default/core/settings/account/language.php @@ -6,7 +6,6 @@ * @subpackage Core */ -global $CONFIG; $user = elgg_get_page_owner_entity(); if ($user) { diff --git a/views/default/forms/login.php b/views/default/forms/login.php index d5da8d796..99d9cdd22 100644 --- a/views/default/forms/login.php +++ b/views/default/forms/login.php @@ -25,7 +25,7 @@ allow_registration) { + if (elgg_get_config('allow_registration')) { echo '' . elgg_echo('register') . ' | '; } ?> diff --git a/views/default/input/button.php b/views/default/input/button.php index 8e58b7618..db520b6ac 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -8,8 +8,6 @@ * @uses $vars['src'] Src of an image */ -global $CONFIG; - $defaults = array( 'type' => 'button', 'class' => 'elgg-submit-button', @@ -29,7 +27,7 @@ switch ($vars['type']) { } // blank src if trying to access an offsite image. @todo why? -if (strpos($vars['src'], $CONFIG->wwwroot) === false) { +if (strpos($vars['src'], elgg_get_site_url()) === false) { $vars['src'] = ""; } ?> diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php index 7634851f5..6a82b879e 100644 --- a/views/default/js/initialize_elgg.php +++ b/views/default/js/initialize_elgg.php @@ -8,7 +8,7 @@ /** * Don't want to cache these -- they could change for every request */ -elgg.config.lastcache = lastcache); ?>; +elgg.config.lastcache = ; elgg.security.token.__elgg_ts = ; elgg.security.token.__elgg_token = ''; diff --git a/views/default/page/elements/html_begin.php b/views/default/page/elements/html_begin.php index c4918205f..6a461d767 100644 --- a/views/default/page/elements/html_begin.php +++ b/views/default/page/elements/html_begin.php @@ -3,18 +3,15 @@ * Start html output. * The standard HTML header that displays across the site * - * @uses $vars['config'] The site configuration settings, imported * @uses $vars['title'] The page title * @uses $vars['body'] The main content of the page */ // Set title if (empty($vars['title'])) { - $title = $vars['config']->sitename; -} else if (empty($vars['config']->sitename)) { - $title = $vars['title']; + $title = elgg_get_config('sitename'); } else { - $title = $vars['config']->sitename . ": " . $vars['title']; + $title = elgg_get_config('sitename') . ": " . $vars['title']; } global $autofeed; diff --git a/views/default/page/elements/html_end.php b/views/default/page/elements/html_end.php index 0862934cf..26b0ee451 100644 --- a/views/default/page/elements/html_end.php +++ b/views/default/page/elements/html_end.php @@ -2,9 +2,6 @@ /** * Start html output. * The standard HTML header that displays across the site - * @uses $vars['config'] The site configuration settings, imported - * @uses $vars['title'] The page title - * @uses $vars['body'] The main content of the page */ ?> diff --git a/views/failsafe/messages/exceptions/exception.php b/views/failsafe/messages/exceptions/exception.php index e14eb629d..9fa7dc2a4 100644 --- a/views/failsafe/messages/exceptions/exception.php +++ b/views/failsafe/messages/exceptions/exception.php @@ -22,8 +22,8 @@

debug)) { + +if (elgg_get_config('debug')) { ?>

diff --git a/views/opendd/messages/exceptions/exception.php b/views/opendd/messages/exceptions/exception.php index 73cc462da..54868f1f4 100644 --- a/views/opendd/messages/exceptions/exception.php +++ b/views/opendd/messages/exceptions/exception.php @@ -9,11 +9,10 @@ * @uses $vars['object'] An exception */ -global $CONFIG; ?>