]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
authorSarven Capadisli <csarven@status.net>
Wed, 3 Mar 2010 20:31:44 +0000 (15:31 -0500)
committerSarven Capadisli <csarven@status.net>
Wed, 3 Mar 2010 20:31:44 +0000 (15:31 -0500)
actions/oauthconnectionssettings.php
actions/siteadminpanel.php
index.php
lib/adminpanelaction.php
lib/default.php
lib/util.php

index b1467f0d04b5ea35a2e24f211f242d26e0a8773d..f125f4c63101f222b740da552ad0390be8377ecd 100644 (file)
@@ -99,7 +99,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
 
         $application = $profile->getApplications($offset, $limit);
 
-        $cnt == 0;
+        $cnt = 0;
 
         if (!empty($application)) {
             $al = new ApplicationList($application, $user, $this, true);
@@ -112,7 +112,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction
 
         $this->pagination($this->page > 1, $cnt > APPS_PER_PAGE,
                           $this->page, 'connectionssettings',
-                          array('nickname' => $this->user->nickname));
+                          array('nickname' => $user->nickname));
     }
 
     /**
index 8c8f8b3742bf5c28590281c59dc14504c828b521..4b29819b71b0d68532c0e4c691dd60b47213c574 100644 (file)
@@ -277,8 +277,8 @@ class SiteAdminPanelForm extends AdminForm
         $this->unli();
 
         $this->li();
-        $this->out->dropdown('language', _('Language'),
-                             get_nice_language_list(), _('Default site language'),
+        $this->out->dropdown('language', _('Default language'),
+                             get_nice_language_list(), _('Site language when autodetection from browser settings is not available'),
                              false, $this->value('language'));
         $this->unli();
 
index 06ff9900fd5bff24466be4cbd6ee5ffaeb87ac6e..a46bc084d55e729899a8a48fe654adfa58ed5b09 100644 (file)
--- a/index.php
+++ b/index.php
@@ -253,6 +253,7 @@ function main()
     $user = common_current_user();
 
     // initialize language env
+common_log(LOG_DEBUG, "XXX: WAIII");
 
     common_init_language();
 
index 536d97cdf5d440329a4a0a16681289840020b026..9ea4fe2066adf2444ad951fd65e5e8737d8e53a9 100644 (file)
@@ -171,6 +171,24 @@ class AdminPanelAction extends Action
         $this->showForm();
     }
 
+    /**
+     * Show content block. Overrided just to add a special class
+     * to the content div to allow styling. 
+     *
+     * @return nothing
+     */
+    function showContentBlock()
+    {
+        $this->elementStart('div', array('id' => 'content', 'class' => 'admin'));
+        $this->showPageTitle();
+        $this->showPageNoticeBlock();
+        $this->elementStart('div', array('id' => 'content_inner'));
+        // show the actual content (forms, lists, whatever)
+        $this->showContent();
+        $this->elementEnd('div');
+        $this->elementEnd('div');
+    }
+
     /**
      * show human-readable instructions for the page, or
      * a success/failure on save.
index 7b50242ae27f9ff5b37996f86348e6d2c7485545..b7216045ce8555a110570e270c9cc4cfe963d4a9 100644 (file)
@@ -40,7 +40,8 @@ $default =
               'logdebug' => false,
               'fancy' => false,
               'locale_path' => INSTALLDIR.'/locale',
-              'language' => 'en_US',
+              'language' => 'en',
+              'langdetect' => true,
               'languages' => get_all_languages(),
               'email' =>
               array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : null,
index 46be920fa7940aa671155985170cf5552af77c64..da2799d4f92d23766c464b1e15b4c66ab6704217 100644 (file)
@@ -105,11 +105,13 @@ function common_language()
 
     // Otherwise, find the best match for the languages requested by the
     // user's browser...
-    $httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
-    if (!empty($httplang)) {
-        $language = client_prefered_language($httplang);
-        if ($language)
-          return $language;
+    if (common_config('site', 'langdetect')) {
+        $httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
+        if (!empty($httplang)) {
+            $language = client_prefered_language($httplang);
+            if ($language)
+              return $language;
+        }
     }
 
     // Finally, if none of the above worked, use the site's default...