Changeset 1071 in ExiteCMS for trunk/includes/theme_functions.php


Ignore:
Timestamp:
11/06/07 17:12:56 (5 years ago)
Author:
root
Message:

Replaced all includes of locales file by a call to locale_load()
Replaced all locale file references in templates by the locale name
Updated the theme functions to call locale_load() for template locales

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/theme_functions.php

    r1068 r1071  
    162162+-----------------------------------------------------*/ 
    163163function load_templates($_type='', $_name='') { 
    164     global $settings, $userdata, $db_prefix, $aidlink, 
     164    global $settings, $locale, $userdata, $db_prefix, $aidlink, 
    165165            $template, $template_panels, $template_variables,  
    166166            $_loadstats, $_headparms, $_bodyparms, $_last_updated; 
    167167 
     168    // store the current locales. We need to restore them later 
     169    $current_locale = $locale; 
     170     
    168171    // reset all assigned template variables 
    169172    $template->clear_all_assign(); 
     
    173176     
    174177    // Load the global language file 
    175     include PATH_LOCALE.LOCALESET."global.php"; 
     178    locale_load("main.global"); 
    176179 
    177180    // assign CMS website settings to the template 
     
    223226 
    224227            // if one or more locales are assigned to this panel, load them first 
    225             if (isset($panel['locale']) && (is_array($panel['locale']) || $panel['locale'] != "")) { 
     228            if (isset($panel['locale']) { 
    226229                if (is_array($panel['locale'])) { 
    227230                    foreach($panel['locale'] as $panel_locale) { 
    228                         include $panel_locale; 
     231                        locale_load($panel_locale); 
    229232                    } 
    230233                } else { 
    231                     include $panel['locale']; 
     234                    locale_load($panel['locale']); 
    232235                } 
    233236            } 
     
    286289        } 
    287290    } 
     291 
     292    // restore the current locales. 
     293    $locale = $current_locale; 
    288294} 
    289295 
Note: See TracChangeset for help on using the changeset viewer.