really close to 0.9

This commit is contained in:
sebastian 2005-03-24 20:43:04 +00:00
parent 0a0de2ed42
commit b529217621
30 changed files with 2978 additions and 11 deletions

View file

@ -458,10 +458,10 @@ $ui_fmask = array(
'type' => 'select', 'type' => 'select',
'label' => 'Language', 'label' => 'Language',
'options' => array( 'options' => array(
'en' => 'English', 'en.English' => 'English',
'cz' => 'Czech', 'cz.Czech' => 'Czech',
'de' => 'German', 'de.German' => 'German',
'hu' => 'Hungarian', 'hu.Hungarian' => 'Hungarian',
) )
) )
), ),

View file

@ -184,12 +184,14 @@ switch($_REQUEST['act']){
case "PL.create": case "PL.create":
if (($ui_tmpid = $uiHandler->PLAYLIST->create($_REQUEST['id'])) !== FALSE) if (($ui_tmpid = $uiHandler->PLAYLIST->create($_REQUEST['id'])) !== FALSE)
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
$uiHandler->SCRATCHPAD->addItem($ui_tmpid); $uiHandler->SCRATCHPAD->addItem($ui_tmpid);
$uiHandler->PLAYLIST->setRedirect(); $uiHandler->PLAYLIST->setRedirect();
break; break;
case "PL.addItem": case "PL.addItem":
$uiHandler->PLAYLIST->addItem($_REQUEST['id']); if ($uiHandler->PLAYLIST->addItem($_REQUEST['id']) !== FALSE)
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

View file

@ -0,0 +1,588 @@
<?php
class Data {
var $serializeoptions = array(
"indent" => "\t", // indent with tabs
"rootName" => "language", // root tag
"defaultTagName" => "item", // tag for values with numeric keys
#"typeHints" => true,
"keyAttribute" => "position",
"addDecl" => true,
"encoding" => _ENCODING_,
"indentAttributes" => true,
"mode" => 'simplexml'
);
var $unserializeoptions = array();
var $_gs;
function &getInstance()
{
static $instance;
if (!$instance) {
$instance = new Data();
}
return $instance;
}
function _realTransPath($file, $Id, $type='xml')
{
$s = '/';
return $_SERVER[DOCUMENT_ROOT].$s.dirname($_SERVER[SCRIPT_NAME]).$s.Data::langPath($file, $Id, $type);
}
function langPath($file, $Id, $type)
{
// $file[path] = path
// $file[base] = name
// $Id = language-Id, e.g. en-gb.english
// $type = [xml | php]
$d = '.';
$s = '/';
return $file[dir].$s.$file[base].$d.$Id.$d.$type;
}
function readTransXML2Arr($file, $Id) // read language-xml-file, return array
{
$realpath = Data::_realTransPath($file, $Id, 'xml');
if ($arr = Data::readXML2Arr($realpath)) { // read file & convert it
if (!is_array($arr[item][0]) && $arr[item]) {
// was there an item?
$arr[item][0][key] = $arr[item][key];
$arr[item][0][value] = $arr[item][value];
unset($arr[item][key]);
unset($arr[item][value]);
}
return $arr;
} else {
// seems missing|empty file -> create array with Id only
$arr = Data::convTransArr2XML(array(), $Id);
return Data::_convTransXML2Arr($arr);
}
}
function readXML2Arr($path) // read some xml-file
{
if (file_exists($path)) {
$xml = File::readAll($path);
File::rewind($path, FILE_MODE_READ); // needet if same file should be read second time
return Data::convXML2Arr($xml);
}
Error (getGS('cannot read $1', $path));
return false;
}
function writeTransXML2File($file, $xml) // write language-xml-file
{
$arr = Data::_convTransXML2Arr($xml); // get the langId from XML-data for file-naming
$Id = $arr['Id'];
$realpath = Data::_realTransPath($file, $Id, 'xml');
Data::writeXML2File($realpath, $xml); // write data to file
}
function writeXML2File($path, $xml) // write some xml-data to file
{
File::write($path, $xml, FILE_MODE_WRITE);
}
function readGSFile2Arr($file, $Id)
{
unset ($this->_gs);
$realpath = Data::_realTransPath($file, $Id, 'php');
$data = File::readAll($realpath);
$data = preg_replace('/regGS/', '$this->_regGS', $data);
eval ('?>'.$data);
return $this->_gs;
}
function _regGS($key, $value)
{
$l = count($this->_gs);
if (substr($value,strlen($value)-3)==":en"){
$value=substr($value,0,strlen($value)-3);
}
$this->_gs[$l][key] = $key;
$this->_gs[$l][value] = $value;
}
function convTransArr2XML($arr, $Id)
{
$target['Id'] = $Id; // add the Id
if ($arr[status] == 'on') {
$target[status] = 'checked';
}
if (count($arr)>1) {
foreach($arr as $key=>$val) {
if (!is_int($key)) { // clean array:
unset($arr[$key]); // delete all non-numeric keys (maybee transmitted from form)
}
}
}
$target = array_merge($target, $arr);
return Data::convArr2XML($target);
}
function convArr2XML($arr) // serialize some array to xml
{
$handle = new XML_Serializer($this->serializeoptions);
$handle->serialize($arr);
return $handle->getSerializedData();
}
function convXML2Arr($xml)
{
$handle = new XML_Unserializer($this->unserializeoptions);
$handle->unserialize($xml);
$arr = $handle->getUnserializedData();
return $arr;
}
function _convTransXML2Arr($xml)
{
$arr = Data::convXML2Arr($xml);
if (is_array($arr[item][0])) { // more than one items => done
return $arr;
} else { //else convert structure of array
$conv['Id'] = $arr['Id'];
if (is_array($arr[item])) { // was there one item => change structure
$conv[item][0][key] = $arr[item][key];
$conv[item][0][value] = $arr[item][value];
}
return $conv;
}
}
function convArr2GS($arr)
{
if (is_array($arr[item])) {
foreach ($arr[item] as $key=>$val) {
$gs[$val['key']] = $val['value'];
}
return $gs;
}
return false;
}
function checkKeys($file, $data)
{
// check if new key doesn´t already exists in local and global file
$testGS = array_flip(Data::convCharsArr($data, 1, 0, _DENY_HTML_));
$localdata = Data::readTransXML2Arr(array('base'=>_PREFIX_, 'dir'=>$file[dir]), _DEFAULT_LANG_);
$localGS = Data::convArr2GS($localdata);
$globaldata = Data::readTransXML2Arr(array('base'=>_PREFIX_GLOBAL_, 'dir'=>'..'), _DEFAULT_LANG_);
$globalGS = Data::convArr2GS($globaldata);
foreach($testGS as $key=>$val) {
if (isset($globalGS[$key])) {
$msg[err][$key] .= getGS('key "$1" already exists in $2-file', $key, 'global');
}
}
reset($testGS);
foreach($testGS as $key=>$val) {
if (isset($localGS[$key])) {
$msg[err][$key] .= getGS('key "$1" already exists in $2-file', $key, 'local');
}
}
return $msg;
}
function convStr ($str, $rmShlash, $chQuot, $html)
{
if ($rmShlash) {
$str = stripslashes($str);
}
if ($chQuot) {
$str = str_replace('"', '&#34;', $str);
}
if ($html) {
$str = htmlspecialchars($str);
}
return $str;
}
function convCharsArr ($input, $rmShlash, $chQuot, $html)
{
if (is_array ($input)) {
foreach ($input as $key=>$val) {
if (is_array ($val)) {
$arr[$key] = Data::convCharsArr ($val, $rmShlash, $chQuot, $html);
} else {
$arr[$key] = Data::convStr ($val, $rmShlash, $chQuot, $html);
}
}
return ($arr);
}
return Data::convStr ($input, $rmShlash, $chQuot, $html);
}
function saveTrans2XML($file, $data)
{
$data = Data::convCharsArr($data, 1, 0, _DENY_HTML_); // do some cleanup
$xml = Data::convTransArr2XML($data, $file['Id']);
Data::writeTransXML2File($file, $xml);
}
function addEntry2XML($file, $pos, $newKey)
{
// go throught all files matching $file[base] in $file[dir] and add entry(s)
$newKey = Data::convCharsArr($newKey, 1, 0,_DENY_HTML_); // do some cleanup
$Ids = Data::_findLangFilesIds($file);
if (!is_array($Ids)) { // no file there
$Ids[] = _DEFAULT_LANG_;
}
foreach($Ids as $lost=>$Id) {
$source = Data::readTransXML2Arr($file, $Id);
unset($target);
unset($before);
unset($after);
// split source in 2 parts
if ($pos == 'begin') {
$before = array();
$after = $source[item];
} elseif ($pos == 'end') {
$before = $source[item];
$after = array();
} elseif ($pos == 'new') {
$before = array();
$after = array();
} else {
$before = array_splice($source[item], 0, $pos+1);
$after = $source[item];
}
// build the new array
$target[status] = false;
$target['Id'] = $source['Id'];
$n = 0;
foreach($before as $nr=>$key) { // add first entrys
$target[$n]['key'] = $before[$nr]['key'];
$target[$n]['value'] = $before[$nr]['value'];
$n++;
}
foreach($newKey as $nr=>$key) { // add new entrys
if ($key<>'') {
$target[$n]['key'] = $key;
/*
if ($Id == _DEFAULT_LANG_) {
// value=key only in default language
$target[$n]['value'] = $key;
} else {
*/
$target[$n]['value'] = '';
/*
}
*/
$n++;
}
}
if (is_array($after)) {
foreach($after as $nr=>$key) { // add first entrys
$target[$n][key] = $after[$nr][key];
$target[$n][value] = $after[$nr][value];
$n++;
}
}
$xml = Data::convArr2XML($target);
$realpath = Data::_realTransPath($file, $Id, 'xml');
Data::writeXML2File($realpath, $xml);
}
echo '<script language="javascript">parent.'._MENU_FRAME_.'.location.href = "'._MENU_SCRIPT_.'";</script>';
}
function _findLangFilesIds($file)
{
$files = File_Find::mapTreeMultiple($file[dir], 1);
foreach($files as $key=>$filename) {
if (preg_match("/$file[base]\.[^.]*\.[^.]*\.xml/", $filename)) {
list($lost, $code, $name, $lost) = explode('.', $filename);
$langIds[] = $code.'.'.$name;
}
}
return $langIds;
}
function removeEntryFromXML($file, $pos)
{
// go throught all files matching $file[base] in $file[dir] and remove selected entry
$Ids = Data::_findLangFilesIds($file);
foreach($Ids as $lost=>$Id) {
$target = Data::readTransXML2Arr($file, $Id);
unset($target[item][$pos]); // remove selected entry
$xml = Data::convArr2XML($target);
$realpath = Data::_realTransPath($file, $Id, 'xml');
Data::writeXML2File($realpath, $xml);
}
}
function swapEntrysOnXML($file, $pos1, $pos2)
{
// go throught all files matching $file[base] in $file[dir] and swap selected entrys
$Ids = Data::_findLangFilesIds($file);
foreach($Ids as $lost=>$Id) {
$target = Data::readTransXML2Arr($file, $Id);
$swap[item][$pos1] = $target[item][$pos2]; // swap 2 entrys
$swap[item][$pos2] = $target[item][$pos1];
$target[item][$pos1] = $swap[item][$pos1]; // build target array
$target[item][$pos2] = $swap[item][$pos2];
$xml = Data::convArr2XML($target);
$realpath = Data::_realTransPath($file, $Id, 'xml');
Data::writeXML2File($realpath, $xml);
}
}
function searchFilesRec($startdir, $pattern, $sep)
{
$structure = File_Find::mapTreeMultiple($startdir);
foreach($structure as $dir=>$file) {
if (is_array($file)) { // it´s a directory
$filelist .= Data::searchFilesRec($startdir.'/'.$dir, $pattern, $sep);
} else { // it´s a file
if (preg_match($pattern, $file)) {
$filelist .= $sep.$startdir.'/'.$file;
}
}
}
return $filelist;
}
function createLangFilesRec($Id)
{
// go through subdirectorys and create language files for given Id
$search = '/('._PREFIX_.'|'._PREFIX_GLOBAL_.').'._DEFAULT_LANG_.'.xml/'; ## grad geändert
$sep = '|';
$replace = '/'._DEFAULT_LANG_.'.xml/';
$replacement = $Id.'.xml';
$files = Data::searchFilesRec(_START_DIR_, $search, $sep);
$files = explode($sep, $files);
foreach ($files as $pathname) {
if ($pathname) {
$base = explode('.', basename($pathname));
$file = array('base' => $base[0],
'dir' => dirname($pathname));
$arr = Data::readTransXML2Arr($file, _DEFAULT_LANG_, 0); // read the default file
$arr['Id'] = $Id;
if (is_array($arr['item'])) {
foreach($arr[item] as $key=>$val) {
unset($arr[item][$key][value]);
}
}
$handle =& Data::getInstance();
$xml = $handle->convArr2XML($arr);
$newpathname = preg_replace($replace, $replacement, $pathname);
if (!file_exists($newpathname)) {
$handle->writeXML2File($newpathname, $xml); // if file already exists -> skip
}
}
}
}
function langId2Name($id, $type='xml')
{
if ($arr = Data::readXML2Arr('./languages.xml')) {
$languages = $arr[language];
unset($arr);
}else {
return 'cannot open languages.xml<br>';
}
foreach($languages as $nr=>$lang) {
if ($lang['Id'] == $id) {
return $lang[Name];
}
}
}
function langName2Id($name, $type='xml')
{
if ($arr = Data::readXML2Arr('./languages.xml')) {
$languages = $arr[language];
unset($arr);
}else {
return 'cannot open languages.xml<br>';
}
foreach($languages as $nr=>$lang) {
if ($lang[Name] == $name) {
return $lang['Id'];
}
}
}
function getLanguages()
{
switch (_LANG_BASE_) {
case 'xml':
if ($arr = Data::readXML2Arr('./languages.xml')) {
$languages = $arr[language];
unset($arr);
}else {
return getGS('cannot read $1', 'languages.xml').'<br>';
}
break;
case 'campsite':
if ($languages = DB_Handle::readCSLang2Arr()) {
// do nothing
} else {
return getGS('cannot read $1', 'campsite.Languages').'<br>';
}
break;
}
return $languages;
}
function collectExprTPL($file)
{
$n = 0;
$filePattern = '/(.*).tpl/'; // all .php files
$functPattern1 = '/##([^#]+)##/iU'; // like getGS('edit "$1"', ...);
$sep = '|';
$filelist = explode($sep, Data::searchFilesRec($file[dir], $filePattern, $sep));
#print_r($filelist);
if (count($filelist)==0)
return FALSE;
foreach ($filelist as $name) { // read in all the files
$data = array_merge($data, file($name));
}
#print_r($data);
if (count($data)==0)
return FALSE;
foreach ($data as $line) {
if (preg_match_all($functPattern1, $line, $m)) { // collact all matches
foreach ($m[1] as $match) {
$n++;
$matches[$match] = $n;
}
}
}
if (is_array($matches)==FALSE)
return FALSE;
$matches = array_flip($matches);
asort($matches);
return $matches;
}
function collectExprPHP($file)
{
$n = 0;
$filePattern = '/(.*).php/'; // all .php files
$functPattern1 = '/tra( )*\(( )*\'([^\']*)\'/iU'; // like tra('edit "$1"', ...); '
$functPattern2 = '/tra( )*\(( )*"([^"]*)"/iU'; // like tra("edit '$1'", ...); "
$files = File_Find::mapTreeMultiple($file['dir'], 1);
foreach ($files as $name) {
if (preg_match($filePattern, $name)) {
$filelist[] = $name; // list of .php-scripts in this folder
}
}
if (count($filelist)==0)
return FALSE;
foreach ($filelist as $name) { // read in all the files
$data = array_merge($data, file($file[dir].'/'.$name));
}
if (count($data)==0)
return FALSE;
foreach ($data as $line) {
if (preg_match_all($functPattern1, $line, $m)) { // collact all matches
foreach ($m[3] as $match) {
$n++;
$matches[$match] = $n;
}
}
if (preg_match_all($functPattern2, $line, $m)) { // collact all matches
foreach ($m[3] as $match) {
$n++;
$matches[$match] = $n;
}
}
}
if (is_array($matches)==FALSE)
return FALSE;
$matches = array_flip($matches);
asort($matches);
return $matches;
}
}
?>

View file

@ -0,0 +1,453 @@
<?php
class Display {
function transForm ($source, $target, $file, $onlyUntranslated=false)
{
// creates an form for translation
// from $source to $target language
$html .= '<form name="transForm" action="'._PANEL_SCRIPT_.'" target="'._PANEL_FRAME_.'" method="post">
<table border="0">
<tr><td colspan="2">
<b>'.getGS('source:').'</b> '.Data::langPath($file, $source[Id], 'xml').'<br>
<b>'.getGS('target:').'</b> '.Data::langPath($file, $target[Id], 'xml').'<br>
<input type="hidden" name="action" value="save_translation">
<INPUT TYPE="hidden" name="dir" value="'.$file[dir].'">
<INPUT TYPE="hidden" name="base" value="'.$file[base].'">
<INPUT TYPE="hidden" name="Id" value="'.$target[Id].'">
</td></tr>
';
if ($file[Id] != _DEFAULT_LANG_) {
/*
if ($onlyUntranslated=='on') {
$checker = ' checked';
}
*/
if (!$file['sourceId']) {
$file['sourceId'] = _DEFAULT_LANG_;
}
$html .= '<tr><td colspan="2"><hr></td></tr>
<tr>
<td colspan="2">'.
Display::sourceLangMenu($file[sourceId], $file).'
<input type="submit" Value="'.getGS('ok').'">
</td>
</tr>
<tr>
<td colspan="2"> <br>
<input type="submit" name="onlyUntranslated" Value="'.getGS('show only untranslated').'">
</td>
</tr>';
}
$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 = '<FONT COLOR="red">';
$post = '</FONT>';
}
$displKey = Data::convStr($key, 0, 0, !_DENY_HTML_);
if ($onlyUntranslated && !empty($t[$key])) {
$html .= "<input name='data[$nr][key]' type='hidden' value=\"$displKey\">
<input name='data[$nr][value]' type='hidden' value=\"$insval\">";
} else {
$html .= '<tr><td colspan="2"><hr></td></tr>';
$html .= '<tr><td>';
if ($target[Id] == _DEFAULT_LANG_) {
$html .= "<b>".getGS('key:')."</b> $pre$displKey$post<BR>\n";
} else {
if ($source[item][$nr][from]) {
$html .= "<b>$source[Id]:</b> $pre".$source[item][$nr][from]."$post<BR>\n";
} else {
$html .= "<b>"._DEFAULT_LANG_.":</b> $pre$value$post<BR>\n";
}
}
$html .= "<input name='data[$nr][key]' type='hidden' value=\"$displKey\">";
$html .= "<input name='data[$nr][value]' type='text' size='50' value=\"$insval\">";
$html .= "</td><td>\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 .= '<a href="'.$mv_up_href.'" target="'._PANEL_FRAME_.'"><img src="'._ICONS_DIR_.'/button_arrow_up.gif" border="0"></a><br>'.
"<a href='$rem_href' onClick=\"return confirm('".getGS('really delete this entry?')."')\" target='"._PANEL_FRAME_."'><img src='"._ICONS_DIR_."/button_delete.gif' border='0' vspace='4'></a><br>".
'<a href="'.$mv_down_href.'" target="'._PANEL_FRAME_.'"><img src="'._ICONS_DIR_.'/button_arrow_down.gif" border="0"></a>';
}
$html .= '</td></tr>';
}
$nr++;
}
}
$html .= '<tr><td colspan="2"><hr></td></tr>
<tr>
<td>
<input type="checkbox" name="data[status]" '.$target[status].'>'.getGS('fully translated').'
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" Value="'.getGS('ok').'">
</td>
</tr>
</form>
</table>';
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').'<br>';
}
break;
case 'campsite':
if ($languages = DB_Handle::readCSLang2Arr()) {
} else {
return getGS('cannot read $1', 'campsite.Languages').'<br>';
}
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:').'
&nbsp;
<SELECT NAME="sourceId">';
$menu .= Display::_langMenuOptions($languages, $currId);
$menu .= '
</select>';
return $menu;
}
function _langMenuOptions ($languages, $currId)
{
foreach($languages as $key=>$val) {
if ($currId == $val[Id]) {
$curr = 'selected';
} else {
unset($curr);
}
$options .= "<option value='$val[Id]' $curr>$val[NativeName]</option>\n";
}
return $options;
}
function createLangMenu ($currId)
{
$languages = Data::getLanguages();
$menu .= '
<form name="selLang" action="'._MENU_SCRIPT_.'" target="'._MENU_FRAME_.'" method="post">
<input type="hidden" name="action" value="createLangFilesRec">
<SELECT NAME="Id">';
$menu .= Display::_langMenuOptions($languages, $currId);
$menu .= '
</select>
<br>
<input type="submit" value="'.getGS('create language files').'">
</form>';
return $menu;
}
function createTOLLangMenu ($currId)
{
$languages = Data::getLanguages();
$menu .= '
<form name="selTOLLang" action="'._FRAME_SCRIPT_.'" target="'._PARENT_FRAME_.'" method="post">
<SELECT NAME="TOL_Language">';
$menu .= Display::_langMenuOptions($languages, $currId);
$menu .= '
</select>
<br>
<input type="submit" value="'.getGS('choose language').'">
</form>';
return $menu;
}
function manageLangButton()
{
$html = '
<form action="'._PANEL_SCRIPT_.'" target="'._PANEL_FRAME_.'" method="post">
<input type="hidden" name="action" value="manageLanguages">
<input type="submit" value="'.getGS('manage languages').'">
</form>';
return $html;
}
function manageLangForm()
{
$languages = Data::getLanguages();
$html .= '
<table border="1">
<tr>
<th>'.getGS('name').'</th>
<th>'.getGS('native name').'</th>
<th>'.getGS('code').'</th>
<th>'.getGS('edit').'</th>
<th>'.getGS('delete').'</th>
</tr>
';
foreach($languages as $nr=>$l) {
$editLink = '<a href="'._PANEL_SCRIPT_.'?action=editLanguage&Id='.$l[Code].'.'.$l[Name].'">'.getGS('edit').'</a>';
$delLink = '<a href="'._PANEL_SCRIPT_.'?action=delLanguage&Id='.$l[Id].'">'.getGS('delete').'</a>';
$html .= "<tr><td>$l[Name]</td><td>$l[NativeName]</td><td>$l[Code]</td><th>$editLink</th><th>$delLink</th></tr>";
}
return $html;
}
function parseFolder($dirname, $depth=0)
{
$space = 2;
$structure = File_Find::mapTreeMultiple($dirname);
ksort($structure, SORT_STRING);
#print_r($structure);
if ($depth == 0) {
$html .= str_repeat(' ',$depth * $space).'<b><a href="'._PANEL_SCRIPT_.'?action=newLangFilePref&dir='.$dirname.'/'.$dir.'" target="'._PANEL_FRAME_.'">'.strtoupper(' / ')."</a></b>\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).'<b><a href="'._PANEL_SCRIPT_.'?action=newLangFilePref&dir='.$dirname.'/'.$dir.'" target="'._PANEL_FRAME_.'">'.strtoupper($dir)."</a></b>\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).'<a href="'._PANEL_SCRIPT_.'?action=translate&Id='.$Id[1].'.'.$Id[2].'&base='.$Id[0].'&dir='.$dirname.'" target="'._PANEL_FRAME_.'">'.$file."</a>\n";
}
}
}
}
if ($depth == 0) {
return "<pre>$html</pre>";
} else {
return $html;
}
}
function addEntrySelection($arr, $file)
{
$html = '
<hr>
<form action="'._PANEL_SCRIPT_.'" target="'._PANEL_FRAME_.'" method="post">
<input type="hidden" name="action" value="addEntryForm">
<input type="hidden" name="Id" value="'.$arr[Id].'">
<input type="hidden" name="base" value="'.$file[base].'">
<input type="hidden" name="dir" value="'.$file[dir].'">
'.getGS('add new fields:').' <input name="amount" value="1" size="1">
<select name="pos">
<option value="begin">'.getGS('at begin').'</option>
<option value="end">'.getGS('at end').'</option>';
if (is_array($arr[item])) {
foreach($arr[item] as $nr=>$val) {
$html .= "<option value='".$nr."'>".getGS('after').' '.cropstr($arr[item][$nr][value], 15)."</option>";
}
}
$html .= '
</select>
<input type="submit" value="'.getGS('ok').'">
</form>';
if (_MAINTAINANCE_)
$html .= '
<a href="'._PANEL_SCRIPT_.'?action=collectExpr&dir='.$file[dir].'&Id='.$arr[Id].'&base='.$file[base].'" target="'._PANEL_FRAME_.'"><input type="button" value="'.getGs('collect expressions').'"></a>
';
return $html;
}
function addEntry2XML($file, $pos, $amount)
{
// check input
if (!isInt($amount)) {
return getGS('go').' <a href="JavaScript:history.back()">'.getGS('back').'</a> '.getGS('and enter a positive integer value');
}
$html .= '
<form action="'._PANEL_SCRIPT_.'" target="'._PANEL_FRAME_.'" method="post">
<table border="0">
<input type="hidden" name="action" value="addEntry2XML">
<input type="hidden" name="Id" value="'.$file[Id].'">
<input type="hidden" name="base" value="'.$file[base].'">
<input type="hidden" name="dir" value="'.$file[dir].'">
<input type="hidden" name="pos" value="'.$pos.'">';
for($n=1; $n<=$amount; $n++) {
$html .= "<tr><td><input name='newKey[$n]' size='50'></td></tr>";
}
$html .=
'<tr><td><input type="submit" value="'.getGS('save to file').'"></td></tr>
</table>
</form>';
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).'
<form action="'._PANEL_SCRIPT_.'" target="'._PANEL_FRAME_.'" method="post">
<input type="hidden" name="action" value="newLangFileForm">
<input type="hidden" name="dir" value="'.$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:<br>
<input type="radio" name="base" value="'._PREFIX_.'"'.$locals.'>'._PREFIX_.'
<input type="radio" name="base" value="'._PREFIX_GLOBAL_.'"'.$globals.'>'._PREFIX_GLOBAL_;
}
} else {
if ($exists[_PREFIX_.'.'._DEFAULT_LANG_.'.xml']) {
return getGS('$1 file already exist in $2', _PREFIX_, strtoupper($dir));
} else {
$html .= '<input type="hidden" name="base" value="'._PREFIX_.'">';
}
}
$html .= '
<br>
'.getGS('entrys:').'<br>
<input name="amount" value="1" size="2">
<input type="submit" value="'.getGS('ok').'">
</form>';
return $html;
}
function newLangFileForm($amount, $base, $dir)
{
// check input
if (!$base) {
return getGS('go').' <a href="JavaScript:history.back()">'.getGS('back').'</a> '.getGS('and select file type');
}
if (!isInt($amount)) {
return getGS('go').' <a href="JavaScript:history.back()">'.getGS('back').'</a> '.getGS('and enter a positive integer value');
}
$html .= '
'.getGS('create new language file $1', strtoupper($dir).'/'.$base.'.'._DEFAULT_LANG_.'.xml').'
<form action="'._PANEL_SCRIPT_.'" target="'._PANEL_FRAME_.'" method="post">
<table border="0">
<input type="hidden" name="action" value="storeNewLangFile">
<input type="hidden" name="base" value="'.$base.'">
<input type="hidden" name="dir" value="'.$dir.'">';
for($n=1; $n<=$amount; $n++) {
$html .= "<tr><td><input name='newKey[$n]' size='50'></td></tr>";
}
$html .=
'<tr><td><input type="submit" value="'.getGS('save to file').'"></td></tr>
</table>
</form>';
return $html;
}
}
?>

View file

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=<?php echo _ENCODING_; ?>">
<META HTTP-EQUIV="Expires" CONTENT="now">
<link rel="stylesheet" type="text/css" href="localizer.css">
</HEAD>
<BODY>

View file

@ -0,0 +1,142 @@
<?php
function XMLtoHTML($input)
{
return "<p>".nl2br(str_replace( "\t", '&nbsp;&nbsp;&nbsp;&nbsp;', htmlentities($input)))."</p>";
}
function ArrayToHTML($input)
{
return "<p>".nl2br(str_replace(" ", "&nbsp;", print_r($input, true)))."</p>";
}
function pl($input)
{
echo "<p>$input</p>";
}
if (!function_exists('cropstr')) {
function cropStr ($input, $length, $char='')
{
if (is_numeric($length)) {
if ($char) {
if (strpos ($input, $char)) {
$len = strrpos(substr($input, 0, $length), $char);
}
} else {
$len = $length;
}
$output = substr ($input, 0, $len);
if (strlen ($input)>$len) {
$output .= "...";
}
} else {
return $input;
}
return $output;
}
}
function isInt ($in, $noZero = true)
{
if ($noZero && !($in>0)) {
return false;
}
if (preg_match('/^[0-9]*$/', $in)) {
return true;
}
return false;
}
function Error($msg)
{
$GLOBALS[error][msg] .= "<div class='error'>$msg</div>";
}
if (!function_exists('putGS')) {
function putGS($s)
{
global $gs, $TOL_Language;
$nr=func_num_args();
if (!isset($gs[$s]) || ($gs[$s]==''))
$my="$s (not translated)";
else
$my= $gs[$s];
if ($nr>1)
for ($i=1;$i<$nr;$i++){
$name='$'.$i;
$val=func_get_arg($i);
$my=str_replace($name,$val,$my);
}
echo $my;
}
}
if (!function_exists('getGS')) {
function getGS($s)
{
global $gs, $TOL_Language;
$nr=func_num_args();
if (!isset($gs[$s]) || ($gs[$s]=='') )
$my="$s (not translated)";
else
$my= $gs[$s];
if ($nr>1)
for ($i=1;$i<$nr;$i++){
$name='$'.$i;
$val=func_get_arg($i);
$my=str_replace($name,$val,$my);
}
return $my;
}
}
function loadLanguageFiles($path, $base)
{
global $gs;
if (!isset($_COOKIE['TOL_Language'])){
$_COOKIE['TOL_Language'] = Data::langName2Id(_DEFAULT_LANG_);
}
$languages = Data::getLanguages();
foreach($languages as $lang) {
if($lang['Code'] == $_COOKIE['TOL_Language']) {
$Id = $lang['Id'];
break;
}
}
$langfile[dir] = $path;
$langfile[base] = $base;
$defG = Data::readTransXML2Arr($langfile, _DEFAULT_LANG_);
$defG = Data::convArr2GS($defG);
$usrG = Data::readTransXML2Arr($langfile, $Id);
$usrG = Data::convArr2GS($usrG);
$gs = array_merge($gs, $defG, $usrG);
}
function &loadTranslations($langId)
{
## use this to load the translations for livesupport ########################
$langfile=array('dir' => '..',
'base' => 'locals');
$defG = Data::readTransXML2Arr($langfile, $langId);
$defG = Data::convArr2GS($defG);
$usrG = Data::readTransXML2Arr($langfile, $langId);
$usrG = Data::convArr2GS($usrG);
$gs = array_merge($gs, $defG, $usrG);
return $gs;
}
?>

View file

@ -0,0 +1,15 @@
<?php
require('require.inc.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<FRAMESET COLS='270,*'>
<FRAME SRC="<?php echo _MENU_SCRIPT_; ?>" name="<?php echo _MENU_FRAME_; ?>">
<FRAME SRC="<?php echo _PANEL_SCRIPT_; ?>" name="<?php echo _PANEL_FRAME_; ?>">
</FRAMESET>
</HTML>

View file

@ -0,0 +1,571 @@
<?xml version="1.0" encoding="UTF-8"?>
<codes>
<item>
<code>aa</code>
<name>Afar</name>
</item>
<item>
<code>ab</code>
<name>Abkhazian</name>
</item>
<item>
<code>af</code>
<name>Afrikaans</name>
</item>
<item>
<code>am</code>
<name>Amharic</name>
</item>
<item>
<code>ar</code>
<name>Arabic</name>
</item>
<item>
<code>as</code>
<name>Assamese</name>
</item>
<item>
<code>ay</code>
<name>Aymara</name>
</item>
<item>
<code>az</code>
<name>Azerbaijani</name>
</item>
<item>
<code>ba</code>
<name>Bashkir</name>
</item>
<item>
<code>be</code>
<name>Byelorussian</name>
</item>
<item>
<code>bg</code>
<name>Bulgarian</name>
</item>
<item>
<code>bh</code>
<name>Bihari</name>
</item>
<item>
<code>bi</code>
<name>Bislama</name>
</item>
<item>
<code>bn</code>
<name>Bengali; Bangla</name>
</item>
<item>
<code>bo</code>
<name>Tibetan</name>
</item>
<item>
<code>br</code>
<name>Breton</name>
</item>
<item>
<code>ca</code>
<name>Catalan</name>
</item>
<item>
<code>co</code>
<name>Corsican</name>
</item>
<item>
<code>cs</code>
<name>Czech</name>
</item>
<item>
<code>cy</code>
<name>Welsh</name>
</item>
<item>
<code>da</code>
<name>Danish</name>
</item>
<item>
<code>de</code>
<name>German</name>
</item>
<item>
<code>dz</code>
<name>Bhutani</name>
</item>
<item>
<code>el</code>
<name>Greek</name>
</item>
<item>
<code>en</code>
<name>English</name>
</item>
<item>
<code>eo</code>
<name>Esperanto</name>
</item>
<item>
<code>es</code>
<name>Spanish</name>
</item>
<item>
<code>et</code>
<name>Estonian</name>
</item>
<item>
<code>eu</code>
<name>Basque</name>
</item>
<item>
<code>fa</code>
<name>Persian</name>
</item>
<item>
<code>fi</code>
<name>Finnish</name>
</item>
<item>
<code>fj</code>
<name>Fiji</name>
</item>
<item>
<code>fo</code>
<name>Faeroese</name>
</item>
<item>
<code>fr</code>
<name>French</name>
</item>
<item>
<code>fy</code>
<name>Frisian</name>
</item>
<item>
<code>ga</code>
<name>Irish</name>
</item>
<item>
<code>gd</code>
<name>Scots, Gaelic</name>
</item>
<item>
<code>gl</code>
<name>Galician</name>
</item>
<item>
<code>gn</code>
<name>Guarani</name>
</item>
<item>
<code>gu</code>
<name>Gujarati</name>
</item>
<item>
<code>he</code>
<name>Hebrew</name>
</item>
<item>
<code>ha</code>
<name>Hausa</name>
</item>
<item>
<code>hi</code>
<name>Hindi</name>
</item>
<item>
<code>hr</code>
<name>Croatian</name>
</item>
<item>
<code>hu</code>
<name>Hungarian</name>
</item>
<item>
<code>hy</code>
<name>Armenian</name>
</item>
<item>
<code>ia</code>
<name>Interlingua</name>
</item>
<item>
<code>id</code>
<name>Indonesian</name>
</item>
<item>
<code>ie</code>
<name>Interlingue</name>
</item>
<item>
<code>ik</code>
<name>Inupiak</name>
</item>
<item>
<code>in</code>
<name>Indonesian</name>
</item>
<item>
<code>is</code>
<name>Icelandic</name>
</item>
<item>
<code>it</code>
<name>Italian</name>
</item>
<item>
<code>iu</code>
<name>Inuktitut</name>
</item>
<item>
<code>iw</code>
<name>Hebrew (obsolete)</name>
</item>
<item>
<code>ja</code>
<name>Japanese</name>
</item>
<item>
<code>ji</code>
<name>Yiddish (obsolete)</name>
</item>
<item>
<code>jw</code>
<name>Javanese</name>
</item>
<item>
<code>ka</code>
<name>Georgian</name>
</item>
<item>
<code>kk</code>
<name>Kazakh</name>
</item>
<item>
<code>kl</code>
<name>Greenlandic</name>
</item>
<item>
<code>km</code>
<name>Cambodian</name>
</item>
<item>
<code>kn</code>
<name>Kannada</name>
</item>
<item>
<code>ko</code>
<name>Korean</name>
</item>
<item>
<code>ks</code>
<name>Kashmiri</name>
</item>
<item>
<code>ku</code>
<name>Kurdish</name>
</item>
<item>
<code>ky</code>
<name>Kirghiz</name>
</item>
<item>
<code>la</code>
<name>Latin</name>
</item>
<item>
<code>ln</code>
<name>Lingala</name>
</item>
<item>
<code>lo</code>
<name>Laothian</name>
</item>
<item>
<code>lt</code>
<name>Lithuanian</name>
</item>
<item>
<code>lv</code>
<name>Latvian, Lettish</name>
</item>
<item>
<code>mg</code>
<name>Malagasy</name>
</item>
<item>
<code>mi</code>
<name>Maori</name>
</item>
<item>
<code>mk</code>
<name>Macedonian</name>
</item>
<item>
<code>ml</code>
<name>Malayalam</name>
</item>
<item>
<code>mn</code>
<name>Mongolian</name>
</item>
<item>
<code>mo</code>
<name>Moldavian</name>
</item>
<item>
<code>mr</code>
<name>Marathi</name>
</item>
<item>
<code>ms</code>
<name>Malay</name>
</item>
<item>
<code>mt</code>
<name>Maltese</name>
</item>
<item>
<code>my</code>
<name>Burmese</name>
</item>
<item>
<code>na</code>
<name>Nauru</name>
</item>
<item>
<code>ne</code>
<name>Nepali</name>
</item>
<item>
<code>nl</code>
<name>Dutch</name>
</item>
<item>
<code>no</code>
<name>Norwegian</name>
</item>
<item>
<code>oc</code>
<name>Occitan</name>
</item>
<item>
<code>om</code>
<name>(Afan), Oromo</name>
</item>
<item>
<code>or</code>
<name>Oriya</name>
</item>
<item>
<code>pa</code>
<name>Punjabi</name>
</item>
<item>
<code>pl</code>
<name>Polish</name>
</item>
<item>
<code>ps</code>
<name>Pashto, Pushto</name>
</item>
<item>
<code>pt</code>
<name>Portuguese</name>
</item>
<item>
<code>qu</code>
<name>Quechua</name>
</item>
<item>
<code>rm</code>
<name>Rhaeto-Romance</name>
</item>
<item>
<code>rn</code>
<name>Kirundi</name>
</item>
<item>
<code>ro</code>
<name>Romanian</name>
</item>
<item>
<code>ru</code>
<name>Russian</name>
</item>
<item>
<code>rw</code>
<name>Kinyarwanda</name>
</item>
<item>
<code>sa</code>
<name>Sanskrit</name>
</item>
<item>
<code>sd</code>
<name>Sindhi</name>
</item>
<item>
<code>sg</code>
<name>Sangro</name>
</item>
<item>
<code>sh</code>
<name>Serbo-Croatian</name>
</item>
<item>
<code>si</code>
<name>Singhalese</name>
</item>
<item>
<code>sk</code>
<name>Slovak</name>
</item>
<item>
<code>sl</code>
<name>Slovenian</name>
</item>
<item>
<code>sm</code>
<name>Samoan</name>
</item>
<item>
<code>sn</code>
<name>Shona</name>
</item>
<item>
<code>so</code>
<name>Somali</name>
</item>
<item>
<code>sq</code>
<name>Albanian</name>
</item>
<item>
<code>sr</code>
<name>Serbian</name>
</item>
<item>
<code>ss</code>
<name>Siswati</name>
</item>
<item>
<code>st</code>
<name>Sesotho</name>
</item>
<item>
<code>su</code>
<name>Sundanese</name>
</item>
<item>
<code>sv</code>
<name>Swedish</name>
</item>
<item>
<code>sw</code>
<name>Swahili</name>
</item>
<item>
<code>ta</code>
<name>Tamil</name>
</item>
<item>
<code>te</code>
<name>Tegulu</name>
</item>
<item>
<code>tg</code>
<name>Tajik</name>
</item>
<item>
<code>th</code>
<name>Thai</name>
</item>
<item>
<code>ti</code>
<name>Tigrinya</name>
</item>
<item>
<code>tk</code>
<name>Turkmen</name>
</item>
<item>
<code>tl</code>
<name>Tagalog</name>
</item>
<item>
<code>tn</code>
<name>Setswana</name>
</item>
<item>
<code>to</code>
<name>Tonga</name>
</item>
<item>
<code>tr</code>
<name>Turkish</name>
</item>
<item>
<code>ts</code>
<name>Tsonga</name>
</item>
<item>
<code>tt</code>
<name>Tatar</name>
</item>
<item>
<code>tw</code>
<name>Twi</name>
</item>
<item>
<code>ug</code>
<name>Uigur</name>
</item>
<item>
<code>uk</code>
<name>Ukrainian</name>
</item>
<item>
<code>ur</code>
<name>Urdu</name>
</item>
<item>
<code>uz</code>
<name>Uzbek</name>
</item>
<item>
<code>vi</code>
<name>Vietnamese</name>
</item>
<item>
<code>vo</code>
<name>Volapuk</name>
</item>
<item>
<code>wo</code>
<name>Wolof</name>
</item>
<item>
<code>xh</code>
<name>Xhosa</name>
</item>
<item>
<code>y</code>
<name>Yiddish</name>
</item>
<item>
<code>yo</code>
<name>Yoruba</name>
</item>
<item>
<code>za</code>
<name>Zuang</name>
</item>
<item>
<code>zh</code>
<name>Chinese</name>
</item>
<item>
<code>zu</code>
<name>Zulu</name>
</item>
</codes>

View file

@ -0,0 +1,7 @@
<?php
$f = file('languages.txt');
foreach($f as $nr=>$text) {
list($code, $name) = explode(' ', $text);
echo "<item>\n\t<code>".trim($code)."</code>\n\t<name>".trim($name)."</name>\n</item>\n";
}
?>

View file

@ -0,0 +1,142 @@
aa Afar
ab Abkhazian
af Afrikaans
am Amharic
ar Arabic
as Assamese
ay Aymara
az Azerbaijani
ba Bashkir
be Byelorussian
bg Bulgarian
bh Bihari
bi Bislama
bn Bengali; Bangla
bo Tibetan
br Breton
ca Catalan
co Corsican
cs Czech
cy Welsh
da Danish
de German
dz Bhutani
el Greek
en English
eo Esperanto
es Spanish
et Estonian
eu Basque
fa Persian
fi Finnish
fj Fiji
fo Faeroese
fr French
fy Frisian
ga Irish
gd Scots, Gaelic
gl Galician
gn Guarani
gu Gujarati
he Hebrew
ha Hausa
hi Hindi
hr Croatian
hu Hungarian
hy Armenian
ia Interlingua
id Indonesian
ie Interlingue
ik Inupiak
in Indonesian
is Icelandic
it Italian
iu Inuktitut
iw Hebrew (obsolete)
ja Japanese
ji Yiddish (obsolete)
jw Javanese
ka Georgian
kk Kazakh
kl Greenlandic
km Cambodian
kn Kannada
ko Korean
ks Kashmiri
ku Kurdish
ky Kirghiz
la Latin
ln Lingala
lo Laothian
lt Lithuanian
lv Latvian, Lettish
mg Malagasy
mi Maori
mk Macedonian
ml Malayalam
mn Mongolian
mo Moldavian
mr Marathi
ms Malay
mt Maltese
my Burmese
na Nauru
ne Nepali
nl Dutch
no Norwegian
oc Occitan
om (Afan), Oromo
or Oriya
pa Punjabi
pl Polish
ps Pashto, Pushto
pt Portuguese
qu Quechua
rm Rhaeto-Romance
rn Kirundi
ro Romanian
ru Russian
rw Kinyarwanda
sa Sanskrit
sd Sindhi
sg Sangro
sh Serbo-Croatian
si Singhalese
sk Slovak
sl Slovenian
sm Samoan
sn Shona
so Somali
sq Albanian
sr Serbian
ss Siswati
st Sesotho
su Sundanese
sv Swedish
sw Swahili
ta Tamil
te Tegulu
tg Tajik
th Thai
ti Tigrinya
tk Turkmen
tl Tagalog
tn Setswana
to Tonga
tr Turkish
ts Tsonga
tt Tatar
tw Twi
ug Uigur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
vo Volapuk
wo Wolof
xh Xhosa
y Yiddish
yo Yoruba
za Zuang
zh Chinese
zu Zulu

View file

@ -0,0 +1,28 @@
<?xml version="1.0"?>
<languages>
<language>
<Id>en.English</Id>
<Name>English(GB)</Name>
<NativeName>English</NativeName>
</language>
<language>
<Id>cz.Czech</Id>
<Name>Czech(CZ)</Name>
<NativeName>Czech</NativeName>
</language>
<language>
<Id>nl.Dutch</Id>
<Name>Dutch(NL)</Name>
<NativeName>Dutch</NativeName>
</language>
<language>
<Id>de.German</Id>
<Name>Deutsch(DE)</Name>
<NativeName>Deutsch</NativeName>
</language>
<language>
<Id>hu.Hungarian</Id>
<Name>Hungarian(HU)</Name>
<NativeName>Hungarian</NativeName>
</language>
</languages>

View file

@ -0,0 +1,47 @@
/* Body */
BODY {
margin: 10px 10px 10px 10px;
background-color : #FFFFFF ;
color : #000000;
font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333333;
}
td,tr,p,div,input,select {
font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a {
color : #FF6600;
font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
font-weight : normal;
text-decoration : none;
}
a:hover {
color : #808080;
font-size : 12px;
font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
font-weight : normal;
text-decoration : underline;
}
a:active {
color : #FFFFFF;
background-color : #FF6600;
font-size : 12px;
font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
font-weight : normal;
text-decoration : underline;
}
.error {
color : red;
font-size : 12px;
font-family: Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
font-weight : normal;
}
}

View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<Id>cz.Czech</Id>
<status>checked</status>
<item>
<key>collect expressions</key>
</item>
<item>
<key>localizer</key>
</item>
<item>
<key>$1 file already exist in $2</key>
</item>
<item>
<key>edit &quot;$1&quot;</key>
</item>
<item>
<key>edit &apos;$1&apos;</key>
</item>
<item>
<key>create new language file $1</key>
</item>
<item>
<key>create new language file in</key>
</item>
<item>
<key>delete</key>
</item>
<item>
<key>edit</key>
</item>
<item>
<key>entrys:</key>
</item>
<item>
<key>$1 and $2 files already exist in $3</key>
</item>
<item>
<key>ok</key>
</item>
<item>
<key>add new fields:</key>
</item>
<item>
<key>name</key>
</item>
<item>
<key>native name</key>
</item>
<item>
<key>code</key>
</item>
<item>
<key>source:</key>
</item>
<item>
<key>target:</key>
</item>
<item>
<key>manage languages</key>
</item>
<item>
<key>choose language</key>
</item>
<item>
<key>key:</key>
</item>
<item>
<key>cannot open $1</key>
</item>
<item>
<key>key &quot;$1&quot; already exists in $2-file</key>
</item>
<item>
<key>show only untranslated</key>
</item>
<item>
<key>cannot read $1</key>
</item>
<item>
<key>translate from:</key>
</item>
<item>
<key>really delete this entry?</key>
</item>
<item>
<key>fully translated</key>
</item>
<item>
<key>after</key>
</item>
<item>
<key>go</key>
</item>
<item>
<key>back</key>
</item>
<item>
<key>and select file type</key>
</item>
<item>
<key>and enter a positive integer value</key>
</item>
<item>
<key>save to file</key>
</item>
<item>
<key>add new language</key>
</item>
<item>
<key>create language files</key>
</item>
<item>
<key>at begin</key>
</item>
<item>
<key>at end</key>
</item>
<item>
<key>key</key>
</item>
</language>

View file

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<status />
<Id>en.English</Id>
<item>
<key>collect expressions</key>
<value />
</item>
<item>
<key>localizer</key>
<value>localizer</value>
</item>
<item>
<key>$1 file already exist in $2</key>
<value>$1 file already exist in $2</value>
</item>
<item>
<key>edit &quot;$1&quot;</key>
<value>edit &quot;$1&quot;</value>
</item>
<item>
<key>edit &apos;$1&apos;</key>
<value>edit &apos;$1&apos;</value>
</item>
<item>
<key>create new language file $1</key>
<value>create new language file $1</value>
</item>
<item>
<key>create new language file in</key>
<value>create new language file in</value>
</item>
<item>
<key>delete</key>
<value>delete</value>
</item>
<item>
<key>edit</key>
<value>edit</value>
</item>
<item>
<key>entrys:</key>
<value>entrys:</value>
</item>
<item>
<key>$1 and $2 files already exist in $3</key>
<value>$1 and $2 files already exist in $3</value>
</item>
<item>
<key>ok</key>
<value>ok</value>
</item>
<item>
<key>add new fields:</key>
<value>add new fields:</value>
</item>
<item>
<key>name</key>
<value>name</value>
</item>
<item>
<key>native name</key>
<value>native name</value>
</item>
<item>
<key>code</key>
<value>code</value>
</item>
<item>
<key>source:</key>
<value>source:</value>
</item>
<item>
<key>target:</key>
<value>target:</value>
</item>
<item>
<key>manage languages</key>
<value>manage languages</value>
</item>
<item>
<key>choose language</key>
<value>choose language</value>
</item>
<item>
<key>key:</key>
<value>key:</value>
</item>
<item>
<key>cannot open $1</key>
<value>cannot open $1</value>
</item>
<item>
<key>key &quot;$1&quot; already exists in $2-file</key>
<value>key &quot;$1&quot; already exists in $2-file</value>
</item>
<item>
<key>show only untranslated</key>
<value>show only untranslated</value>
</item>
<item>
<key>cannot read $1</key>
<value>cannot read $1</value>
</item>
<item>
<key>translate from:</key>
<value>translate from:</value>
</item>
<item>
<key>really delete this entry?</key>
<value>really delete this entry?</value>
</item>
<item>
<key>fully translated</key>
<value>completely processed</value>
</item>
<item>
<key>after</key>
<value>after</value>
</item>
<item>
<key>go</key>
<value>go</value>
</item>
<item>
<key>back</key>
<value>back</value>
</item>
<item>
<key>and select file type</key>
<value>and select file type</value>
</item>
<item>
<key>and enter a positive integer value</key>
<value>and enter a positive integer value</value>
</item>
<item>
<key>save to file</key>
<value>save to file</value>
</item>
<item>
<key>add new language</key>
<value>add new language</value>
</item>
<item>
<key>create language files</key>
<value>create language files</value>
</item>
<item>
<key>at begin</key>
<value>at begin</value>
</item>
<item>
<key>at end</key>
<value>at end</value>
</item>
<item>
<key>key</key>
<value>key</value>
</item>
</language>

View file

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<Id>en.English</Id>
<status>checked</status>
<item>
<key>collect expressions</key>
<value>collect expressions</value>
</item>
<item>
<key>localizer</key>
<value>localizer</value>
</item>
<item>
<key>$1 file already exist in $2</key>
<value>$1 file already exist in $2</value>
</item>
<item>
<key>edit &quot;$1&quot;</key>
<value>edit &quot;$1&quot;</value>
</item>
<item>
<key>edit &apos;$1&apos;</key>
<value>edit &apos;$1&apos;</value>
</item>
<item>
<key>create new language file $1</key>
<value>create new language file $1</value>
</item>
<item>
<key>create new language file in</key>
<value>create new language file in</value>
</item>
<item>
<key>delete</key>
<value>delete</value>
</item>
<item>
<key>edit</key>
<value>edit</value>
</item>
<item>
<key>entrys:</key>
<value>entrys:</value>
</item>
<item>
<key>$1 and $2 files already exist in $3</key>
<value>$1 and $2 files already exist in $3</value>
</item>
<item>
<key>ok</key>
<value>ok</value>
</item>
<item>
<key>add new fields:</key>
<value>add new fields:</value>
</item>
<item>
<key>name</key>
<value>name</value>
</item>
<item>
<key>native name</key>
<value>native name</value>
</item>
<item>
<key>code</key>
<value>code</value>
</item>
<item>
<key>source:</key>
<value>source:</value>
</item>
<item>
<key>target:</key>
<value>target:</value>
</item>
<item>
<key>manage languages</key>
<value>manage languages</value>
</item>
<item>
<key>choose language</key>
<value>choose language</value>
</item>
<item>
<key>key:</key>
<value>key:</value>
</item>
<item>
<key>cannot open $1</key>
<value>cannot open $1</value>
</item>
<item>
<key>key &quot;$1&quot; already exists in $2-file</key>
<value>key &quot;$1&quot; already exists in $2-file</value>
</item>
<item>
<key>show only untranslated</key>
<value>show only untranslated</value>
</item>
<item>
<key>cannot read $1</key>
<value>cannot read $1</value>
</item>
<item>
<key>translate from:</key>
<value>translate from:</value>
</item>
<item>
<key>really delete this entry?</key>
<value>really delete this entry?</value>
</item>
<item>
<key>fully translated</key>
<value>completely processed</value>
</item>
<item>
<key>after</key>
<value>after</value>
</item>
<item>
<key>go</key>
<value>go</value>
</item>
<item>
<key>back</key>
<value>back</value>
</item>
<item>
<key>and select file type</key>
<value>and select file type</value>
</item>
<item>
<key>and enter a positive integer value</key>
<value>and enter a positive integer value</value>
</item>
<item>
<key>save to file</key>
<value>save to file</value>
</item>
<item>
<key>add new language</key>
<value>add new language</value>
</item>
<item>
<key>create language files</key>
<value>create language files</value>
</item>
<item>
<key>at begin</key>
<value>at begin</value>
</item>
<item>
<key>at end</key>
<value>at end</value>
</item>
<item>
<key>key</key>
<value>key</value>
</item>
</language>

View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<Id>hu.Hungarian</Id>
<status>checked</status>
<item>
<key>collect expressions</key>
</item>
<item>
<key>localizer</key>
</item>
<item>
<key>$1 file already exist in $2</key>
</item>
<item>
<key>edit &quot;$1&quot;</key>
</item>
<item>
<key>edit &apos;$1&apos;</key>
</item>
<item>
<key>create new language file $1</key>
</item>
<item>
<key>create new language file in</key>
</item>
<item>
<key>delete</key>
</item>
<item>
<key>edit</key>
</item>
<item>
<key>entrys:</key>
</item>
<item>
<key>$1 and $2 files already exist in $3</key>
</item>
<item>
<key>ok</key>
</item>
<item>
<key>add new fields:</key>
</item>
<item>
<key>name</key>
</item>
<item>
<key>native name</key>
</item>
<item>
<key>code</key>
</item>
<item>
<key>source:</key>
</item>
<item>
<key>target:</key>
</item>
<item>
<key>manage languages</key>
</item>
<item>
<key>choose language</key>
</item>
<item>
<key>key:</key>
</item>
<item>
<key>cannot open $1</key>
</item>
<item>
<key>key &quot;$1&quot; already exists in $2-file</key>
</item>
<item>
<key>show only untranslated</key>
</item>
<item>
<key>cannot read $1</key>
</item>
<item>
<key>translate from:</key>
</item>
<item>
<key>really delete this entry?</key>
</item>
<item>
<key>fully translated</key>
</item>
<item>
<key>after</key>
</item>
<item>
<key>go</key>
</item>
<item>
<key>back</key>
</item>
<item>
<key>and select file type</key>
</item>
<item>
<key>and enter a positive integer value</key>
</item>
<item>
<key>save to file</key>
</item>
<item>
<key>add new language</key>
</item>
<item>
<key>create language files</key>
</item>
<item>
<key>at begin</key>
</item>
<item>
<key>at end</key>
</item>
<item>
<key>key</key>
</item>
</language>

View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<Id>nl.Dutch</Id>
<status>checked</status>
<item>
<key>collect expressions</key>
</item>
<item>
<key>localizer</key>
</item>
<item>
<key>$1 file already exist in $2</key>
</item>
<item>
<key>edit &quot;$1&quot;</key>
</item>
<item>
<key>edit &apos;$1&apos;</key>
</item>
<item>
<key>create new language file $1</key>
</item>
<item>
<key>create new language file in</key>
</item>
<item>
<key>delete</key>
</item>
<item>
<key>edit</key>
</item>
<item>
<key>entrys:</key>
</item>
<item>
<key>$1 and $2 files already exist in $3</key>
</item>
<item>
<key>ok</key>
</item>
<item>
<key>add new fields:</key>
</item>
<item>
<key>name</key>
</item>
<item>
<key>native name</key>
</item>
<item>
<key>code</key>
</item>
<item>
<key>source:</key>
</item>
<item>
<key>target:</key>
</item>
<item>
<key>manage languages</key>
</item>
<item>
<key>choose language</key>
</item>
<item>
<key>key:</key>
</item>
<item>
<key>cannot open $1</key>
</item>
<item>
<key>key &quot;$1&quot; already exists in $2-file</key>
</item>
<item>
<key>show only untranslated</key>
</item>
<item>
<key>cannot read $1</key>
</item>
<item>
<key>translate from:</key>
</item>
<item>
<key>really delete this entry?</key>
</item>
<item>
<key>fully translated</key>
</item>
<item>
<key>after</key>
</item>
<item>
<key>go</key>
</item>
<item>
<key>back</key>
</item>
<item>
<key>and select file type</key>
</item>
<item>
<key>and enter a positive integer value</key>
</item>
<item>
<key>save to file</key>
</item>
<item>
<key>add new language</key>
</item>
<item>
<key>create language files</key>
</item>
<item>
<key>at begin</key>
</item>
<item>
<key>at end</key>
</item>
<item>
<key>key</key>
</item>
</language>

View file

@ -0,0 +1,179 @@
<?php
require_once('require.inc.php');
include_once('header.html');
$data =& Data::getInstance();
loadLanguageFiles('', 'locals');
loadLanguageFiles('..', 'globals');
switch ($_REQUEST[action]) {
case 'read2gs': // read XML to array (similar to include(GS) )
$arr = $data->readTransXML2Arr($file, _DEFAULT_LANG_);
$gs = $data->convArr2GS($arr);
print_r($gs);
break;
case 'translate': // translate an xml-file
case 'save_translation':
$file = array('dir' => $_REQUEST['dir'],
'base' => $_REQUEST['base'],
'Id' => $_REQUEST['Id'],
'sourceId' => $_REQUEST[sourceId]);
if ($_REQUEST[action] == "save_translation") {
$data->saveTrans2XML($file, $_REQUEST[data]);
loadLanguageFiles('..', 'globals'); // maybee localizers expressions are changed->reload
loadLanguageFiles('', 'locals');
}
$source = $data->readTransXML2Arr($file, _DEFAULT_LANG_);
$target = $data->readTransXML2Arr($file, $_REQUEST['Id']);
if ($_REQUEST[sourceId]) { // translate from
$from = $data->readTransXML2Arr($file, $_REQUEST[sourceId]);
$source['Id'] = $from['Id'];
foreach($from[item] as $nr=>$item) {
if($item[value]) {
$source[item][$nr][from] = $item[value];
}
}
}
$output .= Display::transForm($source, $target, $file, $_REQUEST[onlyUntranslated]);
if ($_REQUEST['Id'] == _DEFAULT_LANG_) {
$output .= Display::addEntrySelection($source, $file);
}
break;
case 'addEntryForm':
$file = array('dir' => $_REQUEST['dir'],
'base' => $_REQUEST['base'],
'Id' => $_REQUEST['Id']);
$output .= Display::addEntry2XML($file, $_REQUEST['pos'], $_REQUEST['amount']);
break;
case 'addEntry2XML':
$file = array('dir' => $_REQUEST['dir'],
'base' => $_REQUEST['base'],
'Id' => _DEFAULT_LANG_);
$msg = Data::checkKeys($file, $_REQUEST[newKey]);
if ($msg[err]) {
foreach ($msg[err] as $val=>$err) {
Error($err);
while ($key = array_search($val, $_REQUEST[newKey])) {
unset($_REQUEST[newKey][$key]);
}
}
}
if (count($_REQUEST[newKey])) { // skip if all was unset above
$data->addEntry2XML($file, $_REQUEST[pos], $_REQUEST[newKey]);
}
$source = $data->readTransXML2Arr($file, _DEFAULT_LANG_);
$target = $data->readTransXML2Arr($file, $_REQUEST['Id']);
$output .= Display::transForm($source, $target, $file);
$output .= Display::addEntrySelection($source, $file);
break;
case 'removeEntryFromXML':
$file = array('dir' => $_REQUEST['dir'],
'base' => $_REQUEST['base'],
'Id' => _DEFAULT_LANG_);
$data->removeEntryFromXML($file, $_REQUEST[pos]);
$source = $data->readTransXML2Arr($file, _DEFAULT_LANG_);
$target = $data->readTransXML2Arr($file, $_REQUEST['Id']);
$output .= Display::transForm($source, $target, $file);
$output .= Display::addEntrySelection($source, $file);
break;
case 'swapEntrysOnXML':
$file = array('dir' => $_REQUEST['dir'],
'base' => $_REQUEST['base'],
'Id' => _DEFAULT_LANG_);
$data->swapEntrysOnXML($file, $_REQUEST[pos1], $_REQUEST[pos2]);
$source = $data->readTransXML2Arr($file, _DEFAULT_LANG_);
$target = $data->readTransXML2Arr($file, $_REQUEST['Id']);
$output .= Display::transForm($source, $target, $file);
$output .= Display::addEntrySelection($source, $file);
break;
case 'newLangFilePref':
$output .= Display::newLangFilePref($_REQUEST['dir'], $_REQUEST[denied]);
break;
case 'newLangFileForm':
$output .= Display::newLangFileForm($_REQUEST[amount], $_REQUEST['base'], $_REQUEST['dir']);
break;
case 'storeNewLangFile':
$file = array('dir' => $_REQUEST['dir'],
'base' => $_REQUEST['base'],
'Id' => _DEFAULT_LANG_);
$data->addEntry2XML($file, 'new', $_REQUEST[newKey]);
break;
case 'manageLanguages':
$output .= Display::manageLangForm();
break;
case 'collectExpr':
$file = array('dir' => $_REQUEST['dir'],
'base' => $_REQUEST['base'],
'Id' => _DEFAULT_LANG_);
#$newKeys = Data::collectExprPHP($file);
$newKeys = Data::collectExprTPL($file);
$msg = Data::checkKeys($file, $newKeys);
if ($msg[err]) {
foreach ($msg[err] as $val=>$err) {
#Error($err);
while ($key = array_search($val, $newKeys)) {
unset($newKeys[$key]);
}
}
}
if (count($newKeys)) { // skip if all was unset above
$data->addEntry2XML($file, 'begin', $newKeys);
}
$source = $data->readTransXML2Arr($file, _DEFAULT_LANG_);
$output .= Display::transForm($source, $source, $file);
$output .= Display::addEntrySelection($source, $file);
break;
}
echo '<h3>'.getGS('localizer').'</h3>'.$error[msg].$output;
?>
</BODY>
</HTML>

View file

@ -0,0 +1,21 @@
<?php
require_once('require.inc.php');
include_once('header.html');
loadLanguageFiles('', 'locals');
loadLanguageFiles('..', 'globals');
switch ($_REQUEST[action]) {
case 'createLangFilesRec':
Data::createLangFilesRec($_REQUEST[Id]);
break;
}
echo Display::parseFolder(_START_DIR_);
echo Display::createLangMenu($_REQUEST[Id]);
#echo Display::createTOLLangMenu($_COOKIE[TOL_Language]);
#echo Display::manageLangButton();
?>
</BODY>
</HTML>

View file

@ -0,0 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="Expires" CONTENT="now">
<link rel="stylesheet" type="text/css" href="localizer.css">
</HEAD>
<BODY>
<pre><b><a href="main.php?action=newLangFilePref&dir=../" target="panel"> / </a></b>
<a href="main.php?action=translate&Id=en.English&base=locals&dir=.." target="panel">locals.en.English.xml</a>
<a href="main.php?action=translate&Id=de.German&base=locals&dir=.." target="panel">locals.de.German.xml</a>
</pre>
</BODY>
</HTML>

View file

@ -0,0 +1,33 @@
<?php
require_once('PEAR.php');
require_once('DB.php');
require_once('File.php');
require_once('File/Find.php');
require_once('XML/Serializer.php');
require_once('XML/Unserializer.php');
require_once('display.inc.php');
require_once('data.inc.php');
require_once('helpfunctions.php');
define('_DEFAULT_LANG_', 'en.English');
define('_PREFIX_', 'locals');
define('_PREFIX_GLOBAL_','globals');
define('_LANG_BASE_', 'xml');
define('_DENY_HTML_', FALSE);
define('_ENCODING_', 'UTF-8');
define('_PARENT_FRAME_', '_parent');
define('_PANEL_FRAME_', 'panel');
define('_MENU_FRAME_', 'menu');
define('_FRAME_SCRIPT_', 'index.php');
define('_PANEL_SCRIPT_', 'main.php');
define('_ICONS_DIR_', '.icons');
define('_PREFIX_HIDE_', '.');
define('_START_DIR_', '../');
#define('_MAINTAINANCE_', TRUE);
define('_MENU_SCRIPT_', 'menu.php');
define('_MENU_SCRIPT_', 'menu_static.php');
?>

View file

@ -19,7 +19,23 @@ function errCallBack($err)
*/ */
function tra($input) function tra($input)
{ {
// just a dummy function yet ## initialize at first call of this function ###
#$GS =& $_SESSION['GS'];
static $GS;
global $uiBase;
if ($uiBase->langid && !is_array($GS)) {
#echo "load translation";
include_once dirname(__FILE__).'/localizer/require.inc.php';
$GS = loadTranslations($uiBase->langid);
}
## end init ####################################
if ($GS[$input])
$input = $GS[$input];
$nr = func_num_args(); $nr = func_num_args();
if ($nr > 1) if ($nr > 1)
for ($i = 1; $i < $nr; $i++){ for ($i = 1; $i < $nr; $i++){
@ -97,7 +113,7 @@ class uiBase
$this->sessid = $_REQUEST[$config['authCookieName']]; $this->sessid = $_REQUEST[$config['authCookieName']];
$this->userid = $this->gb->getSessUserId($this->sessid); $this->userid = $this->gb->getSessUserId($this->sessid);
$this->login = $this->gb->getSessLogin($this->sessid); $this->login = $this->gb->getSessLogin($this->sessid);
$this->langid =& $_SESSION['lanid']; $this->langid =& $_SESSION['langid'];
$this->id = $_REQUEST['id'] ? $_REQUEST['id'] : $this->gb->getObjId($this->login, $this->gb->storId); $this->id = $_REQUEST['id'] ? $_REQUEST['id'] : $this->gb->getObjId($this->login, $this->gb->storId);
$this->pid = $this->gb->getparent($this->id) != 1 ? $this->gb->getparent($this->id) : FALSE; $this->pid = $this->gb->getparent($this->id) != 1 ? $this->gb->getparent($this->id) : FALSE;

View file

@ -264,8 +264,9 @@ class uiScheduler extends uiCalendar
$datetime = strftime('%Y-%m-%dT%H:%M:%S'); $datetime = strftime('%Y-%m-%dT%H:%M:%S');
$xmldatetime = str_replace('-', '', $datetime); $xmldatetime = str_replace('-', '', $datetime);
$pl = $this->displayScheduleMethod($xmldatetime, $xmldatetime); $pl = $this->displayScheduleMethod($xmldatetime, $xmldatetime);
if(count($pl) == 0) if(!is_array($pl) || !count($pl))
return FALSE; return FALSE;
$pl = current($pl); $pl = current($pl);
$offset = strftime('%H:%M:%S', $this->_strtotime($datetime) - $this->_datetime2timestamp($pl['start']) - UI_TIMEZONEOFFSET); $offset = strftime('%H:%M:%S', $this->_strtotime($datetime) - $this->_datetime2timestamp($pl['start']) - UI_TIMEZONEOFFSET);
$clip = $this->Base->gb->displayPlaylistClipAtOffset($this->Base->sessid, $pl['playlistId'], $offset, $distance); $clip = $this->Base->gb->displayPlaylistClipAtOffset($this->Base->sessid, $pl['playlistId'], $offset, $distance);