From 90e0ffe7dab26c6d6fa9ffe944ff14b08786e8a8 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Fri, 25 Jan 2013 16:43:59 +0100 Subject: [PATCH 1/4] fix undefined variable --- tbl_relation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbl_relation.php b/tbl_relation.php index 6894e6a12b..13b027a760 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -540,7 +540,7 @@ function PMA_generateDropdown( $dropdown_question, $select_name, $choices, $selected_value ) { - $html_output .= htmlspecialchars($dropdown_question) . '  ' + $html_output = htmlspecialchars($dropdown_question) . '  ' . '' . "\n"; @@ -553,7 +552,6 @@ function PMA_generateDropdown( $html_output .= '' . "\n"; return $html_output; - } /** @@ -561,9 +559,9 @@ function PMA_generateDropdown( * * @param string $text original string * - * @return array containing the elements (and their surrounding backquotes) + * @return array containing the elements (and their surrounding backquotes) * - * @access public + * @access public */ function PMA_backquoteSplit($text) { @@ -588,5 +586,4 @@ function PMA_backquoteSplit($text) } return($elements); } - ?> From 92fd7acf7907e8d3203aeacba781d8ea030471b2 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Fri, 25 Jan 2013 16:48:35 +0100 Subject: [PATCH 3/4] improve docblock --- tbl_relation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tbl_relation.php b/tbl_relation.php index 53cc6a0b7c..2ee51f4d0c 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -532,7 +532,7 @@ PMA_Response::getInstance()->addHTML($html_output); * @param array $choices Choices for dropdown * @param string $selected_value Selected value * - * @return string $html_output The html code for existing value (for selected) + * @return string The html code for existing value (for selected) * * @access public */ From 4f992927c2358b40e8728190072fa5b7e011c888 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Fri, 25 Jan 2013 17:13:52 +0100 Subject: [PATCH 4/4] define private variable _tables --- .../schema/Visio_Relation_Schema.class.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/schema/Visio_Relation_Schema.class.php b/libraries/schema/Visio_Relation_Schema.class.php index 4bdc8d414e..cc0573fd86 100644 --- a/libraries/schema/Visio_Relation_Schema.class.php +++ b/libraries/schema/Visio_Relation_Schema.class.php @@ -178,6 +178,7 @@ class Table_Stats * Defines properties */ + private $_tables; private $_tableName; private $_showInfo = false; @@ -541,8 +542,8 @@ class PMA_Visio_Relation_Schema extends PMA_Export_Relation_Schema $alltables = $this->getAllTables($db, $this->pageNumber); foreach ($alltables as $table) { - if (! isset($this->tables[$table])) { - $this->tables[$table] = new Table_Stats($table, $this->pageNumber, $this->showKeys); + if (! isset($this->_tables[$table])) { + $this->_tables[$table] = new Table_Stats($table, $this->pageNumber, $this->showKeys); } } @@ -594,19 +595,19 @@ class PMA_Visio_Relation_Schema extends PMA_Export_Relation_Schema */ private function _addRelation($masterTable, $masterField, $foreignTable, $foreignField, $showKeys) { - if (! isset($this->tables[$masterTable])) { - $this->tables[$masterTable] = new Table_Stats( + if (! isset($this->_tables[$masterTable])) { + $this->_tables[$masterTable] = new Table_Stats( $masterTable, $this->pageNumber, $showKeys ); } - if (! isset($this->tables[$foreignTable])) { - $this->tables[$foreignTable] = new Table_Stats( + if (! isset($this->_tables[$foreignTable])) { + $this->_tables[$foreignTable] = new Table_Stats( $foreignTable, $this->pageNumber, $showKeys ); } $this->_relations[] = new Relation_Stats( - $this->tables[$masterTable], $masterField, - $this->tables[$foreignTable], $foreignField + $this->_tables[$masterTable], $masterField, + $this->_tables[$foreignTable], $foreignField ); } @@ -638,7 +639,7 @@ class PMA_Visio_Relation_Schema extends PMA_Export_Relation_Schema */ private function _drawTables($changeColor) { - foreach ($this->tables as $table) { + foreach ($this->_tables as $table) { $table->tableDraw($changeColor); } }