In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

View Revisions: Issue #349 All Revisions ] Back to Issue ]
Summary 0000349: Interface language is not changed, when language is switched from top frame
Revision 2009-10-29 03:32:21 by alex
Additional Information This is latest version of fixed kApplication::GetDefaultLanguageId method

function GetDefaultLanguageId($init = false)
    {
        static $language_info = null;

        if (!isset($language_info)) {
            // cache primary language info first
            $table = $this->getUnitOption('lang', 'TableName');
            $id_field = $this->getUnitOption('lang', 'IDField');

            $sql = 'SELECT ' . $id_field . ', IF(AdminInterfaceLang, "Admin", "Front") AS LanguageKey
                    FROM ' . $table . '
                    WHERE (AdminInterfaceLang = 1 OR PrimaryLang = 1) AND (Enabled = 1)';
            $language_info = $this->Conn->GetCol($sql, 'LanguageKey');
        }

        $language_key = ($this->IsAdmin() && $init) || count($language_info) == 1 ? 'Admin' : 'Front';

        if (array_key_exists($language_key, $language_info) && $language_info[$language_key] > 0) {
            // get from cache
            return $language_info[$language_key];
        }

        $language_id = $language_info && array_key_exists($language_key, $language_info) ? $language_info[$language_key] : false;

        if (!$language_id && defined('IS_INSTALL') && IS_INSTALL) {
            $language_id = 1;
        }

        return $language_id;
    }
Revision 2009-10-28 01:29:32 by alex
Additional Information



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker