diff --git a/libraries/navigation/Nodes/Node_DatabaseChild.class.php b/libraries/navigation/Nodes/Node_DatabaseChild.class.php
new file mode 100644
index 0000000000..e080e4ab37
--- /dev/null
+++ b/libraries/navigation/Nodes/Node_DatabaseChild.class.php
@@ -0,0 +1,52 @@
+realParent()->real_name;
+ $item = $this->real_name;
+ $ret = ''
+ . ''
+ . PMA_Util::getImage('b_close', 'Hide')
+ . '';
+ }
+ return $ret;
+ }
+
+ /**
+ * Returns the type of the item reprsented by the node.
+ *
+ * @return string type of the item
+ */
+ protected abstract function getItemType();
+}
+?>
diff --git a/libraries/navigation/Nodes/Node_Event.class.php b/libraries/navigation/Nodes/Node_Event.class.php
index 80b81c6081..4c5039a3e2 100644
--- a/libraries/navigation/Nodes/Node_Event.class.php
+++ b/libraries/navigation/Nodes/Node_Event.class.php
@@ -9,12 +9,14 @@ if (! defined('PHPMYADMIN')) {
exit;
}
+require_once 'libraries/navigation/Nodes/Node_DatabaseChild.class.php';
+
/**
* Represents a event node in the navigation tree
*
* @package PhpMyAdmin-Navigation
*/
-class Node_Event extends Node
+class Node_Event extends Node_DatabaseChild
{
/**
* Initialises the class
@@ -63,28 +65,13 @@ class Node_Event extends Node
}
/**
- * Returns HTML for hide button displayed infront of the event node
+ * Returns the type of the item represented by the node.
*
- * @return HTML for hide button
+ * @return string type of the item
*/
- public function getHtmlForControlButtons()
+ protected function getItemType()
{
- $ret = '';
- $cfgRelation = PMA_getRelationsParam();
- if ($cfgRelation['navwork']) {
- $db = $this->realParent()->real_name;
- $event = $this->real_name;
- $ret = ''
- . ''
- . PMA_Util::getImage('b_close', 'Hide')
- . '';
- }
- return $ret;
+ return 'event';
}
}
diff --git a/libraries/navigation/Nodes/Node_Function.class.php b/libraries/navigation/Nodes/Node_Function.class.php
index 7c18a376ef..d097dfd88f 100644
--- a/libraries/navigation/Nodes/Node_Function.class.php
+++ b/libraries/navigation/Nodes/Node_Function.class.php
@@ -9,12 +9,14 @@ if (! defined('PHPMYADMIN')) {
exit;
}
+require_once 'libraries/navigation/Nodes/Node_DatabaseChild.class.php';
+
/**
* Represents a function node in the navigation tree
*
* @package PhpMyAdmin-Navigation
*/
-class Node_Function extends Node
+class Node_Function extends Node_DatabaseChild
{
/**
* Initialises the class
@@ -64,28 +66,13 @@ class Node_Function extends Node
}
/**
- * Returns HTML for hide button displayed infront of the function node
+ * Returns the type of the item represented by the node.
*
- * @return HTML for hide button
+ * @return string type of the item
*/
- public function getHtmlForControlButtons()
+ protected function getItemType()
{
- $ret = '';
- $cfgRelation = PMA_getRelationsParam();
- if ($cfgRelation['navwork']) {
- $db = $this->realParent()->real_name;
- $function = $this->real_name;
- $ret = ''
- . ''
- . PMA_Util::getImage('b_close', 'Hide')
- . '';
- }
- return $ret;
+ return 'function';
}
}
diff --git a/libraries/navigation/Nodes/Node_Procedure.class.php b/libraries/navigation/Nodes/Node_Procedure.class.php
index 3b1ba3a0ee..f12240379f 100644
--- a/libraries/navigation/Nodes/Node_Procedure.class.php
+++ b/libraries/navigation/Nodes/Node_Procedure.class.php
@@ -9,12 +9,14 @@ if (! defined('PHPMYADMIN')) {
exit;
}
+require_once 'libraries/navigation/Nodes/Node_DatabaseChild.class.php';
+
/**
* Represents a procedure node in the navigation tree
*
* @package PhpMyAdmin-Navigation
*/
-class Node_Procedure extends Node
+class Node_Procedure extends Node_DatabaseChild
{
/**
* Initialises the class
@@ -64,28 +66,13 @@ class Node_Procedure extends Node
}
/**
- * Returns HTML for hide button displayed infront of the table node
+ * Returns the type of the item represented by the node.
*
- * @return HTML for hide button
+ * @return string type of the item
*/
- public function getHtmlForControlButtons()
+ protected function getItemType()
{
- $ret = '';
- $cfgRelation = PMA_getRelationsParam();
- if ($cfgRelation['navwork']) {
- $db = $this->realParent()->real_name;
- $procedure = $this->real_name;
- $ret = ''
- . ''
- . PMA_Util::getImage('b_close', 'Hide')
- . '';
- }
- return $ret;
+ return 'procedure';
}
}
diff --git a/libraries/navigation/Nodes/Node_Table.class.php b/libraries/navigation/Nodes/Node_Table.class.php
index c3c1eca783..211d0d88b8 100644
--- a/libraries/navigation/Nodes/Node_Table.class.php
+++ b/libraries/navigation/Nodes/Node_Table.class.php
@@ -9,12 +9,14 @@ if (! defined('PHPMYADMIN')) {
exit;
}
+require_once 'libraries/navigation/Nodes/Node_DatabaseChild.class.php';
+
/**
* Represents a columns node in the navigation tree
*
* @package PhpMyAdmin-Navigation
*/
-class Node_Table extends Node
+class Node_Table extends Node_DatabaseChild
{
/**
* Initialises the class
@@ -232,28 +234,13 @@ class Node_Table extends Node
}
/**
- * Returns HTML for hide button displayed infront of the table node
+ * Returns the type of the item represented by the node.
*
- * @return HTML for hide button
+ * @return string type of the item
*/
- public function getHtmlForControlButtons()
+ protected function getItemType()
{
- $ret = '';
- $cfgRelation = PMA_getRelationsParam();
- if ($cfgRelation['navwork']) {
- $db = $this->realParent()->real_name;
- $table = $this->real_name;
- $ret = ''
- . ''
- . PMA_Util::getImage('b_close', 'Hide')
- . '';
- }
- return $ret;
+ return 'table';
}
}
diff --git a/libraries/navigation/Nodes/Node_View.class.php b/libraries/navigation/Nodes/Node_View.class.php
index 7f40f6c8fb..8e02f4ee3d 100644
--- a/libraries/navigation/Nodes/Node_View.class.php
+++ b/libraries/navigation/Nodes/Node_View.class.php
@@ -9,12 +9,14 @@ if (! defined('PHPMYADMIN')) {
exit;
}
+require_once 'libraries/navigation/Nodes/Node_DatabaseChild.class.php';
+
/**
* Represents a view node in the navigation tree
*
* @package PhpMyAdmin-Navigation
*/
-class Node_View extends Node
+class Node_View extends Node_DatabaseChild
{
/**
* Initialises the class
@@ -41,28 +43,13 @@ class Node_View extends Node
}
/**
- * Returns HTML for hide button displayed infront of the view node
+ * Returns the type of the item represented by the node.
*
- * @return HTML for hide button
+ * @return string type of the item
*/
- public function getHtmlForControlButtons()
+ protected function getItemType()
{
- $ret = '';
- $cfgRelation = PMA_getRelationsParam();
- if ($cfgRelation['navwork']) {
- $db = $this->realParent()->real_name;
- $view = $this->real_name;
- $ret = ''
- . ''
- . PMA_Util::getImage('b_close', 'Hide')
- . '';
- }
- return $ret;
+ return 'view';
}
}