move outer variables inside function

This commit is contained in:
Marc Delisle
2010-08-30 10:18:02 -04:00
parent 388327d642
commit b9609f086d

View File

@@ -216,9 +216,6 @@ class PMA_User_Schema
. ' AND pdf_page_number = \'' . PMA_sqlAddslashes($this->choosenPage) . '\'';
$page_rs = PMA_query_as_controluser($page_query, FALSE, $query_default_option);
$array_sh_page = array();
$draginit = '';
$reset_draginit = '';
$i = 0;
while ($temp_sh_page = @PMA_DBI_fetch_assoc($page_rs)) {
$array_sh_page[] = $temp_sh_page;
}
@@ -229,7 +226,7 @@ class PMA_User_Schema
if (!isset($_POST['with_field_names']) && !isset($_POST['showwysiwyg'])) {
$with_field_names = TRUE;
}
$this->_displayScratchboardTables($array_sh_page,$draginit,$reset_draginit);
$this->_displayScratchboardTables($array_sh_page);
?>
<form method="post" action="schema_edit.php" name="edcoord">
@@ -464,7 +461,7 @@ class PMA_User_Schema
* @return void
* @access private
*/
private function _displayScratchboardTables($array_sh_page,$draginit,$reset_draginit)
private function _displayScratchboardTables($array_sh_page)
{
global $with_field_names,$cfg,$db;
?>
@@ -475,12 +472,15 @@ class PMA_User_Schema
</form>
<div id="pdflayout" class="pdflayout" style="visibility: hidden;">
<?php
$draginit = '';
$draginit2 = '';
$reset_draginit = '';
$i = 0;
foreach ($array_sh_page as $key => $temp_sh_page) {
$drag_x = $temp_sh_page['x'];
$drag_y = $temp_sh_page['y'];
$draginit2 = ' Drag.init(getElement("table_' . $i . '"), null, 0, parseInt(myid.style.width)-2, 0, parseInt(myid.style.height)-5);' . "\n";
$draginit2 .= ' Drag.init(getElement("table_' . $i . '"), null, 0, parseInt(myid.style.width)-2, 0, parseInt(myid.style.height)-5);' . "\n";
$draginit .= ' getElement("table_' . $i . '").onDrag = function (x, y) { document.edcoord.elements["c_table_' . $i . '[x]"].value = parseInt(x); document.edcoord.elements["c_table_' . $i . '[y]"].value = parseInt(y) }' . "\n";
$draginit .= ' getElement("table_' . $i . '").style.left = "' . $drag_x . 'px";' . "\n";
$draginit .= ' getElement("table_' . $i . '").style.top = "' . $drag_y . 'px";' . "\n";