|
@@ 4322-4408 (lines=87) @@
|
| 4319 |
|
} |
| 4320 |
|
|
| 4321 |
|
// Template for the UTF-8 conversion step. Basically a copy of the backup stuff with slight modifications.... |
| 4322 |
|
function template_convert_utf8() |
| 4323 |
|
{ |
| 4324 |
|
global $upcontext, $support_js, $is_debug; |
| 4325 |
|
|
| 4326 |
|
echo ' |
| 4327 |
|
<h3>Please wait while your database is converted to UTF-8. For large forums this may take some time!</h3>'; |
| 4328 |
|
|
| 4329 |
|
echo ' |
| 4330 |
|
<form action="', $upcontext['form_url'], '" name="upform" id="upform" method="post"> |
| 4331 |
|
<input type="hidden" name="utf8_done" id="utf8_done" value="0"> |
| 4332 |
|
<strong>Completed <span id="tab_done">', $upcontext['cur_table_num'], '</span> out of ', $upcontext['table_count'], ' tables.</strong> |
| 4333 |
|
<div id="debug_section" style="height: ', ($is_debug ? '195' : '12') , 'px; overflow: auto;"> |
| 4334 |
|
<span id="debuginfo"></span> |
| 4335 |
|
</div>'; |
| 4336 |
|
|
| 4337 |
|
// Done any tables so far? |
| 4338 |
|
if (!empty($upcontext['previous_tables'])) |
| 4339 |
|
foreach ($upcontext['previous_tables'] as $table) |
| 4340 |
|
echo ' |
| 4341 |
|
<br>Completed Table: "', $table, '".'; |
| 4342 |
|
|
| 4343 |
|
echo ' |
| 4344 |
|
<h3 id="current_tab_div">Current Table: "<span id="current_table">', $upcontext['cur_table_name'], '</span>"</h3>'; |
| 4345 |
|
|
| 4346 |
|
// If we dropped their index, let's let them know |
| 4347 |
|
if ($upcontext['cur_table_num'] == $upcontext['table_count'] && $upcontext['dropping_index']) |
| 4348 |
|
echo ' |
| 4349 |
|
<br><span style="display:inline;">Please note that your fulltext index was dropped to facilitate the conversion and will need to be recreated.</span>'; |
| 4350 |
|
|
| 4351 |
|
echo ' |
| 4352 |
|
<br><span id="commess" style="font-weight: bold; display: ', $upcontext['cur_table_num'] == $upcontext['table_count'] ? 'inline' : 'none', ';">Conversion Complete! Click Continue to Proceed.</span>'; |
| 4353 |
|
|
| 4354 |
|
// Continue please! |
| 4355 |
|
$upcontext['continue'] = $support_js ? 2 : 1; |
| 4356 |
|
|
| 4357 |
|
// If javascript allows we want to do this using XML. |
| 4358 |
|
if ($support_js) |
| 4359 |
|
{ |
| 4360 |
|
echo ' |
| 4361 |
|
<script> |
| 4362 |
|
var lastTable = ', $upcontext['cur_table_num'], '; |
| 4363 |
|
function getNextTables() |
| 4364 |
|
{ |
| 4365 |
|
getXMLDocument(\'', $upcontext['form_url'], '&xml&substep=\' + lastTable, onConversionUpdate); |
| 4366 |
|
} |
| 4367 |
|
|
| 4368 |
|
// Got an update! |
| 4369 |
|
function onConversionUpdate(oXMLDoc) |
| 4370 |
|
{ |
| 4371 |
|
var sCurrentTableName = ""; |
| 4372 |
|
var iTableNum = 0; |
| 4373 |
|
var sCompletedTableName = getInnerHTML(document.getElementById(\'current_table\')); |
| 4374 |
|
for (var i = 0; i < oXMLDoc.getElementsByTagName("table")[0].childNodes.length; i++) |
| 4375 |
|
sCurrentTableName += oXMLDoc.getElementsByTagName("table")[0].childNodes[i].nodeValue; |
| 4376 |
|
iTableNum = oXMLDoc.getElementsByTagName("table")[0].getAttribute("num"); |
| 4377 |
|
|
| 4378 |
|
// Update the page. |
| 4379 |
|
setInnerHTML(document.getElementById(\'tab_done\'), iTableNum); |
| 4380 |
|
setInnerHTML(document.getElementById(\'current_table\'), sCurrentTableName); |
| 4381 |
|
lastTable = iTableNum; |
| 4382 |
|
updateStepProgress(iTableNum, ', $upcontext['table_count'], ', ', $upcontext['step_weight'] * ((100 - $upcontext['step_progress']) / 100), ');'; |
| 4383 |
|
|
| 4384 |
|
// If debug flood the screen. |
| 4385 |
|
if ($is_debug) |
| 4386 |
|
echo ' |
| 4387 |
|
setOuterHTML(document.getElementById(\'debuginfo\'), \'<br>Completed Table: "\' + sCompletedTableName + \'".<span id="debuginfo"><\' + \'/span>\'); |
| 4388 |
|
|
| 4389 |
|
if (document.getElementById(\'debug_section\').scrollHeight) |
| 4390 |
|
document.getElementById(\'debug_section\').scrollTop = document.getElementById(\'debug_section\').scrollHeight'; |
| 4391 |
|
|
| 4392 |
|
echo ' |
| 4393 |
|
// Get the next update... |
| 4394 |
|
if (iTableNum == ', $upcontext['table_count'], ') |
| 4395 |
|
{ |
| 4396 |
|
document.getElementById(\'commess\').style.display = ""; |
| 4397 |
|
document.getElementById(\'current_tab_div\').style.display = "none"; |
| 4398 |
|
document.getElementById(\'contbutt\').disabled = 0; |
| 4399 |
|
document.getElementById(\'utf8_done\').value = 1; |
| 4400 |
|
} |
| 4401 |
|
else |
| 4402 |
|
getNextTables(); |
| 4403 |
|
} |
| 4404 |
|
getNextTables(); |
| 4405 |
|
//# sourceURL=dynamicScript-conv.js |
| 4406 |
|
</script>'; |
| 4407 |
|
} |
| 4408 |
|
} |
| 4409 |
|
|
| 4410 |
|
function template_convert_xml() |
| 4411 |
|
{ |
|
@@ 4419-4503 (lines=85) @@
|
| 4416 |
|
} |
| 4417 |
|
|
| 4418 |
|
// Template for the database backup tool/ |
| 4419 |
|
function template_serialize_json() |
| 4420 |
|
{ |
| 4421 |
|
global $upcontext, $support_js, $is_debug; |
| 4422 |
|
|
| 4423 |
|
echo ' |
| 4424 |
|
<h3>Converting data from serialize to JSON...</h3>'; |
| 4425 |
|
|
| 4426 |
|
echo ' |
| 4427 |
|
<form action="', $upcontext['form_url'], '" name="upform" id="upform" method="post"> |
| 4428 |
|
<input type="hidden" name="json_done" id="json_done" value="0"> |
| 4429 |
|
<strong>Completed <span id="tab_done">', $upcontext['cur_table_num'], '</span> out of ', $upcontext['table_count'], ' tables.</strong> |
| 4430 |
|
<div id="debug_section" style="height: ', ($is_debug ? '195' : '12') , 'px; overflow: auto;"> |
| 4431 |
|
<span id="debuginfo"></span> |
| 4432 |
|
</div>'; |
| 4433 |
|
|
| 4434 |
|
// Dont any tables so far? |
| 4435 |
|
if (!empty($upcontext['previous_tables'])) |
| 4436 |
|
foreach ($upcontext['previous_tables'] as $table) |
| 4437 |
|
echo ' |
| 4438 |
|
<br>Completed Table: "', $table, '".'; |
| 4439 |
|
|
| 4440 |
|
echo ' |
| 4441 |
|
<h3 id="current_tab_div">Current Table: "<span id="current_table">', $upcontext['cur_table_name'], '</span>"</h3> |
| 4442 |
|
<br><span id="commess" style="font-weight: bold; display: ', $upcontext['cur_table_num'] == $upcontext['table_count'] ? 'inline' : 'none', ';">Convert to JSON Complete! Click Continue to Proceed.</span>'; |
| 4443 |
|
|
| 4444 |
|
// Try to make sure substep was reset. |
| 4445 |
|
if ($upcontext['cur_table_num'] == $upcontext['table_count']) |
| 4446 |
|
echo ' |
| 4447 |
|
<input type="hidden" name="substep" id="substep" value="0">'; |
| 4448 |
|
|
| 4449 |
|
// Continue please! |
| 4450 |
|
$upcontext['continue'] = $support_js ? 2 : 1; |
| 4451 |
|
|
| 4452 |
|
// If javascript allows we want to do this using XML. |
| 4453 |
|
if ($support_js) |
| 4454 |
|
{ |
| 4455 |
|
echo ' |
| 4456 |
|
<script> |
| 4457 |
|
var lastTable = ', $upcontext['cur_table_num'], '; |
| 4458 |
|
function getNextTables() |
| 4459 |
|
{ |
| 4460 |
|
getXMLDocument(\'', $upcontext['form_url'], '&xml&substep=\' + lastTable, onBackupUpdate); |
| 4461 |
|
} |
| 4462 |
|
|
| 4463 |
|
// Got an update! |
| 4464 |
|
function onBackupUpdate(oXMLDoc) |
| 4465 |
|
{ |
| 4466 |
|
var sCurrentTableName = ""; |
| 4467 |
|
var iTableNum = 0; |
| 4468 |
|
var sCompletedTableName = getInnerHTML(document.getElementById(\'current_table\')); |
| 4469 |
|
for (var i = 0; i < oXMLDoc.getElementsByTagName("table")[0].childNodes.length; i++) |
| 4470 |
|
sCurrentTableName += oXMLDoc.getElementsByTagName("table")[0].childNodes[i].nodeValue; |
| 4471 |
|
iTableNum = oXMLDoc.getElementsByTagName("table")[0].getAttribute("num"); |
| 4472 |
|
|
| 4473 |
|
// Update the page. |
| 4474 |
|
setInnerHTML(document.getElementById(\'tab_done\'), iTableNum); |
| 4475 |
|
setInnerHTML(document.getElementById(\'current_table\'), sCurrentTableName); |
| 4476 |
|
lastTable = iTableNum; |
| 4477 |
|
updateStepProgress(iTableNum, ', $upcontext['table_count'], ', ', $upcontext['step_weight'] * ((100 - $upcontext['step_progress']) / 100), ');'; |
| 4478 |
|
|
| 4479 |
|
// If debug flood the screen. |
| 4480 |
|
if ($is_debug) |
| 4481 |
|
echo ' |
| 4482 |
|
setOuterHTML(document.getElementById(\'debuginfo\'), \'<br>Completed Table: "\' + sCompletedTableName + \'".<span id="debuginfo"><\' + \'/span>\'); |
| 4483 |
|
|
| 4484 |
|
if (document.getElementById(\'debug_section\').scrollHeight) |
| 4485 |
|
document.getElementById(\'debug_section\').scrollTop = document.getElementById(\'debug_section\').scrollHeight'; |
| 4486 |
|
|
| 4487 |
|
echo ' |
| 4488 |
|
// Get the next update... |
| 4489 |
|
if (iTableNum == ', $upcontext['table_count'], ') |
| 4490 |
|
{ |
| 4491 |
|
document.getElementById(\'commess\').style.display = ""; |
| 4492 |
|
document.getElementById(\'current_tab_div\').style.display = "none"; |
| 4493 |
|
document.getElementById(\'contbutt\').disabled = 0; |
| 4494 |
|
document.getElementById(\'json_done\').value = 1; |
| 4495 |
|
} |
| 4496 |
|
else |
| 4497 |
|
getNextTables(); |
| 4498 |
|
} |
| 4499 |
|
getNextTables(); |
| 4500 |
|
//# sourceURL=dynamicScript-json.js |
| 4501 |
|
</script>'; |
| 4502 |
|
} |
| 4503 |
|
} |
| 4504 |
|
|
| 4505 |
|
function template_serialize_json_xml() |
| 4506 |
|
{ |