Example #1
0
 /**
  * Parses XML files for language information
  *
  * @access	public
  * @param	string	$dir	 Directory of files
  * @return	array	Array holding the found languages as filename => metadata array
  * @since	1.5
  */
 function _parseXMLLanguageFiles($dir = null)
 {
     if ($dir == null) {
         return null;
     }
     $languages = array();
     jimport('joomla.filesystem.folder');
     $files = JFolder::files($dir, '^([-_A-Za-z]*)\\.xml$');
     foreach ($files as $file) {
         if ($content = file_get_contents($dir . DS . $file)) {
             if ($metadata = JLanguage::_parseXMLLanguageFile($dir . DS . $file)) {
                 $lang = str_replace('.xml', '', $file);
                 $languages[$lang] = $metadata;
             }
         }
     }
     return $languages;
 }