20 include(
'WebBackend.php');
23 ?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
26 <title>TranslationMemory</title>
27 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
28 <link rel=
"stylesheet" href=
"style.css" type=
"text/css" media=
"screen" />
29 <script type=
"text/javascript" src=
"script.js"></script>
30 <script type=
"text/javascript" src=
"diff.js"></script>
41 <form action=
"WebGUI.php" method=
"post" name=
"__Form" id=
"__Form">
42 <input type=
"hidden" name=
"__Event" value=
"" id=
"__Event" />
45 <input type=
"hidden" name=
"xStringID" value=
"<?php echo $backend->xStringID ?>" id=
"xStringID" />
46 <input type=
"hidden" name=
"xProjectID" value=
"<?php echo $backend->xProjectID ?>" id=
"xProjectID" />
47 <input type=
"hidden" name=
"xActiveRootID" value=
"<?php echo $backend->xActiveRootID ?>" id=
"xActiveRootID" />
48 <input type=
"hidden" name=
"xOldLocaleID" value=
"<?php echo $backend->xOldLocaleID ?>" id=
"xOldLocaleID" />
50 <input type=
"hidden" name=
"xStringStack" value=
"<?php echo $backend->xStringStack ?>" id=
"xStringStack" />
51 <input type=
"hidden" name=
"xBrowserHelper" value=
"<?php echo $backend->xBrowserHelper ?>" id=
"xBrowserHelper" />
52 <input type=
"hidden" name=
"xDelStringID" value=
"0" id=
"xDelStringID" />
53 <input type=
"hidden" name=
"xDelProjectID" value=
"0" id=
"xDelProjectID" />
55 <!-- client side variables -->
57 <!-- Editor field changed and operation requires confirmation -->
58 <input type=
"hidden" name=
"htmlEditorChanged" value=
"0" id=
"htmlEditorChanged" />
60 <!-- Value of the stack when
this page was loaded, to mark older items -->
61 <input type=
"hidden" name=
"htmlPageLoadStack" value=
"<?php echo $backend->xStringStack ?>" id=
"htmlPageLoadStack" />
63 <!-- The English original of the current string,
for diff.js comparison -->
64 <input type=
"hidden" name=
"htmlOriginalString" value=
"<?php 65 if(!empty($backend->LocatedString)) 67 echo FixQuot($backend->LocatedString->GetOriginal()); 69 ?>" id=
"htmlOriginalString"/>
71 <table
class=
"layout"><!--
for ideal width -->
74 <!-- *** PROJECT TREE *** -->
82 if($proj->
GetID() == $backend->xProjectID)
84 $css =
" class=\"current\"";
87 echo
"<li$css><a href=\"javascript:__TriggerEvent('setproject', true, 'xProjectID','". $proj->
GetID().
"')\">";
88 echo htmlspecialchars($proj->
GetName());
100 if(!empty($backend->LocatedProjects))
102 $root = $backend->LocatedProjects[count($backend->LocatedProjects)-1];
103 if($root->GetID() != $backend->xActiveRootID) {
104 echo(
"<h1>Root switched to ".htmlspecialchars($root->GetName()).
"</h1>");
105 echo(
"<h1>Root switched to ".htmlspecialchars($root->GetName()).
"</h1>");
106 echo(
"<h1>Root switched to ".htmlspecialchars($root->GetName()).
"</h1>");
110 for($i = count($backend->LocatedProjects)-1; $i > 0; $i--)
113 $css = ($i == count($backend->LocatedProjects)-1 ?
" class=\"projecttree\"" :
"");
115 showProjectLine($backend->LocatedProjects[$i],
"t");
119 if($backend->SiblingProjects->valid())
122 if(count($backend->LocatedProjects) == 1)
124 echo
"<ul class=\"projecttree\">\n";
128 foreach($backend->SiblingProjects as $project)
130 showProjectLine($project,
"s");
133 if($project->GetID() == $backend->xProjectID) {
136 if($backend->ChildProjects->valid())
139 foreach($backend->ChildProjects as $project)
141 showProjectLine($project,
"c");
151 for($i = count($backend->LocatedProjects)-1; $i >= 0; $i--)
153 echo
"</li>\n</ul>\n";
161 <!-- *** ONE STRING EDITOR *** -->
165 if(!empty($backend->LocatedString))
168 <h1>Translation
string editor area</h1>
171 $stringIsDead = ($backend->GetProject()->GetRootID() != 0
172 && $backend->RootProjects[$backend->GetProject()->GetRootID()]->GetLastSeen() > $backend->LocatedString->GetLastSeen());
176 echo(
"<p>Dead string, not editable.</p>");
177 echo(
"<div class=\"located-dead\">");
180 <table
class=
"located">
181 <tr><th>Project Path</th>
185 if(!empty($backend->LocatedProjects))
187 for($i = count($backend->LocatedProjects)-1; $i >= 0; $i--)
191 if($i == 0 && $backend->LocatedProjects[$i]->GetName() ==
"fuzzy.xml")
193 $style =
"style=\"font-size: 25px\"";
197 echo
"<a $style href=\"javascript:__TriggerEvent('setproject', true, 'xProjectID','". $backend->LocatedProjects[$i]->GetID().
"')\">";
198 echo $backend->LocatedProjects[$i]->GetName();
207 <tr><th>Original</th>
208 <td><?php echo
FixQuot($backend->LocatedString->GetOriginal()) ?></td></tr>
209 <tr><th><u>E</u>dit translation</th>
211 $disableField = ($stringIsDead ?
"disabled=\"disabled\"" :
"");
213 if(strlen($backend->LocatedString->GetOriginal()) < 100)
215 echo
"<input spellcheck=\"true\" class=\"editshort\" type=\"text\" accesskey=\"e\" name=\"txtEditString_".$backend->xBrowserHelper.
"\" id=\"txtEditString_".$backend->xBrowserHelper.
"\" value=\"";
216 echo
FixQuot($backend->LocatedString->GetTranslation());
217 echo
"\" onchange=\"editorChanged();\" tabindex=\"1\" $disableField/>";
221 echo
"<textarea class=\"editlong\" cols=\"80\" rows=\"8\" accesskey=\"e\" name=\"txtEditString_".$backend->xBrowserHelper.
"\" id=\"txtEditString_".$backend->xBrowserHelper.
"\" onchange=\"editorChanged();\" tabindex=\"1\" $disableField>";
222 echo
FixQuot($backend->LocatedString->GetTranslation());
231 if($backend->xStringStack !=
"")
233 $stackLength = count(split(
',', $backend->xStringStack));
235 $saveDisabled =
"class=\"button-disabled\" disabled=\"disabled\"";
236 $saveEnabled =
"class=\"button\"";
242 $saveType = $saveDisabled;
243 $saveTypePop = $saveDisabled;
247 $saveType = $saveEnabled;
248 $saveTypePop = $saveEnabled;
251 if($stackLength == 0)
253 $saveTypePop = $saveDisabled;
257 <input <?php echo $saveType; ?> type=
"button" onclick=
"__TriggerEvent('savenext', false);" value=
"Save + Next" tabindex=
"2" />
258 <button <?php echo $saveType; ?> type=
"button" onclick=
"__TriggerEvent('savenextmissing', false);" tabindex=
"3" accesskey=
"s"><u>S</u>ave + Next missing</button>
259 <input <?php echo $saveType; ?> type=
"button" onclick=
"__TriggerEvent('save', false);" value=
"Save" tabindex=
"4" />
260 <!-- input
class=
"button" type=
"button" onclick=
"__TriggerEvent('previous');" value=
"Previous" />
261 <input
class=
"button" type=
"button" onclick=
"__TriggerEvent('previoumissing');" value=
"Previous missing" / -->
262 <input
class=
"button" type=
"button" onclick=
"__TriggerEvent('next', true);" value=
"Next" tabindex=
"5" />
263 <button
class=
"button" type=
"button" onclick=
"__TriggerEvent('nextmissing', true);" tabindex=
"6" accesskey=
"n" tabindex=
"6"><u>N</u>ext missing</button>
265 Stack control: <button <?php echo $saveTypePop; ?> type=
"button" onclick=
"__TriggerEvent('savepopstack', false);" tabindex=
"7" accesskey=
"p" id=
"btnSavePopStack">Save + <u>p</u>op</button>
266 <input <?php echo $saveType; ?> type=
"button" onclick=
"if(confirm('Operation will OVERWRITE all selected strings and current string!')) { __TriggerEvent('savetoallchecked', false); }" value=
"Save to all chekced" tabindex=
"8" />
271 <!-- *** STACK *** -->
275 Contents: [<span
id=
"plhStackView"></span>]
277 if(!empty($backend->LocatedString))
280 <input
class=
"codebutton" type=
"button" onclick=
"pushToStack('<?php echo($backend->LocatedString->GetStringID()); ?>');" value=
"push" tabindex=
"7" />
284 <input
class=
"codebutton" type=
"button" onclick=
"popFromStack();" value=
"pop" tabindex=
"9" />
285 <input
class=
"codebutton" type=
"button" onclick=
"clearStack();" value=
"clear" tabindex=
"10" />
289 if(!empty($backend->CurrentStrings))
293 <!-- *** CURRENT PROJECT
'S STRINGS *** --> 295 <p><a href="javascript:toggleStrings()" accesskey="t"><span class="underunder">t</span>oggle strings</a></p> 296 <div id="divStrings"> 297 <h1>Strings in the currently selected file</h1> 301 foreach($backend->CurrentStrings as $str) 303 // Draw header if not done yet 307 <table class="strings"> 308 <tr><th>Original string</th> 309 <th>Translated string</th> 314 if(!empty($backend->LocatedString) && $backend->LocatedString->GetStringID() == $str->GetStringID()) 316 echo("<tr class=\"selected\">"); 323 echo("<td class=\"string-original\">".FixQuot($str->GetOriginal())."</td>"); 324 echo("<td class=\"string-translation\">".FixQuot($str->GetTranslation())."</td>"); 325 echo("<td><a href=\"javascript:__TriggerEvent('editstring
', true, 'xStringID
','".$str->GetStringID()."');\">Edit</a>"); 328 if($backend->GetProject()->GetRootID() != 0 329 && $backend->RootProjects[$backend->GetProject()->GetRootID()]->GetLastSeen() > $str->GetLastSeen()) 332 echo("<a href=\"javascript:if(confirm('Are you sure to
delete from Translation Memory?
')) { __TriggerEvent('deletestring
', true, 'xDelStringID
', '".$str->GetStringID()."'); }\">Del</a>"); 340 // No strings for this project: "next" buttons only 342 <p>There are no strings in the current project.</p> 343 Find strings: <input class="button" type="button" onclick="__TriggerEvent('next
', true);" value="Next" /> 344 <button class="button" type="button" onclick="__TriggerEvent('nextmissing
', true);" accesskey="n"><u>N</u>ext missing</button> 347 // Deletion of empty and dead projects 348 $backend->ChildProjects->rewind(); 350 if($backend->GetProject()->GetRootID() != 0 351 && $backend->RootProjects[$backend->GetProject()->GetRootID()]->GetLastSeen() > $backend->GetProject()->GetLastSeen() 352 && !$backend->ChildProjects->valid()) 354 echo("<p>The <em>".$backend->GetProject()->GetName()."</em> is an empty and dead project. "); 355 echo("<input class=\"button\" type=\"button\" onclick=\"javascript:if(confirm('Are you sure to
delete from Translation Memory?
')) { __TriggerEvent('deleteproject
', false, 'xDelProjectID
', '". $backend->GetProject()->GetID()."'); }\" value=\"Delete project\"/></p>"); 366 $sel = " selected=\"selected\""; 367 ?> <h1>Search</h1><a name="searchresults"></a> 369 <!-- *** CUSTOM SEARCH BOX *** --> 372 <select name="ddlSearchType" id="ddlSearchType"> 373 <option value="0"<?php echo ($backend->ddlSearchType == 0 ? $sel : ""); ?>>Word index</option> 374 <option value="1"<?php echo ($backend->ddlSearchType == 1 ? $sel : ""); ?>>Part in original</option> 375 <option value="2"<?php echo ($backend->ddlSearchType == 2 ? $sel : ""); ?>>Part in translation</option> 377 <a href="javascript:clearFindText();">clear></a> 378 <input type="text" size="35" id="txtFindText" name="txtFindText" value="<?php echo FixQuot( $backend->txtFindText); ?>"> 379 <input class="button" type="button" value="Find" onclick="__TriggerEvent('find
', true);"/> 380 <!-- input class="button" type="button" value="Original"/--></p> 383 <!-- *** SEARCH RESULTS *** --> 387 // Show search results if there is any! 388 if(!empty($backend->Translations)) 392 <table class="guesses" id="tblGuesses"> 395 <th>Original string</th> 397 if(!empty($backend->LocatedString)) 399 echo("<th>alt</th>"); 402 <th>Translated string (take by click)</th> 407 $accesskeys = array("m"); // Was '1
'-'9
' but that switches tabs so only one now... https://code.google.com/p/chromium/issues/detail?id=21624 408 foreach($backend->Translations as $id => $tr) 410 foreach($tr["strings"] as $key => $str) 412 // Selected color or normal table row 413 if(!empty($backend->LocatedString) && $backend->LocatedString->GetStringID() == $str->GetStringID()) 415 echo("<tr id=\"tr_search_".$str->GetStringID()."\" class=\"selected\">"); 419 echo("<tr id=\"tr_search_".$str->GetStringID()."\">"); 422 // Find string root project for dead string checks 423 $strProject = ProjectIterator::$ProjectList[$str->GetLocaleID()][$str->GetProjectID()]; 424 $strRoot = $backend->RootProjects[$strProject->GetRootID()]; 427 echo("<td class=\"guess-checkbox\">"); 428 if($strRoot->GetLastSeen() <= $str->GetLastSeen()) 430 echo(" <input type=\"checkbox\" name=\"chkSearchSelects[]\" value=\"".$str->GetStringID()."\"/>"); 435 if($backend->ddlSearchType == 0) 437 // Exact match? (Not only 100%, word index match, but same string.) 438 if(!empty($backend->LocatedString) && $backend->LocatedString->GetOriginal() == $str->GetOriginal()) { 439 echo("<td class=\"guess-identical\">"); 444 echo("<td class=\"guess-percent\">"); 445 echo($tr["percent"]."%"); 446 echo(" <a id=\"diffLink_".$str->GetStringID()."\" href=\"javascript:diffToOriginal(".$str->GetStringID().");\">(?)</a>"); 451 echo("<td class=\"guess-percent\">"); 456 echo("<td id=\"original_".$str->GetStringID()."\" class=\"guess-original\">".FixQuot($str->GetOriginal())."</td>"); 458 // Add "Take string" link if editing one, no link otherwise 459 if(!empty($backend->LocatedString)) 462 echo("<td class=\"guess-accesskey\">"); 463 if($keyindex < count($accesskeys) && $str->GetTranslation() != "") 465 echo("<a accesskey=\"".$accesskeys[$keyindex]."\" href=\"javascript:takeTranslation(".$str->GetStringID().");\"><span class=\"underunder\">".$accesskeys[$keyindex]."</span></a>"); 470 // Translation with take link 471 echo("<td class=\"guess-translated\">"); 472 if($str->GetTranslation() != "") 474 echo("<a id=\"results_".$str->GetStringID()."\" href=\"javascript:takeTranslation(".$str->GetStringID().");\">".FixQuot($str->GetTranslation())."</a>"); 480 // Not pickable translation 481 echo("<td class=\"guess-translated\">"); 482 echo(FixQuot($str->GetTranslation())); 486 echo("<td class=\"guess-action\">"); 488 // Edit link (for dead strings too, to identify them) 489 echo("<a href=\"javascript:__TriggerEvent('editstring
', true, 'xStringID
', '".$str->GetStringID()."');\">Edit</a>"); 491 // Del link (for dead strings ) or push link otherwise 492 if($strRoot->GetLastSeen() > $str->GetLastSeen()) 494 // Plus sign and Del link 496 echo("<a href=\"javascript:if(confirm('Are you sure to
delete from Translation Memory?
')) { __TriggerEvent('deletestring
', true, 'xDelStringID
', '".$str->GetStringID()."'); }\">Del</a>"); 500 // Not dead, "push" to stack link 501 echo(" | <a href=\"javascript:pushToStack('".$str->GetStringID()."');\">push</a>"); 504 echo("<td>".$strRoot->GetName()."</td></tr>\n"); 508 if($backend->ddlSearchType != 0) 510 echo("Displayed ".count($backend->Translations)." results.<br/>"); 515 <!-- *** SEARCH REFRESH CONTROLS *** --> 517 <select name="ddlFindPercent"> 519 foreach(array(30,40,50,60,70,80,90) as $percent) 522 if($backend->ddlFindPercent == $percent) 524 $sel = " selected=\"selected\""; 526 echo "<option value=\"$percent\"$sel>> $percent%</option>"; 530 <input type="button" value="Refresh" class="button" onclick="__TriggerEvent('find
', true);"/> 531 <input type="button" value="Check all identical empty" class="button" onclick="checkGuesses(false);" /> 532 <input type="button" value="Uncheck all" class="button" onclick="checkGuesses(true);" /> 538 <div class="localeswitch"> 540 echo "<select name=\"ddlLocaleID\">\n"; 541 foreach(TranslationProject::$LocaleIDCache as $name => $id) 544 if($backend->ddlLocaleID == $id) 546 $sel = " selected=\"selected\""; 548 echo "<option value=\"$id\"$sel>$name</option>\n"; 552 <input type="button" value="Switch Locale" class="button" onclick="__TriggerEvent('setlocale
', true);"/> | 553 <!-- Root project switch --> 554 <select name="ddlActiveRoot"> 556 foreach($backend->RootProjects as $id => $rootProject) 558 $sel = ($backend->xActiveRootID == $id ? " selected=\"selected\"" : ""); 559 echo "<option value=\"$id\"$sel>".htmlspecialchars($rootProject->GetName())."</option>\n"; 563 <input type="button" value="Switch Root" class="button" onclick="__TriggerEvent('setroot
', true);"/> | 565 <?php if($CONFIG['enable_web_export
']) { ?> 566 <input type="button" value="Export language pack" class="button" onclick="__TriggerEvent('exportpack
', true);"/> | 569 <a href="http://xartm.xaraya.hu">Homepage</a> | <a href="doc/">Documentation</a> | (c) 2006-2020 Ferenc 'Lion/Kempelen
' Veres 573 <script type="text/javascript"> 575 // Clear eventhandler 576 document.getElementById('__Event
').value = ''; 577 document.getElementById('__Form
').onsubmit = __FormSubmit(); 578 STR_UNIQUE = "<?php echo $backend->xBrowserHelper ?>"; 582 <?php if(!empty($backend->LocatedString)) 585 var txtEditString = document.getElementById('txtEditString_<?php echo $backend->xBrowserHelper; ?>
'); 586 txtEditString.focus(); 593 ShowMicroTime($guiTime, "GUI");