Ignore:
Timestamp:
Oct 10, 2007, 12:43:09 AM (17 years ago)
Author:
rvelices
Message:
  • RSS feed is PWG charset
  • iptc are now converted from iso-8859-1 or utf-8 (automatic detection) to pwg charset
  • remove function get_language_filepath
  • load_language also checks for the default language
File:
1 edited

Legend:

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

    r2127 r2132  
    930930}
    931931
    932 /**
    933  * return the file path of the given language filename, depending on the
    934  * availability of the file
    935  *
    936  * in descending order of preference:
    937  *   param language, user language, default language
    938  * PhpWebGallery default language.
    939  *
    940  * @param string filename
    941  * @param string dirname
    942  * @param string language
    943  * @return string filepath
    944  */
    945 function get_language_filepath($filename, $dirname = '', $language = '')
    946 {
    947   global $user, $conf;
    948 
    949   if (empty($dirname))
    950   {
    951     $dirname = PHPWG_ROOT_PATH;
    952   }
    953   $dirname .= 'language'.'/';
    954 
    955   $dir_methods = array();
    956 
    957   if (!empty($language))
    958   {
    959     $dir_methods[] = 1;
    960   }
    961 
    962   $dir_methods[] = 2;
    963   $dir_methods[] = 3;
    964   $dir_methods[] = 4;
    965 
    966   foreach ($dir_methods as $dir_method)
    967   {
    968     switch ($dir_method)
    969     {
    970       case '1':
    971       {
    972         $directory = $dirname.$language;
    973         break;
    974       }
    975       case '2':
    976       {
    977         $directory = $dirname.$user['language'];
    978         break;
    979       }
    980       case '3':
    981       {
    982         $directory = $dirname.get_default_language();
    983         break;
    984       }
    985       case '4':
    986       default:
    987       {
    988         $directory = $dirname.PHPWG_DEFAULT_LANGUAGE;
    989         break;
    990       }
    991       {
    992         $directory = '.';
    993       }
    994     }
    995 
    996     $filepath = $directory.'/'.$filename;
    997 
    998     if (file_exists($filepath))
    999     {
    1000       return $filepath;
    1001     }
    1002   }
    1003 
    1004   return false;
    1005 }
    1006932
    1007933/**
Note: See TracChangeset for help on using the changeset viewer.