'; if ($file[Id] != _DEFAULT_LANG_) { /* if ($onlyUntranslated=='on') { $checker = ' checked'; } */ if (!$file['sourceId']) { $file['sourceId'] = _DEFAULT_LANG_; } } $s = Data::convArr2GS($source); $t = Data::convArr2GS($target); $nr = 0; if (is_array($s)) { while (list($key, $value) = each($s)) { if (!$value) { // item in default-lang-file was not translated $value = $key; } if (isset($t[$key]) && (trim($t[$key])!='')) { $insval = Data::convStr($t[$key], 0, 1, 0); $pre = ''; $post = ''; } else { $insval = ''; $pre = ''; $post = ''; } $displKey = Data::convStr($key, 0, 0, !_DENY_HTML_); if ($onlyUntranslated && !empty($t[$key])) { $html .= ""; } else { $html .= ''; $html .= ''; } $nr++; } } $html .= ''; $html .= '
'.getGS('source:').' '.Data::langPath($file, $source[Id], 'xml').'
'.getGS('target:').' '.Data::langPath($file, $target[Id], 'xml').'

'; if ($target[Id] == _DEFAULT_LANG_) { $html .= "".getGS('key:')." $pre$displKey$post
\n"; } else { if ($source[item][$nr][from]) { $html .= "$source[Id]: $pre".$source[item][$nr][from]."$post
\n"; } else { $html .= ""._DEFAULT_LANG_.": $pre$value$post
\n"; } } $html .= ""; $html .= ""; $html .= "
\n"; if ($target[Id] == _DEFAULT_LANG_) { // default language => can change keys $fileparms = "Id=$source[Id]&base=$file[base]&dir=$file[dir]"; if ($nr==0) { // swap last and first entry $prev = count($s)-1; $next = $nr+1; } elseif ($nr == count($s)-1) { // swap last and first entry $prev = $nr-1; $next = 0; } else { // swap entrys linear $prev = $nr-1; $next = $nr+1; } $rem_href = _PANEL_SCRIPT_."?action=removeEntryFromXML&pos=$nr&$fileparms"; $mv_up_href = _PANEL_SCRIPT_."?action=swapEntrysOnXML&pos1=$nr&pos2=$prev&$fileparms"; $mv_down_href = _PANEL_SCRIPT_."?action=swapEntrysOnXML&pos1=$nr&pos2=$next&$fileparms"; $html .= '
'. "
". ''; } $html .= '

'. Display::sourceLangMenu($file[sourceId], $file).'


'.getGS('fully translated').'     
'; return $html; } function sourceLangMenu ($currId, $file) { switch (_LANG_BASE_) { case 'xml': if ($arr = Data::readXML2Arr('./languages.xml')) { $languages = $arr[language]; unset($arr); }else { return getGS('cannot read $1', 'languages.xml').'
'; } break; case 'campsite': if ($languages = DB_Handle::readCSLang2Arr()) { } else { return getGS('cannot read $1', 'campsite.Languages').'
'; } break; } foreach ($languages as $key=>$val) { if (!(file_exists("$file[dir]/$file[base].$val[Id].xml") && ($file[Id] != $val[Id]))) { unset($languages[$key]); } } $menu .= getGS('translate from:').'   '; return $menu; } function _langMenuOptions ($languages, $currId) { foreach($languages as $key=>$val) { if ($currId == $val[Id]) { $curr = 'selected'; } else { unset($curr); } $options .= "\n"; } return $options; } function createLangMenu ($currId) { $languages = Data::getLanguages(); $menu .= '

'; return $menu; } function createTOLLangMenu ($currId) { $languages = Data::getLanguages(); $menu .= '

'; return $menu; } function manageLangButton() { $html = '
'; return $html; } function manageLangForm() { $languages = Data::getLanguages(); $html .= ' '; foreach($languages as $nr=>$l) { $editLink = ''.getGS('edit').''; $delLink = ''.getGS('delete').''; $html .= ""; } return $html; } function parseFolder($dirname, $depth=0) { $space = 2; $structure = File_Find::mapTreeMultiple($dirname); arsort($structure, SORT_STRING); #print_r($structure); if ($depth == 0) { $html .= str_repeat(' ',$depth * $space).''.strtoupper(' / ')."\n"; } foreach($structure as $dir=>$file) { if (is_array($file)) { // itīs a directory unset($base); unset($baseadd); if (!(substr($dir, 0, strlen(_PREFIX_HIDE_)) == _PREFIX_HIDE_)) { // hide special dirs $html .= str_repeat(' ', ($depth+1) * $space).''.strtoupper($dir)."\n"; $html .= Display::parseFolder($dirname.'/'.$dir, $depth+1); } } else { // itīs a file if (((strpos(' '.$file, _PREFIX_) == 1) || (strpos(' '.$file, _PREFIX_GLOBAL_) == 1)) && (substr($file, strlen($file) - 4) == '.xml')) { if (!_MAINTAINANCE_ && preg_match("/[^.]*\."._DEFAULT_LANG_."\.xml/", $file)) { // skip default language if not maintainance mode } else { $Id = explode('.', $file); $html .= str_repeat(' ', ($depth+1) * $space).''.$file."\n"; } } } } if ($depth == 0) { return "
$html
"; } else { return $html; } } function addEntrySelection($arr, $file) { $html = '
'.getGS('add new fields:').' '; if (_MAINTAINANCE_) $html .= ' '; return $html; } function addEntry2XML($file, $pos, $amount) { // check input if (!isInt($amount)) { return getGS('go').' '.getGS('back').' '.getGS('and enter a positive integer value'); } $html .= '
'.getGS('name').' '.getGS('native name').' '.getGS('code').' '.getGS('edit').' '.getGS('delete').'
$l[Name]$l[NativeName]$l[Code]$editLink$delLink
'; for($n=1; $n<=$amount; $n++) { $html .= ""; } $html .= '
'; return $html; } function newLangFilePref($dir) { // at first check if default files already exists $handle = opendir ($dir); while (false !== ($file = readdir ($handle))) { $exists[$file] = true; } closedir($handle); $html .= ' '.getGS('create new language file in').' '.strtoupper($dir).'
'; if ($dir == _START_DIR_.'/') { if ($exists[_PREFIX_.'.'._DEFAULT_LANG_.'.xml'] && $exists[_PREFIX_GLOBAL_.'.'._DEFAULT_LANG_.'.xml']) { return getGS('$1 and $2 files already exist in $3', _PREFIX_, _PREFIX_GLOBAL_, strtoupper($dir)); } else { if ($exists[_PREFIX_GLOBAL_.'.'._DEFAULT_LANG_.'.xml']) { $globals .= ' disabled'; $locals .= ' checked'; } if ($exists[_PREFIX_.'.'._DEFAULT_LANG_.'.xml']) { $locals .= ' disabled'; $globals .= ' checked'; } $html .= ' Type:
'._PREFIX_.' '._PREFIX_GLOBAL_; } } else { if ($exists[_PREFIX_.'.'._DEFAULT_LANG_.'.xml']) { return getGS('$1 file already exist in $2', _PREFIX_, strtoupper($dir)); } else { $html .= ''; } } $html .= '
'.getGS('entrys:').'
'; return $html; } function newLangFileForm($amount, $base, $dir) { // check input if (!$base) { return getGS('go').' '.getGS('back').' '.getGS('and select file type'); } if (!isInt($amount)) { return getGS('go').' '.getGS('back').' '.getGS('and enter a positive integer value'); } $html .= ' '.getGS('create new language file $1', strtoupper($dir).'/'.$base.'.'._DEFAULT_LANG_.'.xml').'
'; for($n=1; $n<=$amount; $n++) { $html .= ""; } $html .= '
'; return $html; } } ?>