Ignore:
Timestamp:
Oct 9, 2007, 1:46:09 AM (17 years ago)
Author:
rvelices
Message:
  • some code refactoring before upgrade to utf (only cosmetic at this point...)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r2123 r2126  
    730730  {
    731731    $user = build_user( $conf['guest_id'], true);
    732     include_once(get_language_filepath('common.lang.php'));
     732    load_language('common.lang');
    733733    trigger_action('loading_lang');
    734     @include_once(get_language_filepath('local.lang.php'));
     734    load_language('local.lang');
    735735    list($tmpl, $thm) = explode('/', get_default_template());
    736736    $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
     
    14251425}
    14261426
     1427/**
     1428 * returns the character set of data sent to browsers / received from forms
     1429 */
     1430function get_pwg_charset()
     1431{
     1432  //TEMP CODE
     1433  global $lang_info;return $lang_info['charset'];
     1434}
     1435
     1436/**
     1437 * includes a language file or returns the content of a language file
     1438 * availability of the file
     1439 *
     1440 * in descending order of preference:
     1441 *   param language, user language, default language
     1442 * PhpWebGallery default language.
     1443 *
     1444 * @param string filename
     1445 * @param string dirname
     1446 * @param string language
     1447 * @param bool return_content - if true the file content is returned otherwise
     1448 *  the file is evaluated as php
     1449 * @return boolean success status or a string if return_content is true
     1450 */
     1451function load_language($filename, $dirname = '', $language = '',
     1452    $return_content=false)
     1453{
     1454  //TEMP CODE
     1455  if (!$return_content) $filename.='.php';
     1456  $f = get_language_filepath($filename, $dirname, $language);
     1457  if ($f === false)
     1458    return false;
     1459  if ($return_content)
     1460    return @file_get_contents($f);
     1461  global $lang, $lang_info;
     1462  @include($f);
     1463  return true;
     1464}
     1465
    14271466?>
Note: See TracChangeset for help on using the changeset viewer.