Node_DatabaseChild.class.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Functionality for the navigation tree
  5. *
  6. * @package PhpMyAdmin-Navigation
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * Represents a node that is a concrete child of a database node
  13. *
  14. * @package PhpMyAdmin-Navigation
  15. */
  16. abstract class Node_DatabaseChild extends Node
  17. {
  18. /**
  19. * Returns HTML for hide button displayed infront of the database child node
  20. *
  21. * @return String HTML for hide button
  22. */
  23. public function getHtmlForControlButtons()
  24. {
  25. $ret = '';
  26. $cfgRelation = PMA_getRelationsParam();
  27. if ($cfgRelation['navwork']) {
  28. $db = $this->realParent()->real_name;
  29. $item = $this->real_name;
  30. $ret = '<span class="navItemControls">'
  31. . '<a href="navigation.php?'
  32. . PMA_URL_getCommon()
  33. . '&hideNavItem=true'
  34. . '&itemType=' . urlencode($this->getItemType())
  35. . '&itemName=' . urlencode($item)
  36. . '&dbName=' . urlencode($db) . '"'
  37. . ' class="hideNavItem ajax">'
  38. . PMA_Util::getImage('lightbulb_off.png', __('Hide'))
  39. . '</a></span>';
  40. }
  41. return $ret;
  42. }
  43. /**
  44. * Returns the type of the item reprsented by the node.
  45. *
  46. * @return string type of the item
  47. */
  48. protected abstract function getItemType();
  49. }
  50. ?>