]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2428 removed some uses of CONFIG in the views
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 3 Feb 2011 02:55:41 +0000 (02:55 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 3 Feb 2011 02:55:41 +0000 (02:55 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7996 36083f99-b078-4883-b0ff-0f9b5a30f544

16 files changed:
views/default/admin/site/advanced.php
views/default/admin/site/basic.php
views/default/core/account/login_box.php
views/default/core/account/login_dropdown.php
views/default/core/account/login_walled_garden.php
views/default/core/settings/account/default_access.php
views/default/core/settings/account/language.php
views/default/forms/login.php
views/default/input/button.php
views/default/js/initialize_elgg.php
views/default/page/elements/html_begin.php
views/default/page/elements/html_end.php
views/failsafe/messages/exceptions/exception.php
views/opendd/messages/exceptions/exception.php
views/rss/page/shells/default.php
views/xml/messages/exceptions/exception.php

index 65c796fbd4f1f40cded31b397d1fe96be469f253..49c5de6acd8a377df81901d03e7d480ddd7c74cb 100644 (file)
@@ -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 .= "<p>";
        $form_body .= elgg_echo('installation:' . $field) . "<br />";
        $warning = elgg_echo('installation:warning:' . $field);
-       if ($warning != 'installation:warning:' . $field) echo "<b>" . $warning . "</b><br />";
-       $value = $vars['config']->$field;
+       if ($warning != 'installation:warning:' . $field) {
+               echo "<b>" . $warning . "</b><br />";
+       }
+       $value = elgg_get_config($field);
        $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value));
        $form_body .= "</p>";
 }
 
 $form_body .= "<p>" . elgg_echo('admin:site:access:warning') . "<br />";
-$form_body .= elgg_echo('installation:sitepermissions') . elgg_view('input/access', array('internalname' => 'default_access','value' => $vars['config']->default_access)) . "</p>";
-$form_body .= "<p>" . elgg_echo('installation:allow_user_default_access:description') . "<br />" .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') : "") )) . "</p>";
-$form_body .= "<p>" . elgg_echo('installation:simplecache:description') . "<br />" .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') : "") )) . "</p>";
-$form_body .= "<p>" . elgg_echo('installation:viewpathcache:description') . "<br />" .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') : "") )) . "</p>";
+$form_body .= elgg_echo('installation:sitepermissions');
+$form_body .= elgg_view('input/access', array(
+       'internalname' => 'default_access',
+       'value' => elgg_get_config('default_access'),
+)) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:allow_user_default_access:description') . "<br />";
+$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') : ""),
+)) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:simplecache:description') . "<br />";
+$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') : ""),
+)) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:viewpathcache:description') . "<br />";
+$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') : ""),
+)) . "</p>";
 
 $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 .= "<p>" . 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 .= '</p>';
 
 // 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 .= '<p>' . elgg_echo('installation:registration:description');
 $form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</p>';
 
 // 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 .= '<p>' . elgg_echo('installation:walled_garden:description');
 $form_body .= '<br />' . elgg_view('input/checkboxes', $options) . '</p>';
 
-$form_body .= "<p>" . elgg_echo('installation:httpslogin') . "<br />" .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') : "") )) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:httpslogin') . "<br />";
+$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') : "")
+)) . "</p>";
 
 $form_body .= "<p>" . elgg_echo('installation:disableapi') . "<br />";
 $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 .= "</p>";
 
 $form_body .= elgg_view('input/hidden', array('internalname' => 'settings', 'value' => 'go'));
 
 $form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save")));
-$form_body = "<div class='admin_settings site_admin margin-top'>".$form_body."</div>";
+$form_body = "<div class='admin_settings site_admin'>" . $form_body . "</div>";
+
 echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
index d7d36f25ba0183237c5f0e841c9c9b1ac8790bd9..2c50cf89f5911c64adc5401a1ef6bbc66bf7912b 100644 (file)
@@ -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 .= "<p>";
        $form_body .= elgg_echo('installation:' . $field) . "<br />";
        $warning = elgg_echo('installation:warning:' . $field);
-       if ($warning != 'installation:warning:' . $field) echo "<b>" . $warning . "</b><br />";
-       $value = $vars['config']->$field;
+       if ($warning != 'installation:warning:' . $field) {
+               echo "<b>" . $warning . "</b><br />";
+       }
+       $value = elgg_get_config($field);
        $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value));
        $form_body .= "</p>";
 }
 
 $languages = get_installed_translations();
-$form_body .= "<p>" . elgg_echo('installation:language') . elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $vars['config']->language, 'options_values' => $languages)) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:language');
+$form_body .= elgg_view("input/pulldown", array(
+       'internalname' => 'language',
+       'value' => elgg_get_config('language'),
+       'options_values' => $languages,
+)) . "</p>";
 
 $form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save")));
-$form_body = "<div class='admin_settings site_admin margin-top'>".$form_body."</div>";
+$form_body = "<div class='admin_settings site_admin'>".$form_body."</div>";
+
 echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
index 0dee72328ef89c534d0a4783d41b65c871ab2595..a371ab0c845fc39a69ff20c879467c8dd6e5ffc1 100644 (file)
@@ -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);
 }
 ?>
index 386a52a6cb6a9d8f245e005d409f555ce4234931..356aa48de90e0756de38b3978d81b480363e1c7b 100644 (file)
@@ -12,7 +12,7 @@ $form_body = elgg_view('forms/login');
 $form_body .= "<input type='hidden' name='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());
 }
 
index 8b801ed1d73001fe736df1aacdcbcc5be30e22bd..9335c0dfd4d4d03ec95e9dcc3a1a20ad64761262 100644 (file)
@@ -2,30 +2,12 @@
 /**
 * Walled Garden Login Form
 */
-        
-global $CONFIG;
-
-/*
-$form_body = "<label>" . elgg_echo('username') . "<br />" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login-textarea username')) . "</label>";
-$form_body .= "<br />";
-$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login-textarea')) . "</label><br />";
-
-$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login')));
-$form_body .= "<div class='remember_me'><label><input type='checkbox' name='persistent' checked value='true' />".elgg_echo('user:persistent')."</label></div>";
-
-$register = elgg_echo('register');
-$lost_password = elgg_echo('user:password:lost');
-$form_body .= '<p class="lost_password">';
-$form_body .= $CONFIG->allow_registration ? "<a class=\"registration_link\" href=\"".elgg_get_site_url()."pg/register/\">$register</a> | " : '';
-$form_body .= "<a class='forgotten_password_link' href=\"{$login_url}pages/account/forgotten_password.php\">$lost_password</a>";
-$form_body .= '</p>';
-*/
 
 $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)) {
 ?>
 
 <?php
-if ($CONFIG->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),
index 678a68ba11af5d3be1169b0243d7181c0b787f3f..4c4e44757ec88652e984f075187a2d21c0e6b7c3 100644 (file)
@@ -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');
                }
 ?>
 <div class="elgg-module elgg-info-module">
@@ -22,7 +22,7 @@ if ($vars['config']->allow_user_default_access) {
                <?php echo elgg_echo('default_access:label'); ?>:
                <?php
 
-                       echo elgg_view('input/access',array('internalname' => 'default_access', 'value' => $default_access));
+                       echo elgg_view('input/access', array('internalname' => 'default_access', 'value' => $default_access));
 
                ?>
                </p>
index bac22fe34ee63d2ce7bbd02aad6327b95bc5a876..3391a3733d48c248d983c8b4db6f0ee0c1de82ef 100644 (file)
@@ -6,7 +6,6 @@
  * @subpackage Core
  */
 
-global $CONFIG;
 $user = elgg_get_page_owner_entity();
 
 if ($user) {
index d5da8d7966eb74c6232b09c2f518c665a0e73be1..99d9cdd222da73a7697c76383dc322e6394d8d54 100644 (file)
@@ -25,7 +25,7 @@
        <?php echo elgg_view('login/extend'); ?>
 
 <?php
-       if ($CONFIG->allow_registration) {
+       if (elgg_get_config('allow_registration')) {
                echo '<a class="registration_link" href="' . elgg_get_site_url() . 'pg/register/">' . elgg_echo('register') . '</a> | ';
        }
 ?>
index 8e58b761861cd875d8a45f584a83e3af32fa8302..db520b6acd7a57c005b1ea2d9697d828f6b02b30 100644 (file)
@@ -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'] = "";
 }
 ?>
index 7634851f54a158dc1032f4dd983cb0a753300aa5..6a82b879e219c837c9a5a66b884b0ff327e440c7 100644 (file)
@@ -8,7 +8,7 @@
 /**
  * Don't want to cache these -- they could change for every request
  */
-elgg.config.lastcache = <?php echo (int)($vars['config']->lastcache); ?>;
+elgg.config.lastcache = <?php echo (int)elgg_get_config('lastcache'); ?>;
 
 elgg.security.token.__elgg_ts = <?php echo $ts = time(); ?>;
 elgg.security.token.__elgg_token = '<?php echo generate_action_token($ts); ?>';
index c4918205fc9c9d0429e9688ac6bab237c735971d..6a461d7676d2d6360f79a196bf1072d9bedb1598 100644 (file)
@@ -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;
index 0862934cf99fcd0bfd0dd848bcf4050f2f547d3a..26b0ee451bc039cdff27a7a5db176e08e91d50df 100644 (file)
@@ -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
  */
 ?>
 </body>
index e14eb629d84d3796234d8136f2fdd09fb21b1d98..9fa7dc2a414a9133bc1383ea59b66ac3c8d2111c 100644 (file)
@@ -22,8 +22,8 @@
 </p>
 
 <?php
-global $CONFIG;
-if (isset($CONFIG->debug)) {
+
+if (elgg_get_config('debug')) {
 ?>
 
 <p class="messages_exception">
index 73cc462dae9bdb13c8a29423f7c4d3060377540e..54868f1f4f871ee3402b219a830a3758f36ff9d6 100644 (file)
@@ -9,11 +9,10 @@
  * @uses $vars['object'] An exception
  */
 
-global $CONFIG;
 ?>
 <!--
 <?php echo get_class($vars['object']); ?>: <?php echo autop($vars['object']->getMessage()); ?>
-<?php if (isset($CONFIG->debug)) { ?>
+<?php if (elgg_get_config('debug')) { ?>
 <?php
        echo print_r($vars['object'], true);
 ?>
index 444fa99b50170bc2f923bc75975d38a6df8ba8ce..da6f69c412dacaa94ba4bb0446b5e943a35afb4f 100644 (file)
@@ -16,11 +16,9 @@ echo "<?xml version='1.0'?>\n";
 
 // 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'];
 }
 
 // Remove RSS from URL
index 31d153b8820a2f9ab254d13efb0e3e952efdf2c0..3e4e1c3764339348adc1f6ae179aa4814eb80f48 100644 (file)
@@ -9,13 +9,12 @@
  * @uses $vars['object'] An exception
  */
 
-global $CONFIG;
 ?>
 <!--
 <?php echo get_class($vars['object']); ?>: <?php echo autop($vars['object']->getMessage()); ?>
 
 
-<?php if (isset($CONFIG->debug)) { ?>
+<?php if (elgg_get_config('debug')) { ?>
 <?php
 
                echo print_r($vars['object'], true);