|
@@ 5453-5533 (lines=81) @@
|
| 5450 |
|
} |
| 5451 |
|
|
| 5452 |
|
// Template for the UTF-8 conversion step. Basically a copy of the backup stuff with slight modifications.... |
| 5453 |
|
function template_convert_utf8() |
| 5454 |
|
{ |
| 5455 |
|
global $upcontext, $support_js, $is_debug; |
| 5456 |
|
|
| 5457 |
|
echo ' |
| 5458 |
|
<h3>Please wait while your database is converted to UTF-8. For large forums this may take some time!</h3>'; |
| 5459 |
|
|
| 5460 |
|
echo ' |
| 5461 |
|
<form action="', $upcontext['form_url'], '" name="upform" id="upform" method="post"> |
| 5462 |
|
<input type="hidden" name="utf8_done" id="utf8_done" value="0"> |
| 5463 |
|
<strong>Completed <span id="tab_done">', $upcontext['cur_table_num'], '</span> out of ', $upcontext['table_count'], ' tables.</strong> |
| 5464 |
|
<span id="debuginfo"></span>'; |
| 5465 |
|
|
| 5466 |
|
// Done any tables so far? |
| 5467 |
|
if (!empty($upcontext['previous_tables'])) |
| 5468 |
|
foreach ($upcontext['previous_tables'] as $table) |
| 5469 |
|
echo ' |
| 5470 |
|
<br>Completed Table: "', $table, '".'; |
| 5471 |
|
|
| 5472 |
|
echo ' |
| 5473 |
|
<h3 id="current_tab_div">Current Table: "<span id="current_table">', $upcontext['cur_table_name'], '</span>"</h3>'; |
| 5474 |
|
|
| 5475 |
|
// If we dropped their index, let's let them know |
| 5476 |
|
if ($upcontext['cur_table_num'] == $upcontext['table_count'] && $upcontext['dropping_index']) |
| 5477 |
|
echo ' |
| 5478 |
|
<br><span style="display:inline;">Please note that your fulltext index was dropped to facilitate the conversion and will need to be recreated.</span>'; |
| 5479 |
|
|
| 5480 |
|
echo ' |
| 5481 |
|
<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>'; |
| 5482 |
|
|
| 5483 |
|
// Continue please! |
| 5484 |
|
$upcontext['continue'] = $support_js ? 2 : 1; |
| 5485 |
|
|
| 5486 |
|
// If javascript allows we want to do this using XML. |
| 5487 |
|
if ($support_js) |
| 5488 |
|
{ |
| 5489 |
|
echo ' |
| 5490 |
|
<script> |
| 5491 |
|
var lastTable = ', $upcontext['cur_table_num'], '; |
| 5492 |
|
function getNextTables() |
| 5493 |
|
{ |
| 5494 |
|
getXMLDocument(\'', $upcontext['form_url'], '&xml&substep=\' + lastTable, onBackupUpdate); |
| 5495 |
|
} |
| 5496 |
|
|
| 5497 |
|
// Got an update! |
| 5498 |
|
function onBackupUpdate(oXMLDoc) |
| 5499 |
|
{ |
| 5500 |
|
var sCurrentTableName = ""; |
| 5501 |
|
var iTableNum = 0; |
| 5502 |
|
var sCompletedTableName = getInnerHTML(document.getElementById(\'current_table\')); |
| 5503 |
|
for (var i = 0; i < oXMLDoc.getElementsByTagName("table")[0].childNodes.length; i++) |
| 5504 |
|
sCurrentTableName += oXMLDoc.getElementsByTagName("table")[0].childNodes[i].nodeValue; |
| 5505 |
|
iTableNum = oXMLDoc.getElementsByTagName("table")[0].getAttribute("num"); |
| 5506 |
|
|
| 5507 |
|
// Update the page. |
| 5508 |
|
setInnerHTML(document.getElementById(\'tab_done\'), iTableNum); |
| 5509 |
|
setInnerHTML(document.getElementById(\'current_table\'), sCurrentTableName); |
| 5510 |
|
lastTable = iTableNum; |
| 5511 |
|
updateStepProgress(iTableNum, ', $upcontext['table_count'], ', ', $upcontext['step_weight'] * ((100 - $upcontext['step_progress']) / 100), ');'; |
| 5512 |
|
|
| 5513 |
|
// If debug flood the screen. |
| 5514 |
|
if ($is_debug) |
| 5515 |
|
echo ' |
| 5516 |
|
setOuterHTML(document.getElementById(\'debuginfo\'), \'<br>Completed Table: "\' + sCompletedTableName + \'".<span id="debuginfo"><\' + \'/span>\');'; |
| 5517 |
|
|
| 5518 |
|
echo ' |
| 5519 |
|
// Get the next update... |
| 5520 |
|
if (iTableNum == ', $upcontext['table_count'], ') |
| 5521 |
|
{ |
| 5522 |
|
document.getElementById(\'commess\').style.display = ""; |
| 5523 |
|
document.getElementById(\'current_tab_div\').style.display = "none"; |
| 5524 |
|
document.getElementById(\'contbutt\').disabled = 0; |
| 5525 |
|
document.getElementById(\'utf8_done\').value = 1; |
| 5526 |
|
} |
| 5527 |
|
else |
| 5528 |
|
getNextTables(); |
| 5529 |
|
} |
| 5530 |
|
getNextTables(); |
| 5531 |
|
</script>'; |
| 5532 |
|
} |
| 5533 |
|
} |
| 5534 |
|
|
| 5535 |
|
function template_utf8_xml() |
| 5536 |
|
{ |
|
@@ 5727-5805 (lines=79) @@
|
| 5724 |
|
} |
| 5725 |
|
|
| 5726 |
|
// Template for the database backup tool/ |
| 5727 |
|
function template_serialize_json() |
| 5728 |
|
{ |
| 5729 |
|
global $upcontext, $support_js, $is_debug; |
| 5730 |
|
|
| 5731 |
|
echo ' |
| 5732 |
|
<h3>Converting data from serialize to JSON...</h3>'; |
| 5733 |
|
|
| 5734 |
|
echo ' |
| 5735 |
|
<form action="', $upcontext['form_url'], '" name="upform" id="upform" method="post"> |
| 5736 |
|
<input type="hidden" name="json_done" id="json_done" value="0"> |
| 5737 |
|
<strong>Completed <span id="tab_done">', $upcontext['cur_table_num'], '</span> out of ', $upcontext['table_count'], ' tables.</strong> |
| 5738 |
|
<span id="debuginfo"></span>'; |
| 5739 |
|
|
| 5740 |
|
// Dont any tables so far? |
| 5741 |
|
if (!empty($upcontext['previous_tables'])) |
| 5742 |
|
foreach ($upcontext['previous_tables'] as $table) |
| 5743 |
|
echo ' |
| 5744 |
|
<br>Completed Table: "', $table, '".'; |
| 5745 |
|
|
| 5746 |
|
echo ' |
| 5747 |
|
<h3 id="current_tab_div">Current Table: "<span id="current_table">', $upcontext['cur_table_name'], '</span>"</h3> |
| 5748 |
|
<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>'; |
| 5749 |
|
|
| 5750 |
|
// Try to make sure substep was reset. |
| 5751 |
|
if ($upcontext['cur_table_num'] == $upcontext['table_count']) |
| 5752 |
|
echo ' |
| 5753 |
|
<input type="hidden" name="substep" id="substep" value="0">'; |
| 5754 |
|
|
| 5755 |
|
// Continue please! |
| 5756 |
|
$upcontext['continue'] = $support_js ? 2 : 1; |
| 5757 |
|
|
| 5758 |
|
// If javascript allows we want to do this using XML. |
| 5759 |
|
if ($support_js) |
| 5760 |
|
{ |
| 5761 |
|
echo ' |
| 5762 |
|
<script> |
| 5763 |
|
var lastTable = ', $upcontext['cur_table_num'], '; |
| 5764 |
|
function getNextTables() |
| 5765 |
|
{ |
| 5766 |
|
getXMLDocument(\'', $upcontext['form_url'], '&xml&substep=\' + lastTable, onBackupUpdate); |
| 5767 |
|
} |
| 5768 |
|
|
| 5769 |
|
// Got an update! |
| 5770 |
|
function onBackupUpdate(oXMLDoc) |
| 5771 |
|
{ |
| 5772 |
|
var sCurrentTableName = ""; |
| 5773 |
|
var iTableNum = 0; |
| 5774 |
|
var sCompletedTableName = getInnerHTML(document.getElementById(\'current_table\')); |
| 5775 |
|
for (var i = 0; i < oXMLDoc.getElementsByTagName("table")[0].childNodes.length; i++) |
| 5776 |
|
sCurrentTableName += oXMLDoc.getElementsByTagName("table")[0].childNodes[i].nodeValue; |
| 5777 |
|
iTableNum = oXMLDoc.getElementsByTagName("table")[0].getAttribute("num"); |
| 5778 |
|
|
| 5779 |
|
// Update the page. |
| 5780 |
|
setInnerHTML(document.getElementById(\'tab_done\'), iTableNum); |
| 5781 |
|
setInnerHTML(document.getElementById(\'current_table\'), sCurrentTableName); |
| 5782 |
|
lastTable = iTableNum; |
| 5783 |
|
updateStepProgress(iTableNum, ', $upcontext['table_count'], ', ', $upcontext['step_weight'] * ((100 - $upcontext['step_progress']) / 100), ');'; |
| 5784 |
|
|
| 5785 |
|
// If debug flood the screen. |
| 5786 |
|
if ($is_debug) |
| 5787 |
|
echo ' |
| 5788 |
|
setOuterHTML(document.getElementById(\'debuginfo\'), \'<br>Completed Table: "\' + sCompletedTableName + \'".<span id="debuginfo"><\' + \'/span>\');'; |
| 5789 |
|
|
| 5790 |
|
echo ' |
| 5791 |
|
// Get the next update... |
| 5792 |
|
if (iTableNum == ', $upcontext['table_count'], ') |
| 5793 |
|
{ |
| 5794 |
|
document.getElementById(\'commess\').style.display = ""; |
| 5795 |
|
document.getElementById(\'current_tab_div\').style.display = "none"; |
| 5796 |
|
document.getElementById(\'contbutt\').disabled = 0; |
| 5797 |
|
document.getElementById(\'json_done\').value = 1; |
| 5798 |
|
} |
| 5799 |
|
else |
| 5800 |
|
getNextTables(); |
| 5801 |
|
} |
| 5802 |
|
getNextTables(); |
| 5803 |
|
</script>'; |
| 5804 |
|
} |
| 5805 |
|
} |
| 5806 |
|
|
| 5807 |
|
function template_serialize_json_xml() |
| 5808 |
|
{ |