Move database related code to Node_Database

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
Madhura Jayaratne 2015-06-23 18:20:28 +05:30
parent 8dc5b922db
commit 312d159922
2 changed files with 27 additions and 13 deletions

View File

@ -759,19 +759,6 @@ class Node
. ' class="hideNavItem ajax">'
. PMA_Util::getImage('lightbulb_off.png', __('Hide'))
. '</a></span>';
} else if ($this instanceof Node_Database) {
if ($this->hiddenCount > 0) {
$ret = '<span class="dbItemControls">'
. '<a href="navigation.php'
. PMA_URL_getCommon()
. '&showUnhideDialog=true'
. '&dbName=' . urldecode($this->real_name) . '"'
. ' class="showUnhide ajax">'
. PMA_Util::getImage(
'lightbulb.png', __('Show hidden items')
)
. '</a></span>';
}
}
}
return $ret;

View File

@ -639,6 +639,33 @@ class Node_Database extends Node
return $retval;
}
/**
* Returns HTML for control buttons displayed infront of a node
*
* @return String HTML for control buttons
*/
public function getHtmlForControlButtons()
{
$ret = '';
$cfgRelation = PMA_getRelationsParam();
if (isset($cfgRelation['navwork']) && $cfgRelation['navwork']) {
if ($this->hiddenCount > 0) {
$ret = '<span class="dbItemControls">'
. '<a href="navigation.php'
. PMA_URL_getCommon()
. '&showUnhideDialog=true'
. '&dbName=' . urldecode($this->real_name) . '"'
. ' class="showUnhide ajax">'
. PMA_Util::getImage(
'lightbulb.png', __('Show hidden items')
)
. '</a></span>';
}
}
return $ret;
}
/**
* Sets the number of hidden items in this database
*